Bug 108640

Summary: Web Inspector: [Extension API] adjust inspectedWindow.eval() callback parameters to expose non-exceptional error
Product: WebKit Reporter: Andrey Kosyakov <caseq>
Component: Web Inspector (Deprecated)Assignee: Andrey Kosyakov <caseq>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, buildbot, keishi, loislo, pfeldman, pmuellr, rniwa, vsevik, web-inspector-bugs, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch vsevik: review+, buildbot: commit-queue-

Description Andrey Kosyakov 2013-02-01 08:21:50 PST
Currently, we do not differentiate between JavaScript exceptions in the code being executed and other sorts of errors (e.g. inspector protocol or arguments validation). Also, the exception information is returned in the same argument that is used to return result in case expression was successfully evaluated. This may lead to bugs if value argument is ignored.

The proposed change will only set first argument to the callback iff the expression is successfully evaluated. The second argument will be undefined in case of succecss.
In case of exception, the second argument will be { isException: true, value: <stringified value of exception> }
In case of protocol error or extension server, the second argument will be { isError: true } with the rest of fields set as normally for errors.
Comment 1 Andrey Kosyakov 2013-02-01 08:26:43 PST
Created attachment 186053 [details]
Patch
Comment 2 Vsevolod Vlasov 2013-02-01 08:58:44 PST
Comment on attachment 186053 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=186053&action=review

> Source/WebCore/ChangeLog:11
> +        - minor drive-by changes in ExtensionAPI utilities.

I would revert this because it's less readable.
Comment 3 Build Bot 2013-02-01 09:55:42 PST
Comment on attachment 186053 [details]
Patch

Attachment 186053 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://queues.webkit.org/results/16297883

New failing tests:
inspector/extensions/extensions-eval.html
inspector/extensions/extensions-sidebar.html
Comment 4 Build Bot 2013-02-01 10:53:34 PST
Comment on attachment 186053 [details]
Patch

Attachment 186053 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/16296856

New failing tests:
inspector/extensions/extensions-eval.html
inspector/extensions/extensions-events.html
inspector/extensions/extensions-sidebar.html
Comment 5 Andrey Kosyakov 2013-02-11 10:07:20 PST
Committed r142486: <http://trac.webkit.org/changeset/142486>