| OLD | NEW |
| (Empty) |
| 1 description( | |
| 2 'Tests that regular expressions do not have extensions that diverge from the Jav
aScript specification. ' | |
| 3 + 'Because WebKit originally used a copy of PCRE, various non-JavaScript regular
expression features were historically present. ' | |
| 4 + 'Also tests various related edge cases.' | |
| 5 ); | |
| 6 | |
| 7 shouldBe('/\\x{41}/.exec("yA1")', 'null'); | |
| 8 shouldBe('/[\\x{41}]/.exec("yA1").toString()', '"1"'); | |
| 9 shouldBe('/\\x1g/.exec("x1g").toString()', '"x1g"'); | |
| 10 shouldBe('/[\\x1g]/.exec("x").toString()', '"x"'); | |
| 11 shouldBe('/[\\x1g]/.exec("1").toString()', '"1"'); | |
| 12 shouldBe('/\\2147483648/.exec(String.fromCharCode(140) + "7483648").toString()',
'String.fromCharCode(140) + "7483648"'); | |
| 13 shouldBe('/\\4294967296/.exec("\\"94967296").toString()', '"\\"94967296"'); | |
| 14 shouldBe('/\\8589934592/.exec("\\\\8589934592").toString()', '"\\\\8589934592"')
; | |
| 15 shouldBe('"\\nAbc\\n".replace(/(\\n)[^\\n]+$/, "$1")', '"\\nAbc\\n"'); | |
| 16 shouldBe('/x$/.exec("x\\n")', 'null'); | |
| 17 shouldThrow('/x++/'); | |
| 18 shouldBe('/[]]/.exec("]")', 'null'); | |
| 19 | |
| 20 debug(''); | |
| 21 debug('Octal escape sequences are in Annex B of the standard.'); | |
| 22 debug(''); | |
| 23 | |
| 24 shouldBe('/\\060/.exec("y01").toString()', '"0"'); | |
| 25 shouldBe('/[\\060]/.exec("y01").toString()', '"0"'); | |
| 26 shouldBe('/\\606/.exec("y06").toString()', '"06"'); | |
| 27 shouldBe('/[\\606]/.exec("y06").toString()', '"0"'); | |
| 28 shouldBe('/[\\606]/.exec("y6").toString()', '"6"'); | |
| 29 shouldBe('/\\101/.exec("yA1").toString()', '"A"'); | |
| 30 shouldBe('/[\\101]/.exec("yA1").toString()', '"A"'); | |
| 31 shouldBe('/\\1011/.exec("yA1").toString()', '"A1"'); | |
| 32 shouldBe('/[\\1011]/.exec("yA1").toString()', '"A"'); | |
| 33 shouldBe('/[\\1011]/.exec("y1").toString()', '"1"'); | |
| 34 shouldBe('/\\10q/.exec("y" + String.fromCharCode(8) + "q").toString()', 'String.
fromCharCode(8) + "q"'); | |
| 35 shouldBe('/[\\10q]/.exec("y" + String.fromCharCode(8) + "q").toString()', 'Strin
g.fromCharCode(8)'); | |
| 36 shouldBe('/\\1q/.exec("y" + String.fromCharCode(1) + "q").toString()', 'String.f
romCharCode(1) + "q"'); | |
| 37 shouldBe('/[\\1q]/.exec("y" + String.fromCharCode(1) + "q").toString()', 'String
.fromCharCode(1)'); | |
| 38 shouldBe('/[\\1q]/.exec("yq").toString()', '"q"'); | |
| 39 shouldBe('/\\8q/.exec("\\\\8q").toString()', '"\\\\8q"'); | |
| 40 shouldBe('/[\\8q]/.exec("y8q").toString()', '"8"'); | |
| 41 shouldBe('/[\\8q]/.exec("yq").toString()', '"q"'); | |
| 42 shouldBe('/(x)\\1q/.exec("xxq").toString()', '"xxq,x"'); | |
| 43 shouldBe('/(x)[\\1q]/.exec("xxq").toString()', '"xq,x"'); | |
| 44 shouldBe('/(x)[\\1q]/.exec("xx" + String.fromCharCode(1)).toString()', '"x" + St
ring.fromCharCode(1) + ",x"'); | |
| 45 | |
| 46 debug(''); | |
| OLD | NEW |