fix(javascript): preserve exact static property keys (#3480)

* fix(javascript): preserve Electron options with static empty keys

* fix(javascript): retain exact computed member keys
This commit is contained in:
ShuaixinHuang
2026-10-15 14:59:06 +08:00
committed by GitHub
parent 3e88e21705
commit ce89706145
7 changed files with 323 additions and 8 deletions
@@ -23,6 +23,7 @@ const absoluteParts = [
const anchoredExpressions = [
['path.resolve(__dirname, "preload.cjs")', "preload.cjs"],
['path[`resolve`](__dirname, "preload.js")', "preload.js"],
['path.posix.resolve("ignored", __dirname, "preload.js")', "preload.js"],
['path.resolve("/ignored", __dirname, "preload.js")', "preload.js"],
[
@@ -45,6 +46,8 @@ const anchoredExpressions = [
] as const;
const unknownExpressions = [
'path[method](__dirname, "preload.js")',
'path[`join${suffix}`](__dirname, "preload.js")',
"path.resolve()",
"path.posix.resolve()",
'path.resolve("sub", "../preload.js")',
@@ -106,6 +109,11 @@ describe("inert JavaScript path resolution", () => {
"preload.js",
"filesystem-expression",
],
[
'path[`join`](__dirname, "preload.js")',
"preload.js",
"filesystem-expression",
],
[
'path.join(__dirname, "/preload.js")',
"preload.js",