commit | 719de3033c4a9a0df27f698c47b48d2af7241835 | [log] [tgz] |
---|---|---|
author | Markus Wolf <mail@markus-wolf.de> | Thu Sep 01 08:52:29 2016 +0200 |
committer | Michael Ficarra <github@michael.ficarra.me> | Wed Aug 31 23:52:29 2016 -0700 |
tree | 5db5ec68d9a9dbe105892c11386271b16a9f9c2f | |
parent | ba4faabb224b2d5e0080c8e4f964702b699c7d1f [diff] |
fix: create regexp literal if possible (#308) to get around not serializable regexp the raw literal value should be used instead of the value FIX ISSUE #294
diff --git a/escodegen.js b/escodegen.js index 6202819..42c05ae 100644 --- a/escodegen.js +++ b/escodegen.js
@@ -2331,6 +2331,9 @@ return expr.value ? 'true' : 'false'; } + if (expr.regex) { + return '/' + expr.regex.pattern + '/' + expr.regex.flags; + } return generateRegExp(expr.value); },