mirror of
https://github.com/morluto/rea.git
synced 2026-11-06 14:56:32 +00:00
perf(javascript): reduce analysis and source-map work (#955)
* perf(javascript): reduce semantic traversal overhead * perf(source-maps): reuse validated regular map rows
This commit is contained in:
1 parent
dda8e6a728
commit
c7530f9a81
6 files changed
+59
-10
No files matched your search
@@ -51,3 +51,16 @@ it("preserves source-tree enter/exit order and detached ancestor snapshots", ()
|
||||
],
|
||||
]);
|
||||
});
|
||||
|
||||
it("skips sparse child slots without disturbing sibling visit order", () => {
|
||||
const parsed = parseJavaScriptSource("const values = [first, , second];");
|
||||
if (parsed === null)
|
||||
throw new TypeError("Expected a parsed JavaScript fixture");
|
||||
const identifiers: string[] = [];
|
||||
traverseJavaScriptAst(parsed.program, {
|
||||
enter: (node) => {
|
||||
if (t.isIdentifier(node)) identifiers.push(node.name);
|
||||
},
|
||||
});
|
||||
expect(identifiers).toEqual(["values", "first", "second"]);
|
||||
});
|
||||
Reference in new issue
Block a user