Skip to content

Commit a9ab55f

Browse files
committed
Use overload for Worker constructor
1 parent 8e3c7da commit a9ab55f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import scala.scalajs.js.annotation._
1818
*/
1919
@js.native
2020
@JSGlobal
21-
class Worker(scriptURL: String, options: js.UndefOr[WorkerOptions] = js.native) extends AbstractWorker {
21+
class Worker(scriptURL: String, options: WorkerOptions) extends AbstractWorker {
22+
23+
def this(scriptURL: String) = this(scriptURL, js.native)
2224

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

0 commit comments

Comments
 (0)