[njs] Removing possible ignored regexp compilation error.

Dmitry Volyntsev xeioex at nginx.com
Thu May 30 11:18:08 UTC 2019


details:   https://hg.nginx.org/njs/rev/ab5d059e4ef8
branches:  
changeset: 993:ab5d059e4ef8
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu May 30 14:17:59 2019 +0300
description:
Removing possible ignored regexp compilation error.

diffstat:

 njs/njs_regexp.c         |  2 ++
 njs/test/njs_unit_test.c |  3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diffs (25 lines):

diff -r 82ca4be8b357 -r ab5d059e4ef8 njs/njs_regexp.c
--- a/njs/njs_regexp.c	Tue May 28 20:51:24 2019 +0300
+++ b/njs/njs_regexp.c	Thu May 30 14:17:59 2019 +0300
@@ -557,6 +557,8 @@ njs_regexp_pattern_create(njs_vm_t *vm, 
         } while (n != pattern->ngroups);
     }
 
+    njs_value_undefined_set(&vm->retval);
+
     return pattern;
 
 fail:
diff -r 82ca4be8b357 -r ab5d059e4ef8 njs/test/njs_unit_test.c
--- a/njs/test/njs_unit_test.c	Tue May 28 20:51:24 2019 +0300
+++ b/njs/test/njs_unit_test.c	Thu May 30 14:17:59 2019 +0300
@@ -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") },


More information about the nginx-devel mailing list