Summary: | Web Inspector: JSON Parse error message should include more useful details about what caused parsing to fail | ||
---|---|---|---|
Product: | WebKit | Reporter: | BJ Burg <bburg> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | ggaren, jfbastien, joepeck, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | All | ||
OS: | All |
Description
BJ Burg
2016-05-24 11:43:33 PDT
Ping for import. 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... |