fix(javascript): respect hoisted fresh function declarations
Function declarations provide fresh targets before their textual position. Retain initialization-order checks for variable and class values, including aliases. Cover the reviewed regression with source controls and the public CLI/MCP fixture.
This commit is contained in:
@@ -50,6 +50,8 @@ cliTest.for(["CLI", "stdio MCP"] as const)(
|
||||
Object.defineProperty(localClass,"x",{value:1});
|
||||
const localRegExp = /local/;
|
||||
Object.defineProperty(localRegExp,"x",{value:1});
|
||||
Object.defineProperty(hoistedFunction,"x",{value:1});
|
||||
function hoistedFunction() {}
|
||||
const captured = Object.defineProperty;
|
||||
Object.defineProperty = custom;
|
||||
${ROLLDOWN_MODULE_INTEROP.replace("__defProp = Object.defineProperty", "__defProp = captured")}
|
||||
|
||||
Reference in New Issue
Block a user