Bug 469405 - Handle an __iterator__ implementation returning a primitive value on trace. r=brendan
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user