mirror of
https://github.com/morluto/rea.git
synced 2026-11-20 05:32:44 +00:00
fix(javascript): retain numeric reads from projected arrays (#12624)
This commit is contained in:
1 parent
e9ecf900d2
commit
ba2d70d71e
4 files changed
+73
-31
No files matched your search
@@ -2107,6 +2107,48 @@ it.each([
|
||||
["0", "0"],
|
||||
"resolved",
|
||||
],
|
||||
[
|
||||
"a numeric own slot on a projected array RHS",
|
||||
'const box={pairs:[["one"]]};const {0:[selected]}=box.pairs;box.pairs[0][0]="later";',
|
||||
["pairs", "0", "0"],
|
||||
"resolved",
|
||||
],
|
||||
[
|
||||
"a quoted own slot on a projected const alias",
|
||||
'const box={pairs:[["one"]]};const alias=box;let selected;({"0":[selected]}=alias.pairs);box.pairs[0][0]="later";',
|
||||
["pairs", "0", "0"],
|
||||
"resolved",
|
||||
],
|
||||
[
|
||||
"a numeric own slot under an own object path",
|
||||
'const box={nested:{pairs:[["one"]]}};const {0:[selected]}=box.nested.pairs;box.nested.pairs[0][0]="later";',
|
||||
["nested", "pairs", "0", "0"],
|
||||
"resolved",
|
||||
],
|
||||
[
|
||||
"a numeric slot selected through an accessor",
|
||||
'const box={get pairs(){return [["one"]];}};const {0:[selected]}=box.pairs;box.pairs[0][0]="later";',
|
||||
["pairs", "0", "0"],
|
||||
"candidate",
|
||||
],
|
||||
[
|
||||
"an earlier replacement of the projected array receiver",
|
||||
'const box={pairs:[["one"]]};box.pairs=[["earlier"]];const {0:[selected]}=box.pairs;box.pairs[0][0]="later";',
|
||||
["pairs", "0", "0"],
|
||||
"candidate",
|
||||
],
|
||||
[
|
||||
"a hole in a projected array",
|
||||
'const box={pairs:[,["one"]]};const {0:[selected]}=box.pairs;box.pairs[0]=["later"];',
|
||||
["pairs", "0", "0"],
|
||||
"candidate",
|
||||
],
|
||||
[
|
||||
"an early inner iterator overwrite at a projected array slot",
|
||||
'const box={pairs:[["one"]]};Object.getPrototypeOf([].values()).next=()=>({done:true});const {0:[selected]}=box.pairs;box.pairs[0][0]="later";',
|
||||
["pairs", "0", "0"],
|
||||
"candidate",
|
||||
],
|
||||
[
|
||||
"a quoted own array slot captured through a const alias",
|
||||
'const pairs=[["one"]];const alias=pairs;let selected;({"0":[selected]}=alias);pairs[0][0]="later";',
|
||||
|
||||
Reference in new issue
Block a user