diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-13 20:59:32 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:25 -0500 |
commit | f8e41dc1988c620b85d96358a2e13d6d876dfec8 (patch) | |
tree | db9e4dce1b1c92b477720f1eba9a9ec04b3f8e2d /js/src/vm/Debugger.cpp | |
parent | 60fa4f3a848c107b46062632fc5901bbf1e46ca0 (diff) | |
download | uxp-f8e41dc1988c620b85d96358a2e13d6d876dfec8.tar.gz |
Bug 1316098 - Optimize out result object allocation for await/return in async function.
Tag mcp-graveyard/UXP#1287
Diffstat (limited to 'js/src/vm/Debugger.cpp')
-rw-r--r-- | js/src/vm/Debugger.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 7c09c50b06..2680699a46 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -32,7 +32,6 @@ #include "js/Vector.h" #include "proxy/ScriptedProxyHandler.h" #include "vm/ArgumentsObject.h" -#include "vm/AsyncFunction.h" #include "vm/DebuggerMemory.h" #include "vm/GeneratorObject.h" #include "vm/SPSProfiler.h" @@ -1560,16 +1559,11 @@ CheckResumptionValue(JSContext* cx, AbstractFramePtr frame, const Maybe<HandleVa JSTrapStatus status, MutableHandleValue vp) { if (status == JSTRAP_RETURN && frame && frame.isFunctionFrame()) { - // Don't let a { return: ... } resumption value make a generator or - // async function violate the iterator protocol. The return value from + // Don't let a { return: ... } resumption value make a generator + // function violate the iterator protocol. The return value from // such a frame must have the form { done: <bool>, value: <anything> }. RootedFunction callee(cx, frame.callee()); - if (callee->isAsync()) { - if (!CheckAsyncResumptionValue(cx, vp)) { - JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DEBUG_BAD_AWAIT); - return false; - } - } else if (callee->isStarGenerator() || callee->isAsync()) { + if (callee->isStarGenerator()) { if (!CheckStarGeneratorResumptionValue(cx, vp)) { JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_DEBUG_BAD_YIELD); return false; |