mirror of
https://github.com/morluto/rea.git
synced 2026-11-20 13:45:30 +00:00
fix(javascript): honor outer lexical order through standalone blocks (#12701)
fix(javascript): carry lexical timing through standalone blocks
This commit is contained in:
1 parent
2245d25aaa
commit
c0ee832a30
3 files changed
+76
-26
No files matched your search
@@ -88,6 +88,26 @@ const declaratorOrderSource = `
|
||||
let readLater = ([later, uninitializedLater] = cells), later;
|
||||
`;
|
||||
|
||||
const outerDeclarationSource = `
|
||||
let ready, afterReady, beforeOuterLet, afterOuterLet;
|
||||
const cells = ["before", 1, "unreached"];
|
||||
{ [ready, afterReady] = cells; }
|
||||
{ [beforeOuterLet, pending, afterOuterLet] = cells; }
|
||||
let pending;
|
||||
`;
|
||||
|
||||
const additionalFixtures = [
|
||||
["iterator-close.js", iteratorCloseSource],
|
||||
["array-prototype-alias.js", arrayPrototypeAliasSource],
|
||||
["abrupt-object-pattern.js", abruptObjectPatternSource],
|
||||
["first-default.js", firstDefaultSource],
|
||||
["immutable-target.js", immutableTargetSource],
|
||||
["class-name-target.js", classNameTargetSource],
|
||||
["uninitialized-target.js", uninitializedTargetSource],
|
||||
["declarator-order.js", declaratorOrderSource],
|
||||
["outer-let.js", outerDeclarationSource],
|
||||
] as const;
|
||||
|
||||
const expectedDependencies = [
|
||||
["declared", ["a"]],
|
||||
["a", ["a"]],
|
||||
@@ -104,6 +124,9 @@ const expectedDependencies = [
|
||||
["afterUninitialized", ["2"], "candidate"],
|
||||
["initializedEarlier", ["1"]],
|
||||
["uninitializedLater", ["1"], "candidate"],
|
||||
["afterReady", ["1"]],
|
||||
["beforeOuterLet", ["0"]],
|
||||
["afterOuterLet", ["2"], "candidate"],
|
||||
["arrayAssigned", ["0"]],
|
||||
["elided", ["1"]],
|
||||
["projected", ["items", "0"]],
|
||||
@@ -141,6 +164,9 @@ const tracedBindings = [
|
||||
"afterUninitialized",
|
||||
"initializedEarlier",
|
||||
"uninitializedLater",
|
||||
"afterReady",
|
||||
"beforeOuterLet",
|
||||
"afterOuterLet",
|
||||
"arrayAssigned",
|
||||
"elided",
|
||||
"projected",
|
||||
@@ -227,16 +253,7 @@ cliTest(
|
||||
[selected] = after;
|
||||
`,
|
||||
);
|
||||
for (const [path, source] of [
|
||||
["iterator-close.js", iteratorCloseSource],
|
||||
["array-prototype-alias.js", arrayPrototypeAliasSource],
|
||||
["abrupt-object-pattern.js", abruptObjectPatternSource],
|
||||
["first-default.js", firstDefaultSource],
|
||||
["immutable-target.js", immutableTargetSource],
|
||||
["class-name-target.js", classNameTargetSource],
|
||||
["uninitialized-target.js", uninitializedTargetSource],
|
||||
["declarator-order.js", declaratorOrderSource],
|
||||
] as const)
|
||||
for (const [path, source] of additionalFixtures)
|
||||
await writeFile(join(root, path), source);
|
||||
const output = await cli.run({
|
||||
arguments: ["analyze-javascript-application", root, "--json"],
|
||||
|
||||
Reference in new issue
Block a user