Skip to content

Commit f48f839

Browse files
authored
Simplify SharedWorker constructors
1 parent ce9293b commit f48f839

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,10 @@ import scala.scalajs.js.|
2525
*/
2626
@js.native
2727
@JSGlobal
28-
class SharedWorker private[this] (scriptURL: String, options: js.UndefOr[String | WorkerOptions] = js.native)
29-
extends AbstractWorker {
28+
class SharedWorker(scriptURL: String) extends AbstractWorker {
29+
def this(scriptURL: String, name: String) = this(scriptURL)
3030

31-
def this(scriptURL: String) = this(scriptURL, js.undefined)
32-
33-
def this(scriptURL: String, name: String) = this(scriptURL, js.defined(name))
34-
35-
def this(scriptURL: String, options: WorkerOptions) = this(scriptURL, js.defined(options))
31+
def this(scriptURL: String, options: WorkerOptions) = this(scriptURL)
3632

3733
/** The port property of the SharedWorker interface returns a [[MessagePort]] object used to communicate and control
3834
* the shared worker.

0 commit comments

Comments
 (0)