aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkzc <zaxxon2011@gmail.com>2015-11-02 12:24:09 -0500
committerkzc <zaxxon2011@gmail.com>2015-11-02 12:24:09 -0500
commit94c4daaf9ea67875ab1b720d1d7bceef7c690552 (patch)
tree05a15046ebf0196ece423dd052a336b199da66fe /lib
parent37ee9de9021f1f34ed7d2f453f58348f2e74764f (diff)
downloadtracifyjs-94c4daaf9ea67875ab1b720d1d7bceef7c690552.tar.gz
tracifyjs-94c4daaf9ea67875ab1b720d1d7bceef7c690552.zip
Have mozilla AST RegExpLiteral parser use regex.pattern and regex.flags rather than non-standard `raw` property.
Diffstat (limited to 'lib')
-rw-r--r--lib/mozilla-ast.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/mozilla-ast.js b/lib/mozilla-ast.js
index 15be4581..7ce6e78d 100644
--- a/lib/mozilla-ast.js
+++ b/lib/mozilla-ast.js
@@ -146,7 +146,17 @@
case "boolean":
return new (val ? AST_True : AST_False)(args);
default:
- args.value = M.regex && M.raw ? M.raw : val;
+ 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;
+ }
+ } else {
+ // support legacy RegExp
+ args.value = M.regex && M.raw ? M.raw : val;
+ }
return new AST_RegExp(args);
}
},
@@ -334,7 +344,7 @@
};
});
- def_to_moz(AST_RegExp, function To_Moz_RegExp(M) {
+ def_to_moz(AST_RegExp, function To_Moz_RegExpLiteral(M) {
var value = M.value;
return {
type: "Literal",
nixLibexecDir'....This makes it easier to run the uninstalled daemon. * nix/local.mk (libstore_a_CPPFLAGS): Append "/guix" to NIX_LIBEXEC_DIR. * build-aux/pre-inst-env.in (NIX_LIBEXEC_DIR): Adjust comment. * nix/libstore/builtins.cc (builtinDownload): Remove SUBDIR and its use. * nix/libstore/local-store.cc (runAuthenticationProgram): Ditto. * nix/libstore/gc.cc (addAdditionalRoots): Remove "/guix" prefix. * nix/nix-daemon/guix-daemon.cc (main): Ditto. Ludovic Courtès 2018-12-16daemon: Use unbranded phrases in comments and messages....* nix/libstore/build.cc, nix/libstore/globals.cc, nix/libstore/gc.cc, nix/libstore/local-store.cc, nix/libstore/optimise-store.cc, nix/libstore/store-api.cc, nix/libutil/archive.cc, nix/nix-daemon/nix-daemon.cc: Replace "Nix store" by "store", and "Nix daemon" by "build daemon". Ludovic Courtès