Bug 775323 - move bindings construction (r=jorendorff)

--HG--
extra : rebase_source : 05e12cd2e2f7bd472bc1b5abdf1ebe51411e1975
This commit is contained in:
Luke Wagner 2012-07-30 18:37:55 -07:00
parent 81d9415df5
commit cb24190c04

View File

@ -1528,6 +1528,7 @@ JSScript::Create(JSContext *cx, HandleObject enclosingScope, bool savedCallerFun
return NULL;
PodZero(script);
new (&script->bindings) Bindings;
script->enclosingScope_ = enclosingScope;
script->savedCallerFun = savedCallerFun;
@ -1592,8 +1593,6 @@ JSScript::partiallyInit(JSContext *cx, Handle<JSScript*> script,
script->length = length;
new (&script->bindings) Bindings;
uint8_t *cursor = script->data;
if (nconsts != 0) {
script->setHasArray(CONSTS);
@ -2222,7 +2221,6 @@ js::CloneScript(JSContext *cx, HandleObject enclosingScope, HandleFunction fun,
return NULL;
}
new (&dst->bindings) Bindings;
dst->bindings.transfer(&bindings);
/* This assignment must occur before all the Rebase calls. */