From 883ce8148b4398dad05734c14d690de0104ed9d1 Mon Sep 17 00:00:00 2001 From: kzc Date: Mon, 20 Feb 2017 22:41:10 -0500 Subject: [PATCH] have [@#]__PURE__ regex work with node 0.10.x --- lib/compress.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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;