Bug 783315 - Don't touch script->bindings.bindingArray if the script isn't fully compiled (r=billm)

This commit is contained in:
Luke Wagner
2012-08-16 15:38:22 -07:00
parent a3f37be739
commit e2afd0d3fc
5 changed files with 65 additions and 34 deletions

View File

@@ -102,7 +102,7 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *call
// Global/eval script bindings are always empty (all names are added to the
// scope dynamically via JSOP_DEFFUN/VAR).
if (!script->bindings.init(cx, 0, 0, NULL))
if (!script->bindings.initWithTemporaryStorage(cx, 0, 0, NULL))
return NULL;
// We can specialize a bit for the given scope chain if that scope chain is the global object.