From 4e5cf5ad0d36bfc7ea9fdea509458b77d9363482 Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Sat, 7 Jan 2017 18:19:33 +0300 Subject: [PATCH] Added RandomGenerator clearing after obfuscation --- dist/index.js | 2 +- src/utils/RandomGeneratorUtils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5611e38c..503c949c 100644 --- a/dist/index.js +++ b/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; } diff --git a/src/utils/RandomGeneratorUtils.ts b/src/utils/RandomGeneratorUtils.ts index 5ef0fe08..9985a3b0 100644 --- a/src/utils/RandomGeneratorUtils.ts +++ b/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;