Changeset 255975 in webkit
- Timestamp:
- Feb 6, 2020 1:36:48 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r255897 r255975 1 2020-02-06 Sukolsak Sakshuwong <sukolsak@gmail.com> and Alexey Shvayka <shvaikalesh@gmail.com> 2 3 JavaScript string corruption using RegExp with unicode character 4 https://bugs.webkit.org/show_bug.cgi?id=187947 5 6 Reviewed by Yusuke Suzuki. 7 8 This change adds regression test for string corruption that occured after 9 non-BMP character was removed by String.prototype.replace. 10 The issue was fixed in https://trac.webkit.org/changeset/253648/webkit. 11 12 Also, this patch brings back: 13 1. An out-of-order character class range test. 14 2. Dangling and combined surrogates tests (as webkit.org/b/154863 is now resolved). 15 16 * stress/regress-187947.js: Added. 17 1 18 2020-02-05 Justin Michaud <justin_michaud@apple.com> 2 19 -
trunk/LayoutTests/ChangeLog
r255973 r255975 1 2020-02-06 Sukolsak Sakshuwong <sukolsak@gmail.com> and Alexey Shvayka <shvaikalesh@gmail.com> 2 3 JavaScript string corruption using RegExp with unicode character 4 https://bugs.webkit.org/show_bug.cgi?id=187947 5 6 Reviewed by Yusuke Suzuki. 7 8 Besides adding a regression test, this patch brings back: 9 1. An out-of-order character class range test. 10 2. Dangling and combined surrogates tests (as webkit.org/b/154863 is now resolved). 11 12 * js/dom/regexp-range-out-of-order-expected.txt: 13 * js/dom/script-tests/regexp-range-out-of-order.js: 14 * js/regexp-unicode-expected.txt: 15 * js/script-tests/regexp-extended-characters-match.js: 16 * js/script-tests/regexp-unicode.js: 17 1 18 2020-02-06 Commit Queue <commit-queue@webkit.org> 2 19 -
trunk/LayoutTests/js/dom/regexp-range-out-of-order-expected.txt
r156066 r255975 5 5 6 6 PASS /^[s{-.[]()]$/ threw exception SyntaxError: Invalid regular expression: range out of order in character class. 7 PASS new RegExp("[ā-Ā]") threw exception SyntaxError: Invalid regular expression: range out of order in character class. 7 8 PASS successfullyParsed is true 8 9 -
trunk/LayoutTests/js/dom/script-tests/regexp-range-out-of-order.js
r156066 r255975 5 5 ); 6 6 7 shouldThrow('/^[\s{-.\[\]\(\)]$/'); 7 shouldThrow('/^[\s{-.\[\]\(\)]$/', '"SyntaxError: Invalid regular expression: range out of order in character class"'); 8 shouldThrow('new RegExp("[\u0101-\u0100]")', '"SyntaxError: Invalid regular expression: range out of order in character class"'); -
trunk/LayoutTests/js/regexp-unicode-expected.txt
r255544 r255975 87 87 PASS re2.test("") is false 88 88 PASS re2.test("𒍅") is true 89 PASS /[𐰁�#�]/u.exec("𐰁").toString() is "𐰁" 90 PASS /[�𐰁�]/u.exec("𐰁").toString() is "𐰁" 91 PASS /[�#�𐰁]/u.exec("𐰁").toString() is "𐰁" 92 PASS /[�𐰁�]/u.exec("𐰁").toString() is "𐰁" 93 PASS /[𐰁�#�]{2}/u.exec("𐰁") is null 94 PASS /[�𐰁�]{2}/u.exec("𐰁") is null 95 PASS /[�#�𐰁]{2}/u.exec("𐰁") is null 96 PASS /[�𐰁�]{2}/u.exec("𐰁") is null 97 PASS /�|�|𐰁/u.exec("𐰁").toString() is "𐰁" 98 PASS /�|𐰁|�/u.exec("𐰁").toString() is "𐰁" 99 PASS /�|�|𐰁/u.exec("�").toString() is "�" 100 PASS /�|𐰁|�/u.exec("�").toString() is "�" 101 PASS /�𐰁/u.exec("𐰁") is null 102 PASS /�𐰁/u.exec("�") is null 103 PASS "�𐰁".match(/�𐰁/u)[0].length is 3 89 104 PASS /𝌆{2}/u.test("𝌆𝌆") is true 90 105 PASS /𝌆{2}/u.test("𝌆𝌆") is true -
trunk/LayoutTests/js/script-tests/regexp-extended-characters-match.js
r98407 r255975 2 2 "This test checks regular expressions using extended (> 255) characters and character classes." 3 3 ); 4 5 // shouldThrow('var r = new RegExp("[\u0101-\u0100]"); r.exec("a")', 'null');6 4 7 5 shouldBe('(new RegExp("[\u0100-\u0101]")).exec("a")', 'null'); -
trunk/LayoutTests/js/script-tests/regexp-unicode.js
r255544 r255975 105 105 106 106 // Make sure we properly handle dangling surrogates and combined surrogates 107 // FIXME: These tests are disabled until https://bugs.webkit.org/show_bug.cgi?id=154863 is fixed 108 // shouldBe('/[\u{10c01}\uD803#\uDC01]/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 109 // shouldBe('/[\uD803\u{10c01}\uDC01]/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 110 // shouldBe('/[\uD803#\uDC01\u{10c01}]/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 111 // shouldBe('/[\uD803\uD803\uDC01\uDC01]/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 112 // shouldBeNull('/[\u{10c01}\uD803#\uDC01]{2}/u.exec("\u{10c01}")'); 113 // shouldBeNull('/[\uD803\u{10c01}\uDC01]{2}/u.exec("\u{10c01}")'); 114 // shouldBeNull('/[\uD803#\uDC01\u{10c01}]{2}/u.exec("\u{10c01}")'); 115 // shouldBeNull('/[\uD803\uD803\uDC01\uDC01]{2}/u.exec("\u{10c01}")'); 116 // shouldBe('/\uD803|\uDC01|\u{10c01}/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 117 // shouldBe('/\uD803|\uD803\uDC01|\uDC01/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 118 // shouldBe('/\uD803|\uDC01|\u{10c01}/u.exec("\u{D803}").toString()', '"\u{D803}"'); 119 // shouldBe('/\uD803|\uD803\uDC01|\uDC01/u.exec("\u{DC01}").toString()', '"\u{DC01}"'); 120 // shouldBeNull('/\uD803\u{10c01}/u.exec("\u{10c01}")'); 121 // shouldBeNull('/\uD803\u{10c01}/u.exec("\uD803")'); 122 // shouldBe('"\uD803\u{10c01}".match(/\uD803\u{10c01}/u)[0].length', '3'); 107 shouldBe('/[\u{10c01}\uD803#\uDC01]/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 108 shouldBe('/[\uD803\u{10c01}\uDC01]/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 109 shouldBe('/[\uD803#\uDC01\u{10c01}]/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 110 shouldBe('/[\uD803\uD803\uDC01\uDC01]/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 111 shouldBeNull('/[\u{10c01}\uD803#\uDC01]{2}/u.exec("\u{10c01}")'); 112 shouldBeNull('/[\uD803\u{10c01}\uDC01]{2}/u.exec("\u{10c01}")'); 113 shouldBeNull('/[\uD803#\uDC01\u{10c01}]{2}/u.exec("\u{10c01}")'); 114 shouldBeNull('/[\uD803\uD803\uDC01\uDC01]{2}/u.exec("\u{10c01}")'); 115 shouldBe('/\uD803|\uDC01|\u{10c01}/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 116 shouldBe('/\uD803|\uD803\uDC01|\uDC01/u.exec("\u{10c01}").toString()', '"\u{10c01}"'); 117 shouldBe('/\uD803|\uDC01|\u{10c01}/u.exec("\u{D803}").toString()', '"\u{D803}"'); 118 shouldBe('/\uD803|\uD803\uDC01|\uDC01/u.exec("\u{DC01}").toString()', '"\u{DC01}"'); 119 shouldBeNull('/\uD803\u{10c01}/u.exec("\u{10c01}")'); 120 shouldBeNull('/\uD803\u{10c01}/u.exec("\uD803")'); 121 shouldBe('"\uD803\u{10c01}".match(/\uD803\u{10c01}/u)[0].length', '3'); 123 122 124 123 // Check quantified matches
Note: See TracChangeset
for help on using the changeset viewer.