]> git.kaiwu.me - njs.git/commitdiff
Removing possible ignored regexp compilation error.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 30 May 2019 11:17:59 +0000 (14:17 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Thu, 30 May 2019 11:17:59 +0000 (14:17 +0300)
njs/njs_regexp.c
njs/test/njs_unit_test.c

index ffd885185c3e7fa765a27545e5d4005bf8dbc5d7..4ffd0ba8bccf70f0d7f76df8b8fcb1cb1199e36e 100644 (file)
@@ -557,6 +557,8 @@ njs_regexp_pattern_create(njs_vm_t *vm, u_char *start, size_t length,
         } while (n != pattern->ngroups);
     }
 
+    njs_value_undefined_set(&vm->retval);
+
     return pattern;
 
 fail:
index f68dcc1edcf7661dcd2a5b9c63c8769e07f1e33f..bbd8ce6baafad7643a44f14efeec97c269d24b30 100644 (file)
@@ -7240,6 +7240,9 @@ static njs_unit_test_t  njs_test[] =
     { nxt_string("/^[A-Za-z0-9+/]{4}$/.test('////')"),
       nxt_string("true") },
 
+    { nxt_string("/[\\uFDE0-\\uFFFD]/g; export default 1"),
+      nxt_string("SyntaxError: Illegal export statement in 1") },
+
     { nxt_string("'[]!\"#$%&\\'()*+,.\\/:;<=>?@\\^_`{|}-'.split('')"
                  ".every(ch=>/[\\]\\[!\"#$%&'()*+,.\\/:;<=>?@\\^_`{|}-]/.test(ch))"),
       nxt_string("true") },