diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-13 21:29:23 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:27 -0500 |
commit | d5086ac3aa308bb1ef177834366eeaf7b39bb17e (patch) | |
tree | 9b2c84158cf996b388bcb191130a5062fd7d6992 /js/src/jsapi.cpp | |
parent | 82f9efff935a4ac4379bdfddddc84aae84fc869e (diff) | |
download | uxp-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.gz |
Bug 1331092 - Part 2: Implement Async Generator except yield*.
Tag #1287
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r-- | js/src/jsapi.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index f9a0c6a6bc..6483641f32 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -70,6 +70,7 @@ #include "js/StructuredClone.h" #include "js/Utility.h" #include "vm/AsyncFunction.h" +#include "vm/AsyncIteration.h" #include "vm/DateObject.h" #include "vm/Debugger.h" #include "vm/EnvironmentObject.h" @@ -3591,6 +3592,11 @@ CloneFunctionObject(JSContext* cx, HandleObject funobj, HandleObject env, Handle return nullptr; } + if (IsWrappedAsyncGenerator(fun)) { + JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_CLONE_OBJECT); + return nullptr; + } + if (CanReuseScriptForClone(cx->compartment(), fun, env)) { // If the script is to be reused, either the script can already handle // non-syntactic scopes, or there is only the standard global lexical |