Skip to content

Commit 5a85518

Browse files
authored
Merge pull request #857 from JPonte/webworker-overload
URL constructor for Worker
2 parents 53f9a1a + 13ac947 commit 5a85518

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
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 {
21+
class Worker extends AbstractWorker {
2222

23-
def this(scriptURL: String) = this(scriptURL, js.native)
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)