Explorar o código

Added __feature__'s for generation of $isFinite,isNaN,Number in Math

Luca Deltodesco %!s(int64=12) %!d(string=hai) anos
pai
achega
00c256dc7d
Modificáronse 1 ficheiros con 8 adicións e 8 borrados
  1. 8 8
      std/Math.hx

+ 8 - 8
std/Math.hx

@@ -43,7 +43,7 @@ extern class Math
 	**/
 	**/
 #if js
 #if js
 	static var NEGATIVE_INFINITY(get, null) : Float;
 	static var NEGATIVE_INFINITY(get, null) : Float;
-	static inline function get_NEGATIVE_INFINITY() : Float return untyped __js__("$Number").NEGATIVE_INFINITY;
+	static inline function get_NEGATIVE_INFINITY() : Float return untyped __define_feature__("Math.INF/NAN", $Number).NEGATIVE_INFINITY;
 #else
 #else
 	static var NEGATIVE_INFINITY(default, null) : Float;
 	static var NEGATIVE_INFINITY(default, null) : Float;
 #end
 #end
@@ -61,7 +61,7 @@ extern class Math
 	**/
 	**/
 #if js
 #if js
 	static var POSITIVE_INFINITY(get, null) : Float;
 	static var POSITIVE_INFINITY(get, null) : Float;
-	static inline function get_POSITIVE_INFINITY() : Float return untyped __js__("$Number").POSITIVE_INFINITY;
+	static inline function get_POSITIVE_INFINITY() : Float return untyped __define_feature__("Math.INF/NAN", $Number).POSITIVE_INFINITY;
 #else
 #else
 	static var POSITIVE_INFINITY(default, null) : Float;
 	static var POSITIVE_INFINITY(default, null) : Float;
 #end
 #end
@@ -86,7 +86,7 @@ extern class Math
 	**/
 	**/
 #if js
 #if js
 	static var NaN(get, null) : Float;
 	static var NaN(get, null) : Float;
-	static inline function get_NaN() : Float return untyped __js__("$Number").NaN;
+	static inline function get_NaN() : Float return untyped __define_feature__("Math.INF/NAN", $Number).NaN;
 #else
 #else
 	static var NaN(default, null) : Float;
 	static var NaN(default, null) : Float;
 #end
 #end
@@ -260,7 +260,7 @@ extern class Math
 		Otherwise the result is true.
 		Otherwise the result is true.
 	**/
 	**/
 #if js
 #if js
-	static inline function isFinite( f : Float ) : Bool return untyped __js__("$isFinite")(f);
+	static inline function isFinite( f : Float ) : Bool return untyped __define_feature__("Math.isFinite", $isFinite)(f);
 #else
 #else
 	static function isFinite( f : Float ) : Bool;
 	static function isFinite( f : Float ) : Bool;
 #end
 #end
@@ -274,7 +274,7 @@ extern class Math
 		NEGATIVE_INFINITY are not considered NaN.
 		NEGATIVE_INFINITY are not considered NaN.
 	**/
 	**/
 #if js
 #if js
-	static inline function isNaN( f : Float ) : Bool return untyped __js__("$isNaN")(f);
+	static inline function isNaN( f : Float ) : Bool return untyped __define_feature__("Math.isNaN", $isNaN)(f);
 #else
 #else
 	static function isNaN( f : Float ) : Bool;
 	static function isNaN( f : Float ) : Bool;
 #end
 #end
@@ -296,9 +296,9 @@ extern class Math
 	#end
 	#end
 	#if js
 	#if js
 		__feature__("Type.resolveClass",$hxClasses['Math'] = Math);
 		__feature__("Type.resolveClass",$hxClasses['Math'] = Math);
-		__js__("var $Number = Number");
-		__js__("var $isFinite = isFinite");
-		__js__("var $isNaN = isNaN");
+		__feature__("Math.INF/NAN", __js__("var $Number = Number"));
+		__feature__("Math.isFinite",__js__("var $isFinite = isFinite"));
+		__feature__("Math.isNaN",__js__("var $isNaN = isNaN"));
 	#end
 	#end
 		#if js __js__("Math") #else Math #end.isFinite = function(i) {
 		#if js __js__("Math") #else Math #end.isFinite = function(i) {
 			return
 			return