The error attribute of ErrorEvent should be initialized to null for dedicated workers |
|
Issue descriptionWhen an uncaught runtime script error occurs in one of the worker's scripts, the error attribute of ErrorEvent should be initialized to null for dedicated workers. Current implementation does not do that, but instead, the error argument for OnErrorEventHandler is set to null in JSEventHandler::CallListenerFunction(). Standard definition: https://html.spec.whatwg.org/C/workers.html#runtime-script-errors-2
,
Nov 9
To be more precise, ErrorEvent on WorkerGlobalScope should have a valid 'error' attribute[1], while ErrorEvent propagated to parent Document should have a null 'error' attribute[2]. [1] https://html.spec.whatwg.org/multipage/webappapis.html#runtime-script-errors "7. ... and the error attribute initialized to errorValue." [2] https://html.spec.whatwg.org/multipage/workers.html#runtime-script-errors-2 "1. ... and the error attribute initialized to null."
,
Nov 9
Looks like the test expectation for the WPT was removed by this CL (Oct. 19) https://chromium-review.googlesource.com/c/chromium/src/+/1289078 , I'm not sure when this was fixed though. At least my local Chrome (70.0.3538.77) fails the test.
,
Nov 9
Ok, the test was fixed by yukiy@: https://chromium-review.googlesource.com/c/chromium/src/+/1215512/65/third_party/blink/renderer/bindings/core/v8/js_event_handler.cc#70 This CL added special handling for dedicated workers in JSEventHandler::CallListenerFunction() as mentioned in the reporter's comment.
,
Nov 9
Wait. According to c#4, I ran the test on ToT developer build without the special handling, and confirmed that passed... hmmm. There might be another factor to enable the test to pass. Maybe I should stop archaeology now :p
,
Nov 9
By the way, the spec requires ErrorEvent.error defaults to 'null'[1] but the current impl doesn't do it[2]. Probably, we should initialize 'error' attribute as 'null' not only for dedicated workers but also for other execution contexts. [1] https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface [2] https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/renderer/core/events/error_event.cc#103 |
|
►
Sign in to add a comment |
|
Comment 1 by nhiroki@chromium.org
, Nov 9