[Pkg-javascript-commits] [uglifyjs] 57/190: simplify mozilla AST RegExpLiteral token parse and handle corner cases of regex.pattern better

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.

commit 7dbe961b2d49533d54dfe5263f94de27de043316
Author: kzc <zaxxon2011 at gmail.com>
Date:   Mon Nov 2 13:10:37 2015 -0500

    simplify mozilla AST RegExpLiteral token parse and handle corner cases of regex.pattern better
---
 lib/mozilla-ast.js | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/mozilla-ast.js b/lib/mozilla-ast.js
index 7ce6e78..2bb469f 100644
--- a/lib/mozilla-ast.js
+++ b/lib/mozilla-ast.js
@@ -149,10 +149,7 @@
                 var rx = M.regex;
                 if (rx && rx.pattern) {
                     // RegExpLiteral as per ESTree AST spec
-                    args.value = "/" + rx.pattern + "/";
-                    if (rx.flags) {
-                        args.value += rx.flags;
-                    }
+                    args.value = new RegExp(rx.pattern, rx.flags).toString();
                 } else {
                     // support legacy RegExp
                     args.value = M.regex && M.raw ? M.raw : val;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list