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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user