mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
New metadata for literals
This commit is contained in:
@@ -122,7 +122,7 @@ describe('NodeUtils', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('convertCodeToStructure (code: string): ESTree.Node[]', () => {
|
||||
describe('convertCodeToStructure (code: string): ESTree.Statement[]', () => {
|
||||
let structure: TStatement[],
|
||||
expectedStructure: TStatement[];
|
||||
|
||||
@@ -133,13 +133,11 @@ describe('NodeUtils', () => {
|
||||
|
||||
const identifierNode: ESTree.Identifier = NodeFactory.identifierNode('abc');
|
||||
const literalNode: ESTree.Literal = NodeFactory.literalNode('cde');
|
||||
const variableDeclaratorNode: ESTree.VariableDeclarator = NodeFactory.variableDeclaratorNode(identifierNode, literalNode);
|
||||
const variableDeclarationNode: ESTree.VariableDeclaration = NodeFactory.variableDeclarationNode([
|
||||
variableDeclaratorNode
|
||||
]);
|
||||
const programNode: ESTree.Program = NodeFactory.programNode([
|
||||
variableDeclarationNode
|
||||
]);
|
||||
const variableDeclaratorNode: ESTree.VariableDeclarator = NodeFactory
|
||||
.variableDeclaratorNode(identifierNode, literalNode);
|
||||
const variableDeclarationNode: ESTree.VariableDeclaration = NodeFactory
|
||||
.variableDeclarationNode([variableDeclaratorNode]);
|
||||
const programNode: ESTree.Program = NodeFactory.programNode([variableDeclarationNode]);
|
||||
|
||||
programNode.parentNode = programNode;
|
||||
variableDeclarationNode.parentNode = programNode;
|
||||
|
||||
Reference in New Issue
Block a user