fix(javascript): honor outer lexical order through standalone blocks (#12701)

fix(javascript): carry lexical timing through standalone blocks
This commit is contained in:
morluto authored and GitHub committed 2026-11-19 21:24:20 -05:00
1 parent 2245d25aaa
commit c0ee832a30
3 files changed
+76 -26

No files matched your search

@@ -2759,6 +2759,30 @@ it.each([
["1"],
"candidate",
],
[
"let target in a standalone block before an outer declaration",
'let selected;const xs=[1,"one"];{[fixed,selected]=xs;}let fixed;',
["1"],
"candidate",
],
[
"let target in multiple standalone blocks before a function-local declaration",
'function run(){let selected;const xs=[1,"one"];{{[fixed,selected]=xs;}}let fixed;}',
["1"],
"candidate",
],
[
"let target in a standalone block after the outer declaration",
'let selected;let fixed;const xs=[1,"one"];{[fixed,selected]=xs;}',
["1"],
"resolved",
],
[
"deferred callable declared inside an earlier standalone block",
'let read;{read=()=>{let selected;const xs=[1,"one"];[fixed,selected]=xs;};}let fixed;read();',
["1"],
"resolved",
],
[
"read before an uninitialized target",
"let selected;let later;const xs=[1,2,3];[selected,fixed,later]=xs;let fixed;",