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/jsapi.cpp | |
parent | 6822460d3b0d4609ee5d4e1ab4b093799ed06580 (diff) | |
download | uxp-5ef44cf6484b9dfd49c0174ac2969a29587a1bbd.tar.gz |
Part 1: Implement ES6 function name property semantics
Issue #78
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r-- | js/src/jsapi.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index bbf4678084..85a38bba42 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -2095,7 +2095,7 @@ DefinePropertyById(JSContext* cx, HandleObject obj, HandleId id, HandleValue val getter != JS_PropertyStub && setter != JS_StrictPropertyStub) { if (getter && !(attrs & JSPROP_GETTER)) { - RootedAtom atom(cx, IdToFunctionName(cx, id, "get")); + RootedAtom atom(cx, IdToFunctionName(cx, id, FunctionPrefixKind::Get)); if (!atom) return false; JSFunction* getobj = NewNativeFunction(cx, (Native) getter, 0, atom); @@ -2111,7 +2111,7 @@ DefinePropertyById(JSContext* cx, HandleObject obj, HandleId id, HandleValue val if (setter && !(attrs & JSPROP_SETTER)) { // Root just the getter, since the setter is not yet a JSObject. AutoRooterGetterSetter getRoot(cx, JSPROP_GETTER, &getter, nullptr); - RootedAtom atom(cx, IdToFunctionName(cx, id, "set")); + RootedAtom atom(cx, IdToFunctionName(cx, id, FunctionPrefixKind::Set)); if (!atom) return false; JSFunction* setobj = NewNativeFunction(cx, (Native) setter, 1, atom); @@ -3615,7 +3615,7 @@ JS_GetFunctionObject(JSFunction* fun) JS_PUBLIC_API(JSString*) JS_GetFunctionId(JSFunction* fun) { - return fun->name(); + return fun->explicitName(); } JS_PUBLIC_API(JSString*) |