瀏覽代碼

Added RandomGenerator clearing after obfuscation

sanex3339 8 年之前
父節點
當前提交
4e5cf5ad0d
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      dist/index.js
  2. 1 1
      src/utils/RandomGeneratorUtils.ts

+ 1 - 1
dist/index.js

@@ -433,7 +433,7 @@ var RandomGeneratorUtils = function () {
         value: function getRandomGenerator() {
             var randomGenerator = RandomGeneratorUtils.randomGenerator;
             if (!randomGenerator) {
-                throw new Error("`randomGenerator` static property is undefined");
+                RandomGeneratorUtils.initializeRandomGenerator(0);
             }
             return RandomGeneratorUtils.randomGenerator;
         }

+ 1 - 1
src/utils/RandomGeneratorUtils.ts

@@ -58,7 +58,7 @@ export class RandomGeneratorUtils {
         const randomGenerator: Chance.Chance = RandomGeneratorUtils.randomGenerator;
 
         if (!randomGenerator) {
-            throw new Error(`\`randomGenerator\` static property is undefined`);
+            RandomGeneratorUtils.initializeRandomGenerator(0);
         }
 
         return RandomGeneratorUtils.randomGenerator;