Utility classes with state now are non-static

This commit is contained in:
sanex3339
2017-06-27 00:49:19 +03:00
parent 894c90863a
commit d21c5afa8a
93 changed files with 1699 additions and 999 deletions
+11 -1
View File
@@ -59,7 +59,7 @@ export class JavaScriptObfuscatorInternal implements IJavaScriptObfuscator {
*/
public obfuscate (sourceCode: string): IObfuscationResult {
// parse AST tree
const astTree: ESTree.Program = esprima.parse(sourceCode, { loc: this.options.sourceMap });
const astTree: ESTree.Program = this.parseCode(sourceCode);
// obfuscate AST tree
const obfuscatedAstTree: ESTree.Program = this.obfuscator.obfuscateAstTree(astTree);
@@ -70,6 +70,16 @@ export class JavaScriptObfuscatorInternal implements IJavaScriptObfuscator {
return this.getObfuscationResult(generatorOutput);
}
/**
* @param sourceCode
* @return {ESTree.Program}
*/
private parseCode (sourceCode: string): ESTree.Program {
return esprima.parse(sourceCode, {
loc: this.options.sourceMap
});
}
/**
* @param sourceCode
* @param astTree