Bug 108640 - Web Inspector: [Extension API] adjust inspectedWindow.eval() callback parameters to expose non-exceptional error
Summary: Web Inspector: [Extension API] adjust inspectedWindow.eval() callback paramet...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Kosyakov
Depends on:
Reported: 2013-02-01 08:21 PST by Andrey Kosyakov
Modified: 2013-02-11 10:07 PST (History)
10 users (show)

See Also:

Patch (9.83 KB, patch)
2013-02-01 08:26 PST, Andrey Kosyakov
vsevik: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Comment 2 Vsevolod Vlasov 2013-02-01 08:58:44 PST
Comment on attachment 186053 [details]

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]

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

New failing tests:
Comment 4 Build Bot 2013-02-01 10:53:34 PST
Comment on attachment 186053 [details]

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

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