Sfoglia il codice sorgente

[js] keep compat version iff non-compat version is used (see #4259)

Simon Krajewski 9 anni fa
parent
commit
a1d47d6787

+ 2 - 0
std/js/html/ArrayBuffer.hx

@@ -24,6 +24,8 @@
 
 package js.html;
 
+import js.html.compat.ArrayBuffer;
+
 @:native("ArrayBuffer")
 extern class ArrayBuffer
 {

+ 2 - 0
std/js/html/DataView.hx

@@ -24,6 +24,8 @@
 
 package js.html;
 
+import js.html.compat.DataView;
+
 @:native("DataView")
 extern class DataView extends ArrayBufferView
 {

+ 4 - 2
std/js/html/Float32Array.hx

@@ -24,13 +24,15 @@
 
 package js.html;
 
+import js.html.compat.Float32Array;
+
 @:native("Float32Array")
 extern class Float32Array extends ArrayBufferView implements ArrayAccess<Float>
 {
 	static inline var BYTES_PER_ELEMENT : Int = 4;
-	
+
 	var length(default,null) : Int;
-	
+
 	/** @throws DOMError */
 	@:overload( function( length : Int ) : Void {} )
 	@:overload( function( array : Float32Array ) : Void {} )

+ 4 - 2
std/js/html/Float64Array.hx

@@ -24,13 +24,15 @@
 
 package js.html;
 
+import js.html.compat.Float64Array;
+
 @:native("Float64Array")
 extern class Float64Array extends ArrayBufferView implements ArrayAccess<Float>
 {
 	static inline var BYTES_PER_ELEMENT : Int = 8;
-	
+
 	var length(default,null) : Int;
-	
+
 	/** @throws DOMError */
 	@:overload( function( length : Int ) : Void {} )
 	@:overload( function( array : Float64Array ) : Void {} )

+ 4 - 2
std/js/html/Uint8Array.hx

@@ -24,13 +24,15 @@
 
 package js.html;
 
+import js.html.compat.Uint8Array;
+
 @:native("Uint8Array")
 extern class Uint8Array extends ArrayBufferView implements ArrayAccess<Int>
 {
 	static inline var BYTES_PER_ELEMENT : Int = 1;
-	
+
 	var length(default,null) : Int;
-	
+
 	/** @throws DOMError */
 	@:overload( function( length : Int ) : Void {} )
 	@:overload( function( array : Uint8Array ) : Void {} )

+ 1 - 1
std/js/html/compat/ArrayBuffer.hx

@@ -22,7 +22,7 @@
 package js.html.compat;
 
 #if !nodejs
-@:keep
+@:ifFeature("js.html.ArrayBuffer.*")
 class ArrayBuffer {
 
 	public var byteLength : Int;

+ 1 - 1
std/js/html/compat/DataView.hx

@@ -24,7 +24,7 @@ package js.html.compat;
 #if !nodejs
 import haxe.io.Error;
 
-@:ifFeature("haxe.io.Float32Array.*", "haxe.io.Float64Array.*")
+@:ifFeature("js.html.DataView.*")
 @:access(js.html.compat.ArrayBuffer)
 class DataView {
 

+ 1 - 1
std/js/html/compat/Float32Array.hx

@@ -24,7 +24,7 @@ package js.html.compat;
 #if !nodejs
 import js.Lib.nativeThis;
 
-@:keep
+@:ifFeature("js.html.Float32Array.*")
 class Float32Array {
 
 	static var BYTES_PER_ELEMENT = 4;

+ 1 - 1
std/js/html/compat/Float64Array.hx

@@ -24,7 +24,7 @@ package js.html.compat;
 #if !nodejs
 import js.Lib.nativeThis;
 
-@:keep
+@:ifFeature("js.html.Float64Array.*")
 class Float64Array {
 
 	static var BYTES_PER_ELEMENT = 8;

+ 1 - 1
std/js/html/compat/Uint8Array.hx

@@ -24,7 +24,7 @@ package js.html.compat;
 #if !nodejs
 import js.Lib.nativeThis;
 
-@:keep
+@:ifFeature("js.html.Uint8Array.*")
 class Uint8Array {
 
 	static var BYTES_PER_ELEMENT = 1;