New issue
Advanced search Search tips

Issue 831420 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug

Blocking:
issue 680046



Sign in to add a comment

Throw an exception when importScripts() is called on "module" worker

Project Member Reported by nhiroki@chromium.org, Apr 10 2018

Issue description

Spec: https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts

"1. If worker global scope's type is "module", throw a TypeError exception."
 
We need to...

 - add 'type' field ('classic' or 'module') to WorkerGlobalScope,
 - throw an exception in WorkerGlobalScope::importScripts() if the type is 'module', and
 - add WPT

Regarding the 'type' field, we could add it into GlobalScopeCreationParams and assign it to WorkerGlobalScope::type_ in the ctor of the global scope.
Blocking: 680046
Owner: nhiroki@chromium.org
Status: Started (was: Available)
Project Member

Comment 4 by bugdroid1@chromium.org, May 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3481ccc2018c16fb4ed13104fa834121e4e8cfa9

commit 3481ccc2018c16fb4ed13104fa834121e4e8cfa9
Author: Hiroki Nakagawa <nhiroki@chromium.org>
Date: Tue May 08 07:09:16 2018

Worker: Throw an exception when importScripts() is called on "module" worker

Spec: https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts

"1. If worker global scope's type is "module", throw a TypeError exception."

Bug:  831420 
Change-Id: I6a1976363435596562689988ed39394a3b735779
Reviewed-on: https://chromium-review.googlesource.com/1038926
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556713}
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/WebKit/LayoutTests/external/wpt/workers/modules/dedicated-worker-import.html
[add] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/WebKit/LayoutTests/external/wpt/workers/modules/resources/empty-worker.js
[add] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/WebKit/LayoutTests/external/wpt/workers/modules/resources/import-scripts-worker.js
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/exported/web_shared_worker_impl.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/layout/custom/layout_worklet_global_scope_proxy.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/dedicated_worker.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/dedicated_worker_test.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/global_scope_creation_params.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/global_scope_creation_params.h
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/main_thread_worklet_test.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/threaded_worklet_messaging_proxy.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/threaded_worklet_test.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/worker_global_scope.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/worker_global_scope.h
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/worker_thread_test.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/core/workers/worker_thread_test_helper.h
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/modules/animationworklet/animation_worklet_global_scope_test.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/modules/animationworklet/animation_worklet_thread_test.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/modules/csspaint/paint_worklet_global_scope_proxy.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/modules/exported/web_embedded_worker_impl.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope_test.cc
[modify] https://crrev.com/3481ccc2018c16fb4ed13104fa834121e4e8cfa9/third_party/blink/renderer/modules/webaudio/audio_worklet_thread_test.cc

Status: Fixed (was: Started)

Sign in to add a comment