summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r--js/src/jsapi.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index e6fc1f98b..85a38bba4 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);
@@ -3435,10 +3435,7 @@ JS::NewFunctionFromSpec(JSContext* cx, const JSFunctionSpec* fs, HandleId id)
{
return nullptr;
}
- JSFunction* fun = &funVal.toObject().as<JSFunction>();
- if (fs->flags & JSFUN_HAS_REST)
- fun->setHasRest();
- return fun;
+ return &funVal.toObject().as<JSFunction>();
}
RootedAtom atom(cx, IdToFunctionName(cx, id));
@@ -3618,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*)