浏览代码

[js] html externs: remove invalid default values (#7798)

George Corney 6 年之前
父节点
当前提交
a5323baad0

+ 1 - 1
std/js/html/Client.hx

@@ -55,5 +55,5 @@ extern class Client {
 		Sends a message to the client.
 		@throws DOMError
 	**/
-	function postMessage( message : Dynamic, transfer : Array<Dynamic> = [] ) : Void;
+	function postMessage( message : Dynamic, ?transfer : Array<Dynamic> ) : Void;
 }

+ 1 - 1
std/js/html/DedicatedWorkerGlobalScope.hx

@@ -54,7 +54,7 @@ extern class DedicatedWorkerGlobalScope extends WorkerGlobalScope {
 		Sends a message — which can consist of `any` JavaScript object — to the parent document that first spawned the worker.
 		@throws DOMError
 	**/
-	function postMessage( message : Dynamic, transfer : Array<Dynamic> = [] ) : Void;
+	function postMessage( message : Dynamic, ?transfer : Array<Dynamic> ) : Void;
 	
 	/**
 		Discards any tasks queued in the `WorkerGlobalScope`'s event loop, effectively closing this particular scope.

+ 3 - 3
std/js/html/MessageEvent.hx

@@ -65,7 +65,7 @@ extern class MessageEvent extends Event {
 	/**
 		Initializes a message event. Do not use this anymore — use the `MessageEvent.MessageEvent` constructor instead.
 	**/
-	@:overload( function( type : String, bubbles : Bool = false, cancelable : Bool = false, ?data : Dynamic, origin : String = "", lastEventId : String = "", ?source : MessagePort, ports : Array<MessagePort> = []) : Void {} )
-	@:overload( function( type : String, bubbles : Bool = false, cancelable : Bool = false, ?data : Dynamic, origin : String = "", lastEventId : String = "", ?source : ServiceWorker, ports : Array<MessagePort> = []) : Void {} )
-	function initMessageEvent( type : String, bubbles : Bool = false, cancelable : Bool = false, ?data : Dynamic, origin : String = "", lastEventId : String = "", ?source : Window, ports : Array<MessagePort> = [] ) : Void;
+	@:overload( function( type : String, bubbles : Bool = false, cancelable : Bool = false, ?data : Dynamic, origin : String = "", lastEventId : String = "", ?source : MessagePort, ?ports : Array<MessagePort>) : Void {} )
+	@:overload( function( type : String, bubbles : Bool = false, cancelable : Bool = false, ?data : Dynamic, origin : String = "", lastEventId : String = "", ?source : ServiceWorker, ?ports : Array<MessagePort>) : Void {} )
+	function initMessageEvent( type : String, bubbles : Bool = false, cancelable : Bool = false, ?data : Dynamic, origin : String = "", lastEventId : String = "", ?source : Window, ?ports : Array<MessagePort> ) : Void;
 }

+ 1 - 1
std/js/html/MessagePort.hx

@@ -37,7 +37,7 @@ extern class MessagePort extends EventTarget {
 	var onmessageerror : haxe.Constraints.Function;
 	
 	/** @throws DOMError */
-	function postMessage( message : Dynamic, transferable : Array<Dynamic> = [] ) : Void;
+	function postMessage( message : Dynamic, ?transferable : Array<Dynamic> ) : Void;
 	function start() : Void;
 	function close() : Void;
 }

+ 1 - 1
std/js/html/ServiceWorker.hx

@@ -51,5 +51,5 @@ extern class ServiceWorker extends EventTarget {
 	var onerror : haxe.Constraints.Function;
 	
 	/** @throws DOMError */
-	function postMessage( message : Dynamic, transferable : Array<Dynamic> = [] ) : Void;
+	function postMessage( message : Dynamic, ?transferable : Array<Dynamic> ) : Void;
 }

+ 2 - 2
std/js/html/URLSearchParams.hx

@@ -34,9 +34,9 @@ package js.html;
 @:native("URLSearchParams")
 extern class URLSearchParams {
 	/** @throws DOMError */
-	@:overload( function( init : haxe.DynamicAccess<String> = "") : URLSearchParams {} )
+	@:overload( function( ?init : haxe.DynamicAccess<String>) : URLSearchParams {} )
 	@:overload( function( init : String = "") : URLSearchParams {} )
-	function new( init : Array<Array<String>> = "" ) : Void;
+	function new( ?init : Array<Array<String>> ) : Void;
 	
 	/**
 		Appends a specified key/value pair as a new search parameter.

+ 1 - 1
std/js/html/Window.hx

@@ -435,7 +435,7 @@ extern class Window extends EventTarget {
 		Provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first.
 		@throws DOMError
 	**/
-	function postMessage( message : Dynamic, targetOrigin : String, transfer : Array<Dynamic> = [] ) : Void;
+	function postMessage( message : Dynamic, targetOrigin : String, ?transfer : Array<Dynamic> ) : Void;
 	
 	/**
 		Registers the window to capture all events of the specified type.

+ 1 - 1
std/js/html/Worker.hx

@@ -57,5 +57,5 @@ extern class Worker extends EventTarget {
 		Sends a message — which can consist of `any` JavaScript object — to the worker's inner scope.
 		@throws DOMError
 	**/
-	function postMessage( message : Dynamic, transfer : Array<Dynamic> = [] ) : Void;
+	function postMessage( message : Dynamic, ?transfer : Array<Dynamic> ) : Void;
 }