/\0000040/.exec(" ") == null should return true, returns false
Actually I think Webkit does the right thing for strings, it's just regexes where leading zeros are erroneously allowed.
(In reply to Erik Corry from comment #1) > Actually I think Webkit does the right thing for strings, it's just regexes > where leading zeros are erroneously allowed. Alright, thank you for report. Some tests for octal escapes in strings: LayoutTests/js/basic-strict-mode.html LayoutTests/js/numeric-escapes-in-string-literals.html
Created attachment 395460 [details] Patch
Comment on attachment 395460 [details] Patch r=me pending EWS
Comment on attachment 395460 [details] Patch cq-'ing due to the failure under LayoutTests/js. (Feel free to migrate that test to JSTests/stress if you're feeling adventurous. :p)
Created attachment 395478 [details] Patch Adjust fast/regex/pcre-test-1.html test.
Comment on attachment 395478 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395478&action=review > LayoutTests/fast/regex/script-tests/pcre-test-1.js:998 > -var input0 = "abc\0def\0pqr\0xyz\0AB"; > -var results = ["abc\0def\0pqr\0xyz\0AB"]; > +var input0 = "abc\0def\0pqr\0xyz\0" + "0AB"; > +var results = ["abc\0def\0pqr\0xyz\0" + "0AB"]; Interesting—looks like it's that we (and SM) get confused about what this string even is?
(In reply to Ross Kirsling from comment #7) > Interesting—looks like it's that we (and SM) get confused about what this > string even is? I am using + to add unescaped "0" char without resorting to "\x30". I've checked V8 and SpiderMonkey, they both limit octal escapes in strings to 3 chars, fail PCRE test before this change and passing after.
(In reply to Alexey Shvayka from comment #8) > (In reply to Ross Kirsling from comment #7) > > Interesting—looks like it's that we (and SM) get confused about what this > > string even is? > > I am using + to add unescaped "0" char without resorting to "\x30". > I've checked V8 and SpiderMonkey, they both limit octal escapes in strings > to 3 chars, fail PCRE test before this change and passing after. Er whoops, I'd just gotten myself confused -- it's simply that the shells for JSC and SM stop printing when they hit \0, unlike V8.
Committed r259546: <https://trac.webkit.org/changeset/259546> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395478 [details].
<rdar://problem/61311334>