[Webkit-unassigned] [Bug 158033] Web Inspector: JSON Parse error message should include more useful details about what caused parsing to fail

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 4 16:24:04 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=158033

JF Bastien <jfbastien at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jfbastien at apple.com

--- Comment #3 from JF Bastien <jfbastien at apple.com> ---
This is pretty bad:
  jsc -e 'JSON.parse("{\"a\": {},}")'
  Exception: SyntaxError: JSON Parse error: Property name must be a string literal
  at [Command Line]:1
  parse@[native code]
  global code@[Command Line]:1:11

Looks like it comes from JSC:
  Source/JavaScriptCore/runtime/LiteralParser.cpp:                    m_parseErrorMessage = ASCIILiteral("Property name must be a string literal");

There are some tests for it:
  LayoutTests/js/dom/JSON-parse-expected.txt:PASS tests[i](nativeJSON) threw exception SyntaxError: JSON Parse error: Property name must be a string literal.
  LayoutTests/js/dom/JSON-parse-expected.txt:PASS tests[i](nativeJSON) threw exception SyntaxError: JSON Parse error: Property name must be a string literal.

I may un-lazy and try to improve it at some point...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161004/84369bd3/attachment.html>


More information about the webkit-unassigned mailing list