fix(javascript): retain iterator prototype effects through array spreads (#12563)

* fix(javascript): retain ambient references through array spread

* fix(javascript): retain spread aliases to inherited iterator close hooks

* fix(javascript): share dense inline array spread layout (#12564)

* fix(javascript): share dense inline array spread layout

* fix(javascript): report exhausted dense spread layout allowance

* fix(javascript): preserve getter receivers through array spread

* fix(javascript): guard native array iteration from opaque global code

* test(javascript): group spread receiver controls

* test(javascript): preserve getter fixture tuple types

* fix(javascript): preserve spread slot projections for iterator receivers
This commit is contained in:
morluto authored and GitHub committed 2026-11-19 23:27:01 +00:00
1 parent 1a070dee80
commit 7cb3f1090c
20 files changed
+907 -98

No files matched your search

@@ -50,6 +50,7 @@ const expectedDependencies = [
["arrayObject", ["0", "mode"]],
["nestedElement", ["items", "0"]],
["innerElement", ["0", "0"]],
["spreadElement", ["1"]],
["aliasedPrototypeElement", ["0", "0"], "candidate"],
["selected", ["0"], "candidate"],
["beforeClose", ["label"]],
@@ -62,6 +63,23 @@ const expectedDependencies = [
["projectedAfterAcquisition", ["parent", "next", "mode"], "candidate"],
] as const;
const tracedBindings = [
"declared",
"ordinary",
"arrayAssigned",
"elided",
"projected",
"arrayObject",
"nestedElement",
"innerElement",
"spreadElement",
"aliasedPrototypeElement",
"selected",
"beforeClose",
"consumed",
"afterClose",
] as const;
cliTest(
"traces proved destructuring dependencies and leaves custom iteration uncertain",
async ({ cli }) => {
@@ -109,6 +127,9 @@ cliTest(
const nestedPairs = [["read-time"]];
const [[innerElement]] = nestedPairs;
nestedPairs[0][0] = "later";
const spreadSource = [...["prefix"], "read-time"];
const [,spreadElement] = spreadSource;
spreadSource[1] = "later";
const box = { items: [] };
const iterator = box.items.values();
const prototype = Reflect.getPrototypeOf(iterator);
@@ -162,21 +183,7 @@ cliTest(
),
).toMatchObject({ resolution: "resolved" });
const queryPath = join(root, "query.json");
for (const name of [
"declared",
"ordinary",
"arrayAssigned",
"elided",
"projected",
"arrayObject",
"nestedElement",
"innerElement",
"aliasedPrototypeElement",
"selected",
"beforeClose",
"consumed",
"afterClose",
]) {
for (const name of tracedBindings) {
const binding = graph.nodes.find(
({ kind, label }) => kind === "binding" && label === name,
);