have [@#]__PURE__ regex work with node 0.10.x

This commit is contained in:
kzc 2017-02-20 22:41:10 -05:00
parent d35b92cff6
commit 883ce8148b

View File

@ -1273,7 +1273,6 @@ merge(Compressor.prototype, {
def(AST_Constant, return_false);
def(AST_This, return_false);
var pure_regex = /[@#]__PURE__/g;
function has_pure_annotation(node) {
if (node.pure !== undefined) return node.pure;
var pure = false;
@ -1281,8 +1280,8 @@ merge(Compressor.prototype, {
if (node.start
&& (comments = node.start.comments_before)
&& comments.length
&& pure_regex.test((last_comment = comments[comments.length - 1]).value)) {
last_comment.value = last_comment.value.replace(pure_regex, ' ');
&& /[@#]__PURE__/.test((last_comment = comments[comments.length - 1]).value)) {
last_comment.value = last_comment.value.replace(/[@#]__PURE__/g, ' ');
pure = true;
}
return node.pure = pure;