From c56f2e6d9f09b163578f1d23e0be503bce90b2fe Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Fri, 25 Nov 2016 18:15:33 +0300 Subject: [PATCH] custom nodes: on -> once event emitter change --- dist/index.js | 2 +- src/Obfuscator.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index ede7c103..73ee0a6a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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) { diff --git a/src/Obfuscator.ts b/src/Obfuscator.ts index e7d30afc..b514270c 100644 --- a/src/Obfuscator.ts +++ b/src/Obfuscator.ts @@ -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);