Comparing version 0.5.11 to 0.5.12
@@ -1,2 +0,2 @@ | ||
$("body").append("Added from site JS"); | ||
$("body").append("Added from site JS") | ||
@@ -1,3 +0,2 @@ | ||
var jsp = require("uglify-js").parser; | ||
var pro = require("uglify-js").uglify; | ||
var uglifyJS = require("uglify-js"); | ||
@@ -14,7 +13,5 @@ module.exports = { | ||
try { | ||
var ast = jsp.parse(input); // parse code and get the initial AST | ||
ast = pro.ast_mangle(ast); // get a new AST with mangled names | ||
ast = pro.ast_squeeze(ast); // get an AST with compression optimizations | ||
output = pro.gen_code(ast); // compressed code here | ||
output = output.replace(/;*$/, ";"); //add a semi-colon to the end | ||
output = uglifyJS.minify(input, { | ||
fromString: true | ||
}).code; | ||
} catch(error) { | ||
@@ -21,0 +18,0 @@ err = error; |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "0.5.11", | ||
"version": "0.5.12", | ||
"homepage": "https://github.com/laktek/punch", | ||
@@ -41,3 +41,3 @@ "author": "Lakshan Perera <lakshan@web2media.net> (http://laktek.com)", | ||
"mustache": ">0.7.0 || >=0.5.2 <0.7.0", | ||
"uglify-js": ">= 1.3.3", | ||
"uglify-js": ">= 2.2.3", | ||
"underscore": ">= 1.4.2" | ||
@@ -44,0 +44,0 @@ }, |
@@ -1,3 +0,2 @@ | ||
var jsp = require("uglify-js").parser; | ||
var pro = require("uglify-js").uglify; | ||
var uglifyJS = require("uglify-js"); | ||
var uglify_minifier = require("../../lib/minifiers/uglify"); | ||
@@ -7,19 +6,8 @@ | ||
it("calls the callback with the result", function(){ | ||
spyOn(jsp, "parse").andCallFake(function(input){ | ||
return "initial ast"; | ||
}); | ||
it("call the callback with the result", function(){ | ||
spyOn(pro, "ast_mangle").andCallFake(function(input){ | ||
return "initial ast"; | ||
spyOn(uglifyJS, "minify").andCallFake(function(input){ | ||
return { code: "{ function(){} };", map: null }; | ||
}); | ||
spyOn(pro, "ast_squeeze").andCallFake(function(input){ | ||
return "initial ast"; | ||
}); | ||
spyOn(pro, "gen_code").andCallFake(function(input){ | ||
return "{ function(){} };"; | ||
}); | ||
var spyCallback = jasmine.createSpy(); | ||
@@ -31,4 +19,4 @@ uglify_minifier.minify("test", spyCallback); | ||
it("calls the callback with the error", function(){ | ||
spyOn(jsp, "parse").andCallFake(function(input){ | ||
it("call the callback with the error", function(){ | ||
spyOn(uglifyJS, "minify").andCallFake(function(input){ | ||
throw "error"; | ||
@@ -35,0 +23,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1009451
161
8185
Updateduglify-js@>= 2.2.3