Bug 469405 - Handle an __iterator__ implementation returning a primitive value on trace. r=brendan

This commit is contained in:
Blake Kaplan
2009-02-07 11:28:23 -08:00
parent d728eb50ea
commit c3f9344ad9
7 changed files with 35 additions and 17 deletions

View File

@@ -416,12 +416,8 @@ js_ValueToIterator(JSContext *cx, uintN flags, jsval *vp)
goto bad;
}
if (JSVAL_IS_PRIMITIVE(*vp)) {
const char *printable = js_AtomToPrintableString(cx, atom);
if (printable) {
js_ReportValueError2(cx, JSMSG_BAD_ITERATOR_RETURN,
JSDVG_SEARCH_STACK, *vp, NULL,
printable);
}
js_ReportValueError(cx, JSMSG_BAD_ITERATOR_RETURN,
JSDVG_SEARCH_STACK, *vp, NULL);
goto bad;
}
}