moved optimize-js to separate branch temporary

This commit is contained in:
sanex3339
2016-09-23 18:01:39 +03:00
parent c4e560c5a6
commit 7d27fb1583
9 changed files with 0 additions and 27 deletions
-5
View File
@@ -188,11 +188,6 @@ This option can slightly slow down your code speed.
All literals in Unicode array become encoded in Base64.
To decode strings, a special function will be inserted on the page under `unicodeArray` node.
### `optimize`
Type: `boolean` Default: `false`
Enables optimizations for obfuscated code with help of [optimize-js](https://github.com/nolanlawson/optimize-js)
### `reservedNames`
Type: `string[]` Default: `[]`
-1
View File
@@ -29,7 +29,6 @@
"estraverse": "^4.2.0",
"format-unicorn": "^1.1.0",
"mkdirp": "^0.5.1",
"optimize-js": "^1.0.1",
"source-map-support": "^0.4.2"
},
"devDependencies": {
-10
View File
@@ -7,15 +7,11 @@ import { IGeneratorOutput } from "./interfaces/IGeneratorOutput";
import { IObfuscationResult } from "./interfaces/IObfuscationResult";
import { IOptions } from './interfaces/IOptions';
import { SourceMapMode } from "./enums/SourceMapMode";
import { ObfuscationResult } from "./ObfuscationResult";
import { Obfuscator } from "./Obfuscator";
import { Options } from "./options/Options";
import { SourceMapCorrector } from "./SourceMapCorrector";
const optimizeJs = require('optimize-js');
export class JavaScriptObfuscatorInternal {
/**
* @type {GenerateOptions}
@@ -71,12 +67,6 @@ export class JavaScriptObfuscatorInternal {
const generatorOutput: IGeneratorOutput = escodegen.generate(astTree, escodegenParams);
if (options.optimize) {
generatorOutput.code = optimizeJs(generatorOutput.code, {
sourceMap: options.sourceMap && options.sourceMapMode === SourceMapMode.Inline
});
}
generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : '';
return generatorOutput;
-1
View File
@@ -127,7 +127,6 @@ export class JavaScriptObfuscatorCLI {
.option('--debugProtectionInterval <boolean>', 'Disable browser Debug panel even after page was loaded (can cause DevTools enabled browser freeze)', JavaScriptObfuscatorCLI.parseBoolean)
.option('--disableConsoleOutput <boolean>', 'Allow console.log, console.info, console.error and console.warn messages output into browser console', JavaScriptObfuscatorCLI.parseBoolean)
.option('--encodeUnicodeLiterals <boolean>', 'All literals in Unicode array become encoded in Base64 (this option can slightly slow down your code speed)', JavaScriptObfuscatorCLI.parseBoolean)
.option('--optimize <boolean>', 'Enables optimizations for obfuscated code with help of `optimize-js`', JavaScriptObfuscatorCLI.parseBoolean)
.option('--reservedNames <list>', 'Disable obfuscation of variable names, function names and names of function parameters that match the passed RegExp patterns (comma separated)', (val: string) => val.split(','))
.option('--rotateUnicodeArray <boolean>', 'Disable rotation of unicode array values during obfuscation', JavaScriptObfuscatorCLI.parseBoolean)
.option('--selfDefending <boolean>', 'Disables self-defending for obfuscated code', JavaScriptObfuscatorCLI.parseBoolean)
-1
View File
@@ -6,7 +6,6 @@ export interface IObfuscatorOptions {
debugProtectionInterval?: boolean;
disableConsoleOutput?: boolean;
encodeUnicodeLiterals?: boolean;
optimize?: boolean;
reservedNames?: string[];
rotateUnicodeArray?: boolean;
selfDefending?: boolean;
-1
View File
@@ -6,7 +6,6 @@ export interface IOptions {
readonly debugProtectionInterval: boolean;
readonly disableConsoleOutput: boolean;
readonly encodeUnicodeLiterals: boolean;
readonly optimize: boolean;
readonly reservedNames: string[];
readonly rotateUnicodeArray: boolean;
readonly selfDefending: boolean;
-6
View File
@@ -72,12 +72,6 @@ export class Options implements IOptions {
@IsBoolean()
public readonly encodeUnicodeLiterals: boolean;
/**
* @type {boolean}
*/
@IsBoolean()
public readonly optimize: boolean;
/**
* @type {string[]}
*/
-1
View File
@@ -9,7 +9,6 @@ export const DEFAULT_PRESET: IObfuscatorOptions = Object.freeze({
disableConsoleOutput: true,
domainLock: [],
encodeUnicodeLiterals: false,
optimize: false,
reservedNames: [],
rotateUnicodeArray: true,
selfDefending: true,
@@ -9,7 +9,6 @@ export const NO_CUSTOM_NODES_PRESET: IObfuscatorOptions = Object.freeze({
disableConsoleOutput: false,
domainLock: [],
encodeUnicodeLiterals: false,
optimize: false,
reservedNames: [],
rotateUnicodeArray: false,
selfDefending: false,