Bug 772688 - add BindingIter and use it instead of directly touching a Binding's shape (r=waldo)

This commit is contained in:
Luke Wagner
2012-07-05 20:35:08 -07:00
parent 12d87619cd
commit 7b5588756d
11 changed files with 226 additions and 257 deletions

View File

@@ -189,7 +189,7 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *call
}
}
// We're not in a function context, so we don't expect any bindings.
JS_ASSERT(sc.bindings.lookup(cx, arguments, NULL) == NONE);
JS_ASSERT(!sc.bindings.hasBinding(cx, arguments));
}
/*
@@ -270,12 +270,12 @@ frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun,
* NB: do not use AutoLocalNameArray because it will release space
* allocated from cx->tempLifoAlloc by DefineArg.
*/
BindingNames names(cx);
if (!funsc.bindings.getLocalNameArray(cx, &names))
BindingVector names(cx);
if (!GetOrderedBindings(cx, funsc.bindings, &names))
return false;
for (unsigned i = 0; i < nargs; i++) {
if (!DefineArg(fn, names[i].maybeAtom, i, &parser))
if (!DefineArg(fn, names[i].maybeName, i, &parser))
return false;
}
}