From f07d5707c77e73031b6921faac165ca7f8d577c6 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 1 Dec 2019 18:44:06 -0500 Subject: Bug 1343481 - Part 2: Stop using StarGegerator for async function. Tag #1287 --- js/src/vm/AsyncFunction.cpp | 2 +- js/src/vm/Debugger.cpp | 2 +- js/src/vm/GeneratorObject.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'js/src/vm') diff --git a/js/src/vm/AsyncFunction.cpp b/js/src/vm/AsyncFunction.cpp index e14b77424..be7a36ecc 100644 --- a/js/src/vm/AsyncFunction.cpp +++ b/js/src/vm/AsyncFunction.cpp @@ -109,7 +109,7 @@ WrappedAsyncFunction(JSContext* cx, unsigned argc, Value* vp) JSObject* js::WrapAsyncFunctionWithProto(JSContext* cx, HandleFunction unwrapped, HandleObject proto) { - MOZ_ASSERT(unwrapped->isStarGenerator()); + MOZ_ASSERT(unwrapped->isAsync()); MOZ_ASSERT(proto, "We need an explicit prototype to avoid the default" "%FunctionPrototype% fallback in NewFunctionWithProto()."); diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index b3efeb175..7c09c50b0 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -1569,7 +1569,7 @@ CheckResumptionValue(JSContext* cx, AbstractFramePtr frame, const MaybeisStarGenerator()) { + } else if (callee->isStarGenerator() || callee->isAsync()) { if (!CheckStarGeneratorResumptionValue(cx, vp)) { JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DEBUG_BAD_YIELD); return false; diff --git a/js/src/vm/GeneratorObject.cpp b/js/src/vm/GeneratorObject.cpp index 448bc543d..c0dff8faa 100644 --- a/js/src/vm/GeneratorObject.cpp +++ b/js/src/vm/GeneratorObject.cpp @@ -25,7 +25,7 @@ GeneratorObject::create(JSContext* cx, AbstractFramePtr frame) Rooted global(cx, cx->global()); RootedNativeObject obj(cx); - if (frame.script()->isStarGenerator()) { + if (frame.script()->isStarGenerator() || frame.script()->isAsync()) { RootedValue pval(cx); RootedObject fun(cx, frame.callee()); // FIXME: This would be faster if we could avoid doing a lookup to get -- cgit v1.2.3