mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Using of internal storage to store lexical scope directives
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import * as ESTree from 'estree';
|
||||
import { TNodeWithLexicalScope } from '../types/node/TNodeWithLexicalScope';
|
||||
|
||||
export class NodeMetadata {
|
||||
/**
|
||||
@@ -47,16 +46,4 @@ export class NodeMetadata {
|
||||
public static isReplacedLiteral (literalNode: ESTree.Literal): boolean {
|
||||
return NodeMetadata.get<ESTree.LiteralNodeMetadata, 'replacedLiteral'>(literalNode, 'replacedLiteral') === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {TNodeWithLexicalScope} nodeWithLexicalScope
|
||||
* @returns {Directive | null | undefined}
|
||||
*/
|
||||
public static getDirectiveNode (nodeWithLexicalScope: TNodeWithLexicalScope): ESTree.Directive | null | undefined {
|
||||
return NodeMetadata.get<
|
||||
ESTree.ProgramNodeMetadata
|
||||
| ESTree.FunctionNodeMetadata,
|
||||
'directiveNode'
|
||||
>(nodeWithLexicalScope, 'directiveNode');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user