mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 21:46:01 +00:00
fix(javascript): preserve abrupt destructuring boundaries (#13433)
* fix(javascript): preserve abrupt destructuring boundaries * test(javascript): consolidate destructuring Evidence trace checks * fix(javascript): evaluate computed nullish receivers
This commit is contained in:
1 parent
3db9120c5e
commit
365bbd9008
4 files changed
+182
-166
No files matched your search
@@ -415,7 +415,6 @@ it.each(["{}", "unknownSource"])(
|
||||
);
|
||||
|
||||
it.each([
|
||||
["ordinary array", "", "resolved"],
|
||||
["prototype read alone", "Object.getPrototypeOf([].values());", "resolved"],
|
||||
[
|
||||
"one iterator's own next",
|
||||
@@ -715,24 +714,6 @@ it.each([
|
||||
},
|
||||
);
|
||||
|
||||
it("leaves an earlier destructuring dependency intact before an iterator prototype write", () => {
|
||||
const graph = graphForJavaScript(`
|
||||
const config = ["original"];
|
||||
const [selected] = config;
|
||||
Object.getPrototypeOf([].values()).next = () => ({ value: "other", done: false });
|
||||
`);
|
||||
const selected = graph.nodes.find(
|
||||
({ kind, label }) => kind === "binding" && label === "selected",
|
||||
);
|
||||
expect(
|
||||
graph.relations.find(
|
||||
(relation) =>
|
||||
relation.relation === "destructures" &&
|
||||
relation.target_node_id === selected?.node_id,
|
||||
),
|
||||
).toMatchObject({ resolution: "resolved" });
|
||||
});
|
||||
|
||||
it.each([
|
||||
["declaration", "const [selected] = config;", "resolved"],
|
||||
["assignment", "let selected; [selected] = config;", "resolved"],
|
||||
|
||||
Reference in new issue
Block a user