Bug 749617 - improve getLocalNamesArray (r=waldo,a=not-libxul)

This commit is contained in:
Luke Wagner
2012-05-01 15:45:01 -07:00
parent f99bf99bf0
commit f2314f6905
7 changed files with 35 additions and 28 deletions

View File

@@ -377,12 +377,12 @@ frontend::CompileFunctionBody(JSContext *cx, JSFunction *fun,
* NB: do not use AutoLocalNameArray because it will release space
* allocated from cx->tempLifoAlloc by DefineArg.
*/
Vector<JSAtom *> names(cx);
BindingNames names(cx);
if (!funbce.bindings.getLocalNameArray(cx, &names)) {
fn = NULL;
} else {
for (unsigned i = 0; i < nargs; i++) {
if (!DefineArg(fn, names[i], i, &funbce)) {
if (!DefineArg(fn, names[i].maybeAtom, i, &funbce)) {
fn = NULL;
break;
}