Skip to content

Commit 957893c

Browse files
committed
Add constructors with URL for web workers
1 parent 53f9a1a commit 957893c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dom/src/main/scala/org/scalajs/dom/Worker.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ import scala.scalajs.js.annotation._
1818
*/
1919
@js.native
2020
@JSGlobal
21-
class Worker(scriptURL: String, options: WorkerOptions) extends AbstractWorker {
22-
23-
def this(scriptURL: String) = this(scriptURL, js.native)
21+
class Worker extends AbstractWorker {
22+
23+
def this(scriptURL: String, options: WorkerOptions) = this()
24+
def this(scriptURL: String) = this()
25+
def this(scriptURL: URL, options: WorkerOptions) = this()
26+
def this(scriptURL: URL) = this()
2427

2528
/** The Worker.onmessage property represents an EventHandler, that is a function to be called when the message event
2629
* occurs. These events are of type MessageEvent and will be called when the worker calls its own postMessage()

0 commit comments

Comments
 (0)