🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

uglify-js

Package Overview
Dependencies
Maintainers
3
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uglify-js - npm Package Compare versions

Comparing version

to
3.11.0

3

lib/ast.js

@@ -634,2 +634,5 @@ /***********************************************************************

must_be_expression(this, "expression");
this.body.forEach(function(node) {
if (!(node instanceof AST_SwitchBranch)) throw new Error("body must be AST_SwitchBranch[]");
});
},

@@ -636,0 +639,0 @@ }, AST_Block);

15

lib/parse.js

@@ -47,7 +47,10 @@ /***********************************************************************

var KEYWORDS = 'break case catch const continue debugger default delete do else finally for function if in instanceof new return switch throw try typeof var void while with';
var KEYWORDS_ATOM = 'false null true';
var RESERVED_WORDS = 'abstract boolean byte char class double enum export extends final float goto implements import int interface let long native package private protected public short static super synchronized this throws transient volatile yield'
+ " " + KEYWORDS_ATOM + " " + KEYWORDS;
var KEYWORDS_BEFORE_EXPRESSION = 'return new delete throw else case';
var KEYWORDS = "break case catch const continue debugger default delete do else finally for function if in instanceof new return switch throw try typeof var void while with";
var KEYWORDS_ATOM = "false null true";
var RESERVED_WORDS = [
"abstract boolean byte char class double enum export extends final float goto implements import int interface let long native package private protected public short static super synchronized this throws transient volatile yield",
KEYWORDS_ATOM,
KEYWORDS,
].join(" ");
var KEYWORDS_BEFORE_EXPRESSION = "return new delete throw else case";

@@ -442,3 +445,3 @@ KEYWORDS = makePredicate(KEYWORDS);

var i = find("*/", true);
var text = S.text.substring(S.pos, i).replace(/\r\n|\r|\u2028|\u2029/g, '\n');
var text = S.text.substring(S.pos, i).replace(/\r\n|\r|\u2028|\u2029/g, "\n");
// update stream position

@@ -445,0 +448,0 @@ forward(text.length /* doesn't count \r\n as 2 char while S.pos - i does */ + 2);

@@ -282,2 +282,3 @@ /***********************************************************************

}));
return this;
});

@@ -338,3 +339,3 @@

if (!names) {
scope.names_in_use = names = Object.create(scope.mangled_names || null);
scope.names_in_use = names = Object.create(null);
scope.cname_holes = [];

@@ -373,3 +374,3 @@ var cache = options.cache && options.cache.props;

holes.splice(i, 1);
scope.names_in_use[name] = true;
in_use[name] = true;
return name;

@@ -383,3 +384,3 @@ }

}
scope.names_in_use[name] = true;
in_use[name] = true;
return name;

@@ -425,3 +426,3 @@ }

if (options.cache && options.cache.props) {
var mangled_names = this.mangled_names = Object.create(null);
var mangled_names = names_in_use(this, options);
options.cache.props.each(function(mangled_name) {

@@ -498,3 +499,3 @@ mangled_names[mangled_name] = true;

var cache = options.cache && options.cache.props;
var avoid = Object.create(null);
var avoid = Object.create(RESERVED_WORDS);
options.reserved.forEach(to_avoid);

@@ -536,3 +537,3 @@ this.globals.each(add_def);

name = base54(cname++);
} while (avoid[name] || RESERVED_WORDS[name]);
} while (avoid[name]);
return name;

@@ -539,0 +540,0 @@ }

@@ -6,3 +6,3 @@ {

"license": "BSD-2-Clause",
"version": "3.10.4",
"version": "3.11.0",
"engines": {

@@ -9,0 +9,0 @@ "node": ">=0.8.0"

@@ -691,2 +691,4 @@ UglifyJS 3

- `merge_vars` (default: `true`) -- combine and reuse variables.
- `negate_iife` (default: `true`) -- negate "Immediately-Called Function Expressions"

@@ -693,0 +695,0 @@ where the return value is discarded, to avoid the parens that the

Sorry, the diff of this file is too big to display