4.88 KB, patch
|Details | Diff | Splinter Review|
Great, I'll update rhino in MonkeyScript and pull out my workaround (trimming it with .trim() first) once the commit makes it's way into the git-mirror.
This bug looks like it has cropped up again and json ending with a \n is throwing errors again.
Norris converted it back with the following commit message: Fix regression in unit test. Patch from Raphael Speyer. I don't think it makes much sense, but I trust Raphael on ES5 issues (and haven't actually made the effort to read the spec).
Created attachment 415249 [details] [diff] [review] Ignore trailing whitespace when parsing JSON Sorry, only just saw this bug now. As far as I can tell, whitespace at the beginning and end should be ignored. Paragraph 2 of 5.1.2 seems to imply that, and that's what other implementations do. I didn't trim so that the character offset of errors could still be reported correctly.
Created attachment 415299 [details] [diff] [review] made consumption of whitespace a little more robust
Thanks for setting this straight, Raphael and Norris! After you undid my simple trim() patch, I wrongly assumed that ES5 would not allow leading/trailing whitespace. I never actually checked with the spec, although I definitely should have.