diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-06-08 16:16:14 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-07-18 22:38:18 -0400 |
commit | af32c8553e54455ef8cbfe70a13f79f84c2163a4 (patch) | |
tree | fb43f83a507102c33a9631f3a7d9a2a156024545 /js/src/jsfun.cpp | |
parent | c6fe42095040b0be2ee85bc750bd905bfe396fbd (diff) | |
download | UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.tar UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.tar.gz UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.tar.lz UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.tar.xz UXP-af32c8553e54455ef8cbfe70a13f79f84c2163a4.zip |
1325606 - Return wrapped async function from caller property.
Diffstat (limited to 'js/src/jsfun.cpp')
-rw-r--r-- | js/src/jsfun.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index ef5aea768..06d5cced7 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -284,6 +284,8 @@ CallerGetterImpl(JSContext* cx, const CallArgs& args) } RootedObject caller(cx, iter.callee(cx)); + if (caller->is<JSFunction>() && caller->as<JSFunction>().isAsync()) + caller = GetWrappedAsyncFunction(&caller->as<JSFunction>()); if (!cx->compartment()->wrap(cx, &caller)) return false; @@ -304,6 +306,8 @@ CallerGetterImpl(JSContext* cx, const CallArgs& args) } JSFunction* callerFun = &callerObj->as<JSFunction>(); + if (IsWrappedAsyncFunction(callerFun)) + callerFun = GetUnwrappedAsyncFunction(callerFun); MOZ_ASSERT(!callerFun->isBuiltin(), "non-builtin iterator returned a builtin?"); if (callerFun->strict()) { |