non-unicode-malformed.js (755B)
1 // Copyright 2017 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: > 6 Named groups in Unicode RegExps have some syntax errors and some 7 compatibility escape fallback behavior. 8 esid: prod-GroupSpecifier 9 features: [regexp-named-groups] 10 includes: [compareArray.js] 11 ---*/ 12 13 assert(/\k<a>/.test("k<a>")); 14 assert(/\k<4>/.test("k<4>")); 15 assert(/\k<a/.test("k<a")); 16 assert(/\k/.test("k")); 17 18 assert(/(?<a>\a)/.test("a")); 19 20 assert.compareArray(["k<a>"], "xxxk<a>xxx".match(/\k<a>/)); 21 assert.compareArray(["k<a"], "xxxk<a>xxx".match(/\k<a/)); 22 23 assert(/\k<a>(<a>x)/.test("k<a><a>x")); 24 assert(/\k<a>\1/.test("k<a>\x01")); 25 assert(/\1(b)\k<a>/.test("bk<a>")); 26 27 reportCompare(0, 0);