Skip to content

Commit

Permalink
Make Context.definedValue return Null<String> and document `Conte…
Browse files Browse the repository at this point in the history
…xt.resolvePath` exception (#11363)

* Wrap `Context.definedValue` return with Null<T>

* Document `Context.resolvePath` exception
  • Loading branch information
SomeRanDev authored Nov 7, 2023
1 parent f5fcc45 commit e328c44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion std/haxe/macro/Context.hx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class Context {
If a class path was declared relative, this method returns the relative
file path. Otherwise it returns the absolute file path.
If no type can be found, an exception of type `String` is thrown.
**/
public static function resolvePath(file:String):String {
return load("resolve_path", 1)(file);
Expand Down Expand Up @@ -292,7 +294,7 @@ class Context {
@see https://haxe.org/manual/lf-condition-compilation.html
**/
public static function definedValue(key:String):String {
public static function definedValue(key:String):Null<String> {
return load("defined_value", 1)(key);
}

Expand Down

0 comments on commit e328c44

Please sign in to comment.