uglify-js
Advanced tools
Comparing version 2.4.10 to 2.4.11
@@ -1121,2 +1121,30 @@ /*********************************************************************** | ||
}); | ||
function regexp_safe_literal(code) { | ||
return [ | ||
0x5c , // \ | ||
0x2f , // / | ||
0x2e , // . | ||
0x2b , // + | ||
0x2a , // * | ||
0x3f , // ? | ||
0x28 , // ( | ||
0x29 , // ) | ||
0x5b , // [ | ||
0x5d , // ] | ||
0x7b , // { | ||
0x7d , // } | ||
0x24 , // $ | ||
0x5e , // ^ | ||
0x3a , // : | ||
0x7c , // | | ||
0x21 , // ! | ||
0x0a , // \n | ||
0x0d , // \r | ||
0xfeff , // Unicode BOM | ||
0x2028 , // unicode "line separator" | ||
0x2029 , // unicode "paragraph separator" | ||
].indexOf(code) < 0; | ||
}; | ||
DEFPRINT(AST_RegExp, function(self, output){ | ||
@@ -1130,3 +1158,3 @@ var str = self.getValue().toString(); | ||
var code = parseInt(s.substr(2), 16); | ||
return code == 0x2f || code == 10 || code == 13 || code == 0x2028 || code == 0x2029 ? s : String.fromCharCode(code); | ||
return regexp_safe_literal(code) ? String.fromCharCode(code) : s; | ||
}); | ||
@@ -1133,0 +1161,0 @@ }).join("\\\\"); |
@@ -1384,3 +1384,3 @@ /*********************************************************************** | ||
alternative : expression(false, no_in), | ||
end : peek() | ||
end : prev() | ||
}); | ||
@@ -1387,0 +1387,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"main": "tools/node.js", | ||
"version": "2.4.10", | ||
"version": "2.4.11", | ||
"engines": { "node" : ">=0.4.0" }, | ||
@@ -9,0 +9,0 @@ "maintainers": [{ |
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
368575
8918