From: Dmitry Volyntsev Date: Thu, 30 May 2019 11:17:59 +0000 (+0300) Subject: Removing possible ignored regexp compilation error. X-Git-Tag: 0.3.3~23 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=f1c88f40b2fd41b71eabcc03980d50e581e04224;p=njs.git Removing possible ignored regexp compilation error. --- diff --git a/njs/njs_regexp.c b/njs/njs_regexp.c index ffd88518..4ffd0ba8 100644 --- a/njs/njs_regexp.c +++ b/njs/njs_regexp.c @@ -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: diff --git a/njs/test/njs_unit_test.c b/njs/test/njs_unit_test.c index f68dcc1e..bbd8ce6b 100644 --- a/njs/test/njs_unit_test.c +++ b/njs/test/njs_unit_test.c @@ -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") },