Explorar el Código

Make `Context.definedValue` return `Null<String>` and document `Context.resolvePath` exception (#11363)

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

* Document `Context.resolvePath` exception
Robert Borghese hace 1 año
padre
commit
e328c44d78
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      std/haxe/macro/Context.hx

+ 3 - 1
std/haxe/macro/Context.hx

@@ -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);
@@ -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);
 	}