Bug 1141865 - Part 2: Plumb new.target on the stack and make it accessible to JSNatives. (r=jorendorff, r=jandem, r=shu)
This commit is contained in:
@@ -448,16 +448,14 @@ GetCustomIterator(JSContext* cx, HandleObject obj, unsigned flags, MutableHandle
|
||||
if (!Invoke(cx, ObjectValue(*obj), rval, 1, &arg, &rval))
|
||||
return false;
|
||||
if (rval.isPrimitive()) {
|
||||
/*
|
||||
* We are always coming from js::ValueToIterator, and we are no longer on
|
||||
* trace, so the object we are iterating over is on top of the stack (-1).
|
||||
*/
|
||||
// Ignore the stack when throwing. We can't tell whether we were
|
||||
// supposed to skip over a new.target or not.
|
||||
JSAutoByteString bytes;
|
||||
if (!AtomToPrintableString(cx, name, &bytes))
|
||||
return false;
|
||||
RootedValue val(cx, ObjectValue(*obj));
|
||||
ReportValueError2(cx, JSMSG_BAD_TRAP_RETURN_VALUE,
|
||||
-1, val, nullptr, bytes.ptr());
|
||||
JSDVG_IGNORE_STACK, val, nullptr, bytes.ptr());
|
||||
return false;
|
||||
}
|
||||
objp.set(&rval.toObject());
|
||||
|
||||
Reference in New Issue
Block a user