Skip to content

Commit

Permalink
add js.Lib.undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
nadako committed Oct 19, 2014
1 parent 506f85a commit d0d5bac
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions std/js/Lib.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

0 comments on commit d0d5bac

Please sign in to comment.