Przeglądaj źródła

[js] add @:pure to Date methods

Dan Korostelev 9 lat temu
rodzic
commit
0590493ccc
1 zmienionych plików z 13 dodań i 13 usunięć
  1. 13 13
      std/js/_std/Date.hx

+ 13 - 13
std/js/_std/Date.hx

@@ -21,29 +21,29 @@
  */
 @:coreApi extern class Date {
 
-	function new(year : Int, month : Int, day : Int, hour : Int, min : Int, sec : Int ) : Void;
-	function getTime() : Float;
-	function getHours() : Int;
-	function getMinutes() : Int;
-	function getSeconds() : Int;
-	function getFullYear() : Int;
-	function getMonth() : Int;
-	function getDate() : Int;
-	function getDay() : Int;
+	@:pure function new(year : Int, month : Int, day : Int, hour : Int, min : Int, sec : Int ) : Void;
+	@:pure function getTime() : Float;
+	@:pure function getHours() : Int;
+	@:pure function getMinutes() : Int;
+	@:pure function getSeconds() : Int;
+	@:pure function getFullYear() : Int;
+	@:pure function getMonth() : Int;
+	@:pure function getDate() : Int;
+	@:pure function getDay() : Int;
 
-	inline function toString() : String {
+	@:pure inline function toString() : String {
 		return untyped HxOverrides.dateStr(this);
 	}
 
-	static inline function now() : Date {
+	@:pure static inline function now() : Date {
 		return untyped __new__(Date);
 	}
 
-	static inline function fromTime( t : Float ) : Date {
+	@:pure static inline function fromTime( t : Float ) : Date {
 		return untyped __new__(Date, t);
 	}
 
-	static inline function fromString( s : String ) : Date {
+	@:pure static inline function fromString( s : String ) : Date {
 		return untyped HxOverrides.strDate(s);
 	}
 }