Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix
in
operator inside for statement destructuring
https://bugs.webkit.org/show_bug.cgi?id=247436 rdar://102065296 Reviewed by Alexey Shvayka. Destructing statement should allow `in` operator even in `for...in/of`. * JSTests/stress/destructing-in.js: Added. (shouldBe): * Source/JavaScriptCore/parser/Parser.cpp: (JSC::Parser<LexerType>::parseVariableDeclarationList): Canonical link: https://commits.webkit.org/256497@main
- Loading branch information
Yijia Huang
committed
Nov 9, 2022
1 parent
6a2efe7
commit 598cda6
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
for (var { x = 0 in [0] } of [0]) { | ||
shouldBe(x, true); | ||
} | ||
|
||
for (var { x = (0 in [0]) } of [0]) { | ||
shouldBe(x, true); | ||
} | ||
|
||
for (var { x = 0 in [0] } in [0]) { | ||
shouldBe(x, true); | ||
} | ||
|
||
for (var { x = (0 in [0]) } in [0]) { | ||
shouldBe(x, true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters