mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
This commit is contained in:
@@ -89,10 +89,16 @@ export class NodeUtils {
|
||||
* @returns {T}
|
||||
*/
|
||||
public static parentizeAst <T extends ESTree.Node = ESTree.Node> (astTree: T): T {
|
||||
const parentNode: ESTree.Node | null = astTree.parentNode ?? null;
|
||||
|
||||
estraverse.replace(astTree, {
|
||||
enter: NodeUtils.parentizeNode
|
||||
});
|
||||
|
||||
if (parentNode) {
|
||||
astTree.parentNode = parentNode;
|
||||
}
|
||||
|
||||
return astTree;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user