mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
parent
97197f29bf
commit
5f3e5dc3fb
13 changed files with 704 additions and 203 deletions
|
|
@ -1171,13 +1171,19 @@ ProcessTryNotes(JSContext* cx, EnvironmentIter& ei, InterpreterRegs& regs)
|
|||
SettleOnTryNote(cx, tn, ei, regs);
|
||||
return FinallyContinuation;
|
||||
|
||||
case JSTRY_FOR_IN: {
|
||||
case JSTRY_FOR_IN:
|
||||
case JSTRY_ITERCLOSE: {
|
||||
/* This is similar to JSOP_ENDITER in the interpreter loop. */
|
||||
DebugOnly<jsbytecode*> pc = regs.fp()->script()->main() + tn->start + tn->length;
|
||||
MOZ_ASSERT(JSOp(*pc) == JSOP_ENDITER);
|
||||
MOZ_ASSERT_IF(tn->kind == JSTRY_FOR_IN, JSOp(*pc) == JSOP_ENDITER);
|
||||
Value* sp = regs.spForStackDepth(tn->stackDepth);
|
||||
RootedObject obj(cx, &sp[-1].toObject());
|
||||
if (!UnwindIteratorForException(cx, obj)) {
|
||||
bool ok;
|
||||
if (tn->kind == JSTRY_FOR_IN)
|
||||
ok = UnwindIteratorForException(cx, obj);
|
||||
else
|
||||
ok = IteratorCloseForException(cx, obj);
|
||||
if (!ok) {
|
||||
// We should only settle on the note only if
|
||||
// UnwindIteratorForException itself threw, as
|
||||
// onExceptionUnwind should be called anew with the new
|
||||
|
|
@ -5040,7 +5046,12 @@ js::ThrowCheckIsObject(JSContext* cx, CheckIsObjectKind kind)
|
|||
{
|
||||
switch (kind) {
|
||||
case CheckIsObjectKind::IteratorNext:
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NEXT_RETURNED_PRIMITIVE);
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_ITER_METHOD_RETURNED_PRIMITIVE, "next");
|
||||
break;
|
||||
case CheckIsObjectKind::IteratorReturn:
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_ITER_METHOD_RETURNED_PRIMITIVE, "return");
|
||||
break;
|
||||
case CheckIsObjectKind::GetIterator:
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_GET_ITER_RETURNED_PRIMITIVE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue