sanex3339 8 år sedan
förälder
incheckning
07e0fecb5b
2 ändrade filer med 6 tillägg och 11 borttagningar
  1. 1 0
      CHANGELOG.md
  2. 5 11
      src/Obfuscator.ts

+ 1 - 0
CHANGELOG.md

@@ -3,6 +3,7 @@ Change Log
 v0.9.0-beta.5
 ---
 * Increased performance
+* Fixed very rare `Cannot read property 'type' of undefined` error, when `RandomGeneratorUtils.getMathRandom()` returned incorrect value `1`.
 
 v0.9.0-beta.4
 ---

+ 5 - 11
src/Obfuscator.ts

@@ -131,20 +131,14 @@ export class Obfuscator implements IObfuscator {
 
         // first pass: control flow flattening
         if (this.options.controlFlowFlattening) {
-            astTree = this.transformAstTree(
-                astTree,
-                Obfuscator.controlFlowTransformersList
-            );
+            astTree = this.transformAstTree(astTree, Obfuscator.controlFlowTransformersList);
         }
 
         // second pass: nodes obfuscation
-        astTree = this.transformAstTree(
-            astTree,
-            [
-                ...Obfuscator.convertingTransformersList,
-                ...Obfuscator.obfuscatingTransformersList
-            ]
-        );
+        astTree = this.transformAstTree(astTree, [
+            ...Obfuscator.convertingTransformersList,
+            ...Obfuscator.obfuscatingTransformersList
+        ]);
 
         this.obfuscationEventEmitter.emit(ObfuscationEvents.AfterObfuscation, astTree, stackTraceData);