| OLD | NEW |
| (Empty) |
| 1 Test for behavior of non-capturing groups, as described in a blog post by Steven
Levithan and bug 14931. | |
| 2 | |
| 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
| 4 | |
| 5 | |
| 6 PASS /(x)?\1y/.test("y") is true | |
| 7 PASS /(x)?\1y/.exec("y") is ["y", undefined] | |
| 8 PASS /(x)?y/.exec("y") is ["y", undefined] | |
| 9 PASS "y".match(/(x)?\1y/) is ["y", undefined] | |
| 10 PASS "y".match(/(x)?y/) is ["y", undefined] | |
| 11 PASS "y".match(/(x)?\1y/g) is ["y"] | |
| 12 PASS "y".split(/(x)?\1y/) is ["", undefined, ""] | |
| 13 PASS "y".split(/(x)?y/) is ["", undefined, ""] | |
| 14 PASS "y".search(/(x)?\1y/) is 0 | |
| 15 PASS "y".replace(/(x)?\1y/, "z") is "z" | |
| 16 PASS "y".replace(/(x)?y/, "$1") is "" | |
| 17 PASS "y".replace(/(x)?\1y/, function($0, $1){ return String($1); }) is "undefine
d" | |
| 18 PASS "y".replace(/(x)?y/, function($0, $1){ return String($1); }) is "undefined" | |
| 19 PASS "y".replace(/(x)?y/, function($0, $1){ return $1; }) is "undefined" | |
| 20 PASS successfullyParsed is true | |
| 21 | |
| 22 TEST COMPLETE | |
| 23 | |
| OLD | NEW |