custom nodes: on -> once event emitter change

This commit is contained in:
sanex3339
2016-11-25 18:15:33 +03:00
parent 1346570151
commit c56f2e6d9f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1677,7 +1677,7 @@ var Obfuscator = function () {
NodeUtils_1.NodeUtils.parentize(astTree);
this.customNodesStorage.initialize(this.stackTraceAnalyzer.analyze(astTree.body));
this.customNodesStorage.getStorage().forEach(function (customNode) {
_this.obfuscationEventEmitter.on(customNode.getAppendEvent(), customNode.appendNode.bind(customNode));
_this.obfuscationEventEmitter.once(customNode.getAppendEvent(), customNode.appendNode.bind(customNode));
});
this.obfuscationEventEmitter.emit(ObfuscationEvents_1.ObfuscationEvents.BeforeObfuscation, astTree);
if (this.options.controlFlowFlattening) {
+1 -1
View File
@@ -77,7 +77,7 @@ export class Obfuscator implements IObfuscator {
this.customNodesStorage
.getStorage()
.forEach((customNode: ICustomNode) => {
this.obfuscationEventEmitter.on(customNode.getAppendEvent(), customNode.appendNode.bind(customNode));
this.obfuscationEventEmitter.once(customNode.getAppendEvent(), customNode.appendNode.bind(customNode));
});
this.obfuscationEventEmitter.emit(ObfuscationEvents.BeforeObfuscation, astTree);