mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Attempt to fix done() called multiple times error on node 10
This commit is contained in:
+4
-4
@@ -21,7 +21,7 @@ describe('SelfDefendingTemplate', function () {
|
||||
let obfuscatedCode: string,
|
||||
evaluationResult: number = 0;
|
||||
|
||||
beforeEach((done) => {
|
||||
before((done) => {
|
||||
const code: string = readFileAsString(__dirname + '/fixtures/input.js');
|
||||
|
||||
obfuscatedCode = JavaScriptObfuscator.obfuscate(
|
||||
@@ -60,7 +60,7 @@ describe('SelfDefendingTemplate', function () {
|
||||
let obfuscatedCode: string,
|
||||
evaluationResult: number = 0;
|
||||
|
||||
beforeEach((done) => {
|
||||
before((done) => {
|
||||
const code: string = readFileAsString(__dirname + '/fixtures/input.js');
|
||||
|
||||
obfuscatedCode = JavaScriptObfuscator.obfuscate(
|
||||
@@ -99,7 +99,7 @@ describe('SelfDefendingTemplate', function () {
|
||||
let obfuscatedCode: string,
|
||||
evaluationResult: number = 0;
|
||||
|
||||
beforeEach((done) => {
|
||||
before((done) => {
|
||||
const code: string = readFileAsString(__dirname + '/fixtures/input.js');
|
||||
|
||||
obfuscatedCode = JavaScriptObfuscator.obfuscate(
|
||||
@@ -139,7 +139,7 @@ describe('SelfDefendingTemplate', function () {
|
||||
let obfuscatedCode: string,
|
||||
evaluationResult: number = 0;
|
||||
|
||||
beforeEach((done) => {
|
||||
before((done) => {
|
||||
const code: string = readFileAsString(__dirname + '/fixtures/input.js');
|
||||
|
||||
obfuscatedCode = JavaScriptObfuscator.obfuscate(
|
||||
|
||||
@@ -17,8 +17,8 @@ export async function evaluateInWorker(
|
||||
): Promise<void> {
|
||||
const evaluationWorker = await spawn(new Worker('./workers/evaluation-worker'));
|
||||
|
||||
const timeout = setTimeout(() => {
|
||||
Thread.terminate(evaluationWorker);
|
||||
const timeout = setTimeout(async () => {
|
||||
await Thread.terminate(evaluationWorker);
|
||||
timeoutCallback();
|
||||
}, waitTimeout);
|
||||
|
||||
@@ -30,6 +30,6 @@ export async function evaluateInWorker(
|
||||
errorCallback(error, code);
|
||||
} finally {
|
||||
clearTimeout(timeout);
|
||||
Thread.terminate(evaluationWorker);
|
||||
await Thread.terminate(evaluationWorker);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user