зеркало из https://github.com/mozilla/gecko-dev.git
Bug 808949 - Remove clearParent and clearType from {Clone,XDR}InterpretedFunction. (r=bhackett)
This commit is contained in:
Родитель
02f84ecb22
Коммит
39b7ddae3d
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче