Bug 780309 - Implement InternalHandle and use it for Bindings. r=terrence

This commit is contained in:
Steve Fink
2012-09-10 11:26:46 -07:00
parent 6276c3ad9e
commit e7b4d3147e
8 changed files with 113 additions and 60 deletions

View File

@@ -114,7 +114,8 @@ 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.initWithTemporaryStorage(cx, 0, 0, NULL))
InternalHandle<Bindings*> bindings(script, &script->bindings);
if (!Bindings::initWithTemporaryStorage(cx, bindings, 0, 0, NULL))
return NULL;
// We can specialize a bit for the given scope chain if that scope chain is the global object.
@@ -327,7 +328,8 @@ frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun, CompileOptions
if (!script)
return false;
if (!funpc.generateFunctionBindings(cx, &script->bindings))
InternalHandle<Bindings*> bindings(script, &script->bindings);
if (!funpc.generateFunctionBindings(cx, bindings))
return false;
BytecodeEmitter funbce(/* parent = */ NULL, &parser, &funsc, script, /* callerFrame = */ NULL,