diff --git a/lib/compress.js b/lib/compress.js index 5e4c483a..e9591590 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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;