Bug 808949 - Remove clearParent and clearType from {Clone,XDR}InterpretedFunction. (r=bhackett)

This commit is contained in:
Shu-yu Guo 2012-11-16 09:24:24 -08:00
parent 8e50ee30d1
commit 34d91f71c3

View File

@ -397,14 +397,9 @@ js::XDRInterpretedFunction(XDRState<mode> *xdr, HandleObject enclosingScope, Han
atom = fun->atom();
script = fun->script();
} else {
RootedObject parent(cx, NULL);
fun = js_NewFunction(cx, NullPtr(), NULL, 0, JSFunction::INTERPRETED, parent, NullPtr());
fun = js_NewFunction(cx, NullPtr(), NULL, 0, JSFunction::INTERPRETED, NullPtr(), NullPtr());
if (!fun)
return false;
if (!JSObject::clearParent(cx, fun))
return false;
if (!JSObject::clearType(cx, fun))
return false;
atom = NULL;
script = NULL;
}
@ -449,15 +444,10 @@ js::CloneInterpretedFunction(JSContext *cx, HandleObject enclosingScope, HandleF
/* NB: Keep this in sync with XDRInterpretedFunction. */
RootedObject parent(cx, NULL);
RootedFunction
clone(cx, js_NewFunction(cx, NullPtr(), NULL, 0, JSFunction::INTERPRETED, parent, NullPtr()));
RootedFunction clone(cx, js_NewFunction(cx, NullPtr(), NULL, 0,
JSFunction::INTERPRETED, NullPtr(), NullPtr()));
if (!clone)
return NULL;
if (!JSObject::clearParent(cx, clone))
return NULL;
if (!JSObject::clearType(cx, clone))
return NULL;
RootedScript srcScript(cx, srcFun->script());
RawScript clonedScript = CloneScript(cx, enclosingScope, clone, srcScript);