make --comments keep @cc_on too
This commit is contained in:
@@ -125,8 +125,7 @@ if (ARGS.comments) {
|
|||||||
var type = comment.type;
|
var type = comment.type;
|
||||||
if (type == "comment2") {
|
if (type == "comment2") {
|
||||||
// multiline comment
|
// multiline comment
|
||||||
return text.indexOf("@preserve") >= 0
|
return /@preserve|@license|@cc_on/i.test(test);
|
||||||
|| text.indexOf("@license") >= 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
lib/parse.js
10
lib/parse.js
@@ -473,14 +473,6 @@ function tokenizer($TEXT, filename) {
|
|||||||
S.pos = i + 2;
|
S.pos = i + 2;
|
||||||
S.line += text.split("\n").length - 1;
|
S.line += text.split("\n").length - 1;
|
||||||
S.newline_before = S.newline_before || text.indexOf("\n") >= 0;
|
S.newline_before = S.newline_before || text.indexOf("\n") >= 0;
|
||||||
|
|
||||||
// https://github.com/mishoo/UglifyJS/issues/#issue/100
|
|
||||||
if (/^@cc_on/i.test(text)) {
|
|
||||||
warn("WARNING: at line " + S.line);
|
|
||||||
warn("*** Found \"conditional comment\": " + text);
|
|
||||||
warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return token("comment2", text, true);
|
return token("comment2", text, true);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -1493,5 +1485,3 @@ function parse($TEXT, options) {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var warn = function() {};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user