Bug 1140586 part 5. Split up js::NewFunction into several different APIs that are more clear in terms of what they do and don't need parents as much. r=waldo

This commit is contained in:
Boris Zbarsky
2015-03-11 22:33:59 -04:00
parent 18333af8bc
commit f436c0be1f
14 changed files with 108 additions and 87 deletions

View File

@@ -2504,14 +2504,7 @@ DefineConstructorAndPrototype(JSContext *cx, HandleObject obj, JSProtoKey key, H
ctor = proto;
} else {
/*
* Create the constructor, not using GlobalObject::createConstructor
* because the constructor currently must have |obj| as its parent.
* (FIXME: remove this dependency on the exact identity of the parent,
* perhaps as part of bug 638316.)
*/
RootedFunction fun(cx, NewFunction(cx, constructor, nargs,
JSFunction::NATIVE_CTOR, obj, atom, ctorKind));
RootedFunction fun(cx, NewNativeConstructor(cx, constructor, nargs, atom, ctorKind));
if (!fun)
goto bad;