Bug 1136980 part 2. Remove JS_SetParent, even though we have a CLOSED TREE. r=waldo

This commit is contained in:
Boris Zbarsky 2015-02-27 11:46:58 -05:00
Родитель b4fd367105
Коммит 93d45c4f60
2 изменённых файлов: 1 добавлений и 16 удалений

Просмотреть файл

@ -1724,18 +1724,6 @@ JS_GetParent(JSObject *obj)
return obj->getParent(); return obj->getParent();
} }
JS_PUBLIC_API(bool)
JS_SetParent(JSContext *cx, HandleObject obj, HandleObject parent)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
MOZ_ASSERT(!obj->is<ScopeObject>());
MOZ_ASSERT(parent || !obj->getParent());
assertSameCompartment(cx, obj, parent);
return JSObject::setParent(cx, obj, parent);
}
JS_PUBLIC_API(JSObject *) JS_PUBLIC_API(JSObject *)
JS_GetConstructor(JSContext *cx, HandleObject proto) JS_GetConstructor(JSContext *cx, HandleObject proto)
{ {

Просмотреть файл

@ -2244,9 +2244,6 @@ JS_SetPrototype(JSContext *cx, JS::HandleObject obj, JS::HandleObject proto);
extern JS_PUBLIC_API(JSObject *) extern JS_PUBLIC_API(JSObject *)
JS_GetParent(JSObject *obj); JS_GetParent(JSObject *obj);
extern JS_PUBLIC_API(bool)
JS_SetParent(JSContext *cx, JS::HandleObject obj, JS::HandleObject parent);
extern JS_PUBLIC_API(JSObject *) extern JS_PUBLIC_API(JSObject *)
JS_GetConstructor(JSContext *cx, JS::Handle<JSObject*> proto); JS_GetConstructor(JSContext *cx, JS::Handle<JSObject*> proto);
@ -3638,7 +3635,7 @@ JS_DecompileFunctionBody(JSContext *cx, JS::Handle<JSFunction*> fun, unsigned in
* names) of the execution context for script. * names) of the execution context for script.
* *
* Using obj as the variables object is problematic if obj's parent (which is * Using obj as the variables object is problematic if obj's parent (which is
* the scope chain link; see JS_SetParent and JS_NewObject) is not null: in * the scope chain link) is not null, which in practice is always true: in
* this case, variables created by 'var x = 0', e.g., go in obj, but variables * this case, variables created by 'var x = 0', e.g., go in obj, but variables
* created by assignment to an unbound id, 'x = 0', go in the last object on * created by assignment to an unbound id, 'x = 0', go in the last object on
* the scope chain linked by parent. * the scope chain linked by parent.