diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-19 15:47:10 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-19 15:47:10 +0100 |
commit | 5ef44cf6484b9dfd49c0174ac2969a29587a1bbd (patch) | |
tree | ef1e8a83106f6b54504dbe3b29554ef7b349a1bb /js/src/vm/AsyncFunction.cpp | |
parent | 6822460d3b0d4609ee5d4e1ab4b093799ed06580 (diff) | |
download | UXP-5ef44cf6484b9dfd49c0174ac2969a29587a1bbd.tar UXP-5ef44cf6484b9dfd49c0174ac2969a29587a1bbd.tar.gz UXP-5ef44cf6484b9dfd49c0174ac2969a29587a1bbd.tar.lz UXP-5ef44cf6484b9dfd49c0174ac2969a29587a1bbd.tar.xz UXP-5ef44cf6484b9dfd49c0174ac2969a29587a1bbd.zip |
Part 1: Implement ES6 function name property semantics
Issue #78
Diffstat (limited to 'js/src/vm/AsyncFunction.cpp')
-rw-r--r-- | js/src/vm/AsyncFunction.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/js/src/vm/AsyncFunction.cpp b/js/src/vm/AsyncFunction.cpp index 1e0c7d7c2..f50c87114 100644 --- a/js/src/vm/AsyncFunction.cpp +++ b/js/src/vm/AsyncFunction.cpp @@ -116,7 +116,7 @@ js::WrapAsyncFunctionWithProto(JSContext* cx, HandleFunction unwrapped, HandleOb // Create a new function with AsyncFunctionPrototype, reusing the name and // the length of `unwrapped`. - RootedAtom funName(cx, unwrapped->name()); + RootedAtom funName(cx, unwrapped->explicitName()); uint16_t length; if (!unwrapped->getLength(cx, &length)) return nullptr; @@ -130,6 +130,9 @@ js::WrapAsyncFunctionWithProto(JSContext* cx, HandleFunction unwrapped, HandleOb if (!wrapped) return nullptr; + if (unwrapped->hasCompileTimeName()) + wrapped->setCompileTimeName(unwrapped->compileTimeName()); + // Link them to each other to make GetWrappedAsyncFunction and // GetUnwrappedAsyncFunction work. unwrapped->setExtendedSlot(UNWRAPPED_ASYNC_WRAPPED_SLOT, ObjectValue(*wrapped)); |