🚀 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
1.0.7

lib/object-ast.js

7

lib/parse-js.js

@@ -192,3 +192,3 @@ /***********************************************************************

var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\v\u200b"));
var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b"));

@@ -408,3 +408,3 @@ var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{}(,.;:"));

case "b" : return "\b";
case "v" : return "\v";
case "v" : return "\u000b";
case "f" : return "\f";

@@ -414,2 +414,3 @@ case "0" : return "\0";

case "u" : return String.fromCharCode(hex_bytes(4));
case "\n": return "";
default : return ch;

@@ -1306,3 +1307,3 @@ }

function slice(a, start) {
return Array.prototype.slice.call(a, start == null ? 0 : start);
return Array.prototype.slice.call(a, start || 0);
};

@@ -1309,0 +1310,0 @@

@@ -5,2 +5,4 @@ var jsp = require("./parse-js"),

member = jsp.member,
curry = jsp.curry,
MAP = pro.MAP,
PRECEDENCE = jsp.PRECEDENCE,

@@ -10,4 +12,28 @@ OPERATORS = jsp.OPERATORS;

function ast_squeeze_more(ast) {
var w = pro.ast_walker(), walk = w.walk;
var w = pro.ast_walker(), walk = w.walk, scope;
function with_scope(s, cont) {
var save = scope, ret;
scope = s;
ret = cont();
scope = save;
return ret;
};
function _lambda(name, args, body) {
return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ];
};
return w.with_walkers({
"toplevel": function(body) {
return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ];
},
"function": _lambda,
"defun": _lambda,
"new": function(ctor, args) {
if (ctor[0] == "name" && ctor[1] == "Array" && !scope.has("Array")) {
if (args.length != 1) {
return [ "array", args ];
} else {
return walk([ "call", [ "name", "Array" ], args ]);
}
}
},
"call": function(expr, args) {

@@ -18,5 +44,8 @@ if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) {

}
if (expr[0] == "name" && expr[1] == "Array" && args.length != 1 && !scope.has("Array")) {
return [ "array", args ];
}
}
}, function() {
return walk(ast);
return walk(pro.ast_add_scope(ast));
});

@@ -23,0 +52,0 @@ };

@@ -10,3 +10,3 @@ {

"version" : "1.0.6",
"version" : "1.0.7",

@@ -13,0 +13,0 @@ "main" : "./uglify-js.js",

@@ -1,1 +0,1 @@

function mak(){for(;;);}function foo(){while(bar());}function bar(){return--x}var x=5
function bar(){return--x}function foo(){while(bar());}function mak(){for(;;);}var x=5

@@ -1,1 +0,1 @@

function y(a){return typeof a=="object"?a:null}function x(a){return typeof a=="object"?a:a===42?0:a*2}
function x(a){return typeof a=="object"?a:a===42?0:a*2}function y(a){return typeof a=="object"?a:null}

@@ -1,1 +0,1 @@

function f(){function b(){}a||b()}
function f(){function b(){}if(a)return;b()}

@@ -1,1 +0,1 @@

with({})
with({});

@@ -15,3 +15,3 @@ var fs = require('fs'),

ast = pro.ast_mangle(ast);
ast = pro.ast_squeeze(ast, {no_warnings: true, extra: true});
ast = pro.ast_squeeze(ast, { no_warnings: true });
ast = pro.ast_squeeze_more(ast);

@@ -18,0 +18,0 @@ return pro.gen_code(ast);

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet