Skip to content

Commit 0676bec

Browse files
fix(javascript): keep the JSDoc of globalMayBeRebound on its function in the minifier
Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD
1 parent 32bd3d6 commit 0676bec

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎lib/javascript/syntax-printer.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18417,6 +18417,15 @@ const installImprove = (modules) => {
1841718417
* @param {CompressorShape} compressor the compressor
1841818418
* @returns {boolean} true when one could
1841918419
*/
18420+
const globalMayBeRebound = (compressor) => {
18421+
let parent;
18422+
for (let i = 0; (parent = compressor.parent(i)); i++) {
18423+
if (A.isWithNode(parent)) return true;
18424+
if (A.isScopeNode(parent) && A.usesEval(parent)) return true;
18425+
}
18426+
return false;
18427+
};
18428+
1842018429
/**
1842118430
* Whether a reference reads a built-in global the program never assigns,
1842218431
* where no `with` or direct `eval` can rebind it.
@@ -18430,15 +18439,6 @@ const installImprove = (modules) => {
1843018439
node.definition.assignments === 0 &&
1843118440
!globalMayBeRebound(compressor);
1843218441

18433-
const globalMayBeRebound = (compressor) => {
18434-
let parent;
18435-
for (let i = 0; (parent = compressor.parent(i)); i++) {
18436-
if (A.isWithNode(parent)) return true;
18437-
if (A.isScopeNode(parent) && A.usesEval(parent)) return true;
18438-
}
18439-
return false;
18440-
};
18441-
1844218442
/**
1844318443
* The value an argument stands for: a literal, or an array literal of such
1844418444
* values without holes, or `NOT_CONSTANT`.

0 commit comments

Comments
 (0)