fix(javascript): preserve lexical open and exact template semantics

This commit is contained in:
morluto committed 2026-10-09 01:55:12 +08:00
1 parent fe297e56e8
commit d6cc9ca3a6
8 files changed
+106 -20

No files matched your search

@@ -44,4 +44,24 @@ describe("Electron option evidence", () => {
service_name: null,
});
});
it("keeps recovered templates with invalid escapes dynamic", () => {
const source = [
"new BrowserWindow({ webPreferences: { sandbox: `",
String.raw`\unicode`,
"` } });",
].join("");
const analysis = analyzeJavaScriptStaticSource(source);
expect(analysis.parse_status).toBe("partial");
expect(analysis.parse_error_count).toBe(1);
expect(
analysis.electron.browser_windows[0]?.web_preferences,
).toContainEqual(
expect.objectContaining({
name: "sandbox",
value: expect.objectContaining({ status: "dynamic", value: null }),
}),
);
});
});