You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2019/12/18 17:59:59 UTC

[couchdb-escodegen] reference refs/pull/308/head created (now 19dfe46)

This is an automated email from the ASF dual-hosted git repository.

davisp pushed a change to reference refs/pull/308/head
in repository https://gitbox.apache.org/repos/asf/couchdb-escodegen.git.


      at 19dfe46  fix: create regexp literal if possible

This reference includes the following new commits:

     new 19dfe46  fix: create regexp literal if possible

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb-escodegen] 01/01: fix: create regexp literal if possible

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to reference refs/pull/308/head
in repository https://gitbox.apache.org/repos/asf/couchdb-escodegen.git

commit 19dfe4658232f2a6f919394d6c36526ff35cdb8c
Author: Markus Wolf <ma...@markus-wolf.de>
AuthorDate: Thu Aug 11 08:45:38 2016 +0200

    fix: create regexp literal if possible
    
    to get around not serializable regexp the raw literal value should be used instead of the value
    
    FIX ISSUE #294
---
 escodegen.js | 3 +++
 1 file changed, 3 insertions(+)

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);
         },