Skip to content

Commit df9078d

Browse files
ksh8281claude
andcommitted
Fix labeled continue regression in test262 tests
Remove the conditional labeled continue processing from loop statements. The LabelledStatementNode correctly handles all labeled continues after the labeled statement completes. Loops should only handle their own regular (unlabeled) continues. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
1 parent de1b124 commit df9078d

4 files changed

Lines changed: 0 additions & 22 deletions

File tree

src/parser/ast/DoWhileStatementNode.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ class DoWhileStatementNode : public StatementNode {
6767
size_t doEnd = codeBlock->currentCodeSize();
6868
newContext.consumeContinuePositions(codeBlock, testPos, newContext.tryCatchWithBlockStatementCount());
6969

70-
// Consume labeled continues targeting THIS loop with proper morphing (Issue #1571)
71-
if (context->m_currentLoopLabel) {
72-
newContext.consumeLabelledContinuePositions(codeBlock, testPos, context->m_currentLoopLabel, newContext.tryCatchWithBlockStatementCount());
73-
}
74-
7570
newContext.consumeBreakPositions(codeBlock, doEnd, newContext.tryCatchWithBlockStatementCount());
7671
newContext.m_positionToContinue = testPos;
7772
newContext.propagateInformationTo(*context);

src/parser/ast/ForInOfStatementNode.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,6 @@ class ForInOfStatementNode : public StatementNode {
373373
newContext.consumeContinuePositions(codeBlock, continuePosition, newContext.tryCatchWithBlockStatementCount());
374374
newContext.m_positionToContinue = continuePosition;
375375

376-
// Consume labeled continues targeting THIS loop with proper morphing (Issue #1571)
377-
// This ensures iterator cleanup and environment unwinding are properly sequenced
378-
if (context->m_currentLoopLabel) {
379-
newContext.consumeLabelledContinuePositions(codeBlock, continuePosition, context->m_currentLoopLabel, newContext.tryCatchWithBlockStatementCount());
380-
}
381-
382376
if (!m_forIn) {
383377
TryStatementNode::generateTryStatementBodyEndByteCode(codeBlock, &newContext, this, forOfTryStatementContext);
384378
TryStatementNode::generateTryFinalizerStatementStartByteCode(codeBlock, &newContext, this, forOfTryStatementContext, true);

src/parser/ast/ForStatementNode.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,6 @@ class ForStatementNode : public StatementNode {
206206
newContext.consumeContinuePositions(codeBlock, updatePosition, newContext.tryCatchWithBlockStatementCount());
207207
newContext.m_positionToContinue = updatePosition;
208208

209-
// Consume labeled continues targeting THIS loop with proper morphing (Issue #1571)
210-
// This ensures continues inside allocated blocks are properly unwound via JumpComplexCase
211-
if (context->m_currentLoopLabel) {
212-
newContext.consumeLabelledContinuePositions(codeBlock, updatePosition, context->m_currentLoopLabel, newContext.tryCatchWithBlockStatementCount());
213-
}
214-
215209
if (m_iterationLexicalBlockIndex != LEXICAL_BLOCK_INDEX_MAX) {
216210
InterpretedCodeBlock::BlockInfo* bi = codeBlock->m_codeBlock->blockInfo(m_iterationLexicalBlockIndex);
217211
codeBlock->finalizeLexicalBlock(&newContext, iterationBlockContext);

src/parser/ast/WhileStatementNode.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ class WhileStatementNode : public StatementNode {
8181
codeBlock->pushCode(Jump(ByteCodeLOC(m_loc.index), whileStart), &newContext, this->m_loc.index);
8282
newContext.consumeContinuePositions(codeBlock, whileStart, newContext.tryCatchWithBlockStatementCount());
8383

84-
// Consume labeled continues targeting THIS loop with proper morphing (Issue #1571)
85-
if (context->m_currentLoopLabel) {
86-
newContext.consumeLabelledContinuePositions(codeBlock, whileStart, context->m_currentLoopLabel, newContext.tryCatchWithBlockStatementCount());
87-
}
88-
8984
size_t whileEnd = codeBlock->currentCodeSize();
9085
newContext.consumeBreakPositions(codeBlock, whileEnd, newContext.tryCatchWithBlockStatementCount());
9186
if (testPos != SIZE_MAX)

0 commit comments

Comments
 (0)