RESOLVED FIXED 115242
Web Inspector: expose the JS parser to the protocol
https://bugs.webkit.org/show_bug.cgi?id=115242
Summary Web Inspector: expose the JS parser to the protocol
Timothy Hatcher
Reported 2013-04-26 04:20:22 PDT
We should add RuntimeAgent.parse to get access to parse errors for use in the console prompt.
Attachments
Patch (6.65 KB, patch)
2013-04-26 04:23 PDT, Timothy Hatcher
no flags
Patch (6.63 KB, patch)
2013-04-26 05:46 PDT, Timothy Hatcher
no flags
Patch (6.64 KB, patch)
2013-04-26 09:05 PDT, Timothy Hatcher
no flags
Patch (7.42 KB, patch)
2013-04-26 10:34 PDT, Timothy Hatcher
no flags
Patch (9.34 KB, patch)
2013-04-26 10:55 PDT, Timothy Hatcher
no flags
Timothy Hatcher
Comment 1 2013-04-26 04:23:34 PDT
Early Warning System Bot
Comment 2 2013-04-26 04:28:14 PDT
EFL EWS Bot
Comment 3 2013-04-26 04:28:37 PDT
EFL EWS Bot
Comment 4 2013-04-26 04:28:54 PDT
Early Warning System Bot
Comment 5 2013-04-26 04:29:43 PDT
Build Bot
Comment 6 2013-04-26 04:57:45 PDT
Timothy Hatcher
Comment 7 2013-04-26 05:46:33 PDT
Build Bot
Comment 8 2013-04-26 06:11:32 PDT
Timothy Hatcher
Comment 9 2013-04-26 09:05:07 PDT
Build Bot
Comment 10 2013-04-26 10:32:00 PDT
Timothy Hatcher
Comment 11 2013-04-26 10:34:08 PDT
Timothy Hatcher
Comment 12 2013-04-26 10:51:59 PDT
Comment on attachment 199841 [details] Patch Need to fix Windows build before landing.
Timothy Hatcher
Comment 13 2013-04-26 10:55:57 PDT
WebKit Commit Bot
Comment 14 2013-04-26 12:07:30 PDT
Comment on attachment 199844 [details] Patch Clearing flags on attachment: 199844 Committed r149202: <http://trac.webkit.org/changeset/149202>
WebKit Commit Bot
Comment 15 2013-04-26 12:07:34 PDT
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 16 2013-04-26 12:51:39 PDT
Comment on attachment 199844 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=199844&action=review Nice! > Source/WebCore/inspector/Inspector.json:671 > + "description": "Syntax error type: \"none\" for no error, \"irrecoverable\" for unrecoverable errors, \"unterminated-literal\" for when there is an unterminated literal, \"recoverable\" for when the expression is unfinished but valid so far." Some of the descriptions have <code>foo</code> instead of \"foo\". I think its easier to read the <code> versions. Maybe one day we can format this file as documentation nicely, like: <https://developers.google.com/chrome-developer-tools/docs/protocol/tot/console> > Source/WebCore/inspector/InspectorRuntimeAgent.cpp:99 > + checkSyntax(*vm, JSC::makeSource(expression), error); When on a breakpoint, we may want to inherit the Strict versus Non-Strict mode scope we are in and pass that into checkSyntax, which currently hardcodes JSParseNormal. There are syntax errors that can happen in strict mode that can't in normal mode, e.g. duplicate object literal keys: js> var o = { x:1, x:2 }; o.x 2 js> "use strict"; var o = { x:1, x:2 }; o.x Exception: SyntaxError: Unexpected token '}' I can file a follow-up bug on this edge case. > Source/WebCore/inspector/InspectorRuntimeAgent.h:64 > + virtual void parse(ErrorString*, const String& expression, TypeBuilder::Runtime::SyntaxErrorType::Enum* result, TypeBuilder::OptOutput<String>* message, RefPtr<TypeBuilder::Runtime::ErrorRange>&); We should consider starting to add OVERRIDE to these, to help catch dead code if a protocol method is removed (rare or accidental), the compiler can tell us.
Note You need to log in before you can comment on or make changes to this bug.