mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
dropped node 0.12 support, now using yarn instead npm for scripts and travis-ci testing
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
|
||||
import * as fs from 'fs';
|
||||
|
||||
if (!(<any>global)._babelPolyfill) {
|
||||
require('babel-polyfill');
|
||||
}
|
||||
|
||||
(function () {
|
||||
const JavaScriptObfuscator: any = require("../../index");
|
||||
|
||||
|
||||
@@ -1,81 +1,76 @@
|
||||
'use strict';
|
||||
|
||||
if (!(<any>global)._babelPolyfill) {
|
||||
require('babel-polyfill');
|
||||
}
|
||||
|
||||
(function () {
|
||||
const JavaScriptObfuscator: any = require("../../index");
|
||||
|
||||
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(
|
||||
`
|
||||
var start = new Date();
|
||||
var log = console.log;
|
||||
console.log = function () {};
|
||||
|
||||
${String(`
|
||||
(function () {
|
||||
var result = 1,
|
||||
term1 = 0,
|
||||
term2 = 1,
|
||||
i = 1;
|
||||
while(i < 10)
|
||||
{
|
||||
var test = 10;
|
||||
result = term1 + term2;
|
||||
console.log(result);
|
||||
term1 = term2;
|
||||
term2 = result;
|
||||
i++;
|
||||
}
|
||||
|
||||
console.log(test);
|
||||
|
||||
var test = function (test) {
|
||||
let obfuscatedCode: string = JavaScriptObfuscator.obfuscate(`
|
||||
var start = new Date();
|
||||
var log = console.log;
|
||||
console.log = function () {};
|
||||
|
||||
${String(`
|
||||
(function () {
|
||||
var result = 1,
|
||||
term1 = 0,
|
||||
term2 = 1,
|
||||
i = 1;
|
||||
while(i < 10)
|
||||
{
|
||||
var test = 10;
|
||||
result = term1 + term2;
|
||||
console.log(result);
|
||||
term1 = term2;
|
||||
term2 = result;
|
||||
i++;
|
||||
}
|
||||
|
||||
console.log(test);
|
||||
|
||||
if (true) {
|
||||
var test = 5
|
||||
var test = function (test) {
|
||||
console.log(test);
|
||||
|
||||
if (true) {
|
||||
var test = 5
|
||||
}
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
console.log(test(1));
|
||||
|
||||
function test2 (abc) {
|
||||
function test1 () {
|
||||
console.log('inside', abc.item);
|
||||
console.log(test(1));
|
||||
|
||||
function test2 (abc) {
|
||||
function test1 () {
|
||||
console.log('inside', abc.item);
|
||||
}
|
||||
|
||||
console.log('тест', abc);
|
||||
|
||||
var abc = {};
|
||||
|
||||
return abc.item = 15, test1();
|
||||
};
|
||||
|
||||
var regexptest = /version\\/(\\d+)/i;
|
||||
console.log(regexptest);
|
||||
|
||||
test2(22);
|
||||
console.log(105.4);
|
||||
console.log(true, false);
|
||||
|
||||
var sA = 'shorthand1';
|
||||
var sB = 'shorthand2';
|
||||
|
||||
console.log({sA, sB});
|
||||
|
||||
try {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
console.log('тест', abc);
|
||||
|
||||
var abc = {};
|
||||
|
||||
return abc.item = 15, test1();
|
||||
};
|
||||
|
||||
var regexptest = /version\\/(\\d+)/i;
|
||||
console.log(regexptest);
|
||||
|
||||
test2(22);
|
||||
console.log(105.4);
|
||||
console.log(true, false);
|
||||
|
||||
var sA = 'shorthand1';
|
||||
var sB = 'shorthand2';
|
||||
|
||||
console.log({sA, sB});
|
||||
|
||||
try {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})();
|
||||
`).repeat(1000)}
|
||||
|
||||
console.log = log;
|
||||
console.log(new Date() - start);
|
||||
})();
|
||||
`).repeat(1000)}
|
||||
|
||||
console.log = log;
|
||||
console.log(new Date() - start);
|
||||
`,
|
||||
{
|
||||
disableConsoleOutput: false,
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
'use strict';
|
||||
import { NO_CUSTOM_NODES_PRESET } from '../../src/options/presets/NoCustomNodes';
|
||||
|
||||
if (!(<any>global)._babelPolyfill) {
|
||||
require('babel-polyfill');
|
||||
}
|
||||
|
||||
(function () {
|
||||
const JavaScriptObfuscator: any = require("../../index");
|
||||
|
||||
|
||||
-4
@@ -86,8 +86,4 @@ describe('DomainLockNodeTemplate (): string', () => {
|
||||
singleNodeCallControllerFunctionName
|
||||
}, singleNodeCallControllerFunctionName, currentDomain));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
delete (<any>global).promisePolyfillActivationFlag;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { BabelPolyfill } from './polyfills/BabelPolyfill';
|
||||
import 'reflect-metadata';
|
||||
|
||||
require('source-map-support').install();
|
||||
BabelPolyfill.append();
|
||||
|
||||
/**
|
||||
* Unit tests
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
export class BabelPolyfill {
|
||||
public static append (): void {
|
||||
if (!(<any>global)._babelPolyfill) {
|
||||
require('babel-polyfill');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user