Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing for IE

  • Loading branch information...
commit 2d5048e3628e212fa4bb6da8b43af8438055a9b7 1 parent 6041e45
root authored
View
6 js/uglifyjs/bin/uglifyjs.js
@@ -182,7 +182,7 @@ function squeeze_it(code) {
}
result += show_copyright(initial_comments);
}
- try {
+ //try {
var ast = time_it("parse", function(){ return jsp.parse(code); });
if (options.mangle)
ast = time_it("mangle", function(){ return pro.ast_mangle(ast, options.mangle_toplevel); });
@@ -204,7 +204,7 @@ function squeeze_it(code) {
result = time_it("split", function(){ return pro.split_lines(result, options.max_line_length) });
}
return result;
- } catch(ex) {
+ //} catch(ex) {
//>> Start Uglifui
/*
sys.debug(ex.stack);
@@ -213,7 +213,7 @@ function squeeze_it(code) {
*/
//>> End Uglifui
- }
+ //}
};
function time_it(name, cont) {
View
7 js/uglifyjs/lib/parse-js.js
@@ -145,7 +145,7 @@ var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^"));
var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;
var RE_OCT_NUMBER = /^0[0-7]+$/;
-var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
+var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+\-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
var OPERATORS = array_to_hash([
"in",
@@ -274,7 +274,8 @@ JS_Parse_Error.prototype.toString = function() {
};
function js_error(message, line, col, pos) {
- throw new JS_Parse_Error(message, line, col, pos);
+ //throw new JS_Parse_Error(message, line, col, pos);
+ console.log(message, line, col, pos);
};
function is_token(token, type, val) {
@@ -411,7 +412,7 @@ function tokenizer($TEXT) {
case "b" : return "\b";
case "v" : return "\v";
case "f" : return "\f";
- case "0" : return "\0";
+ case "0" : return "\u0000";
case "x" : return String.fromCharCode(hex_bytes(2));
case "u" : return String.fromCharCode(hex_bytes(4));
default : return ch;
View
10 js/uglifyjs/lib/process.js
@@ -814,7 +814,7 @@ function ast_squeeze(ast, options) {
// 4. transform consecutive statements using the comma operator
// 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... }
function tighten(statements, block_type) {
- statements = statements.reduce(function(a, stat){
+ statements = _(statements).reduce(function(a, stat){
if (stat[0] == "block") {
if (stat[1]) {
a.push.apply(a, stat[1]);
@@ -826,7 +826,7 @@ function ast_squeeze(ast, options) {
}, []);
statements = (function(a, prev){
- statements.forEach(function(cur){
+ _(statements).forEach(function(cur){
if (prev && ((cur[0] == "var" && prev[0] == "var") ||
(cur[0] == "const" && prev[0] == "const"))) {
prev[1] = prev[1].concat(cur[1]);
@@ -839,7 +839,7 @@ function ast_squeeze(ast, options) {
})([]);
if (options.dead_code) statements = (function(a, has_quit){
- statements.forEach(function(st){
+ _(statements).forEach(function(st){
if (has_quit) {
if (member(st[0], [ "function", "defun" , "var", "const" ])) {
a.push(st);
@@ -857,7 +857,7 @@ function ast_squeeze(ast, options) {
})([]);
if (options.make_seqs) statements = (function(a, prev) {
- statements.forEach(function(cur){
+ _(statements).forEach(function(cur){
if (prev && prev[0] == "stat" && cur[0] == "stat") {
prev[1] = [ "seq", prev[1], cur[1] ];
} else {
@@ -1605,7 +1605,7 @@ function split_lines(code, max_line_length) {
};
return custom;
}());
- return splits.map(function(pos, i){
+ return _(splits).map(function(pos, i){
return code.substring(pos, splits[i + 1] || code.length);
}).join("\n");
};
Please sign in to comment.
Something went wrong with that request. Please try again.