Pārlūkot izejas kodu

add js.Lib.undefined

Dan Korostelev 11 gadi atpakaļ
vecāks
revīzija
d0d5bac553
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 11 0
      std/js/Lib.hx

+ 11 - 0
std/js/Lib.hx

@@ -52,4 +52,15 @@ class Lib {
 		return untyped __js__("require")(module);
 	}
 
+	/**
+		Returns JavaScript `undefined` value.
+
+		Note that this is only needed in very rare cases when working with external JavaScript code.
+
+		In Haxe, `null` is used to represent the absence of a value.
+	**/
+	public static var undefined(get,never) : Dynamic;
+	static inline function get_undefined() : Dynamic {
+		return untyped __js__("undefined");
+	}
 }