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.
Created attachment 186053 [details] Patch
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 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 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
Committed r142486: <http://trac.webkit.org/changeset/142486>