mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Bug 1147371: Implement calling IteratorClose and "return" on iterators in yield*
Issue #74
This commit is contained in:
parent
d36d40760a
commit
95390009cc
10 changed files with 232 additions and 45 deletions
|
|
@ -1887,7 +1887,6 @@ CASE(EnableInterruptsPseudoOpcode)
|
|||
/* Various 1-byte no-ops. */
|
||||
CASE(JSOP_NOP)
|
||||
CASE(JSOP_NOP_DESTRUCTURING)
|
||||
CASE(JSOP_UNUSED187)
|
||||
CASE(JSOP_UNUSED192)
|
||||
CASE(JSOP_UNUSED209)
|
||||
CASE(JSOP_UNUSED210)
|
||||
|
|
@ -2182,6 +2181,13 @@ CASE(JSOP_ENDITER)
|
|||
}
|
||||
END_CASE(JSOP_ENDITER)
|
||||
|
||||
CASE(JSOP_ISGENCLOSING)
|
||||
{
|
||||
bool b = REGS.sp[-1].isMagic(JS_GENERATOR_CLOSING);
|
||||
PUSH_BOOLEAN(b);
|
||||
}
|
||||
END_CASE(JSOP_ISGENCLOSING)
|
||||
|
||||
CASE(JSOP_DUP)
|
||||
{
|
||||
MOZ_ASSERT(REGS.stackDepth() >= 1);
|
||||
|
|
@ -5074,6 +5080,10 @@ js::ThrowCheckIsObject(JSContext* cx, CheckIsObjectKind kind)
|
|||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_ITER_METHOD_RETURNED_PRIMITIVE, "return");
|
||||
break;
|
||||
case CheckIsObjectKind::IteratorThrow:
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
|
||||
JSMSG_ITER_METHOD_RETURNED_PRIMITIVE, "throw");
|
||||
break;
|
||||
case CheckIsObjectKind::GetIterator:
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_GET_ITER_RETURNED_PRIMITIVE);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue