Worker: Throw an original Error on importScripts() failure
Before this CL, when a failure on importScripts() happens, WorkerOrWorkletScriptController::RethrowExceptionFromImportedScript() creates a new Error and throws it instead of an original Error. This fails web platform tests: https://wpt.fyi/results/workers/interfaces/WorkerUtils/importScripts/004.html?label=stable&aligned https://wpt.fyi/results/workers/interfaces/WorkerUtils/importScripts/006.html?label=stable&aligned This CL makes the function throw the original Error. In addition, this CL changes ErrorEvent::CreateSanitizedError() to create a sanitized error with a null error object instead of an empty error object. This is because the HTML spec requires the error object for scripts whose errors are muted must be null, and ExceptionState::RethrowV8Exception() called from RethrowExceptionFromImportedScript() doesn't throw an exception when its error object is empty. Bug: 651778, 655458 Change-Id: I67a91879b4a9fa3fd521797394fe35de89634b7a Reviewed-on: https://chromium-review.googlesource.com/c/1343465 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by:
Kouhei Ueno <kouhei@chromium.org> Reviewed-by:
Kentaro Hara <haraken@chromium.org> Reviewed-by:
Kenichi Ishibashi <bashi@chromium.org> Reviewed-by:
Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#610011}
Showing
Please register or sign in to comment