Browse Source

wrap Strings (fixed issue #1423)

Simon Krajewski 12 years ago
parent
commit
fe16abb4a1
1 changed files with 4 additions and 4 deletions
  1. 4 4
      std/haxe/macro/Context.hx

+ 4 - 4
std/haxe/macro/Context.hx

@@ -95,12 +95,12 @@ class Context {
 	public static function getLocalMethod() : Null<String> {
 	public static function getLocalMethod() : Null<String> {
 		var l : String = load("local_method", 0)();
 		var l : String = load("local_method", 0)();
 		if (l == "") return null;
 		if (l == "") return null;
-		return l;
+		return new String(l);
 	}
 	}
 
 
 	/**
 	/**
 		Returns classes which are available for "using" where the macro was called
 		Returns classes which are available for "using" where the macro was called
-	**/	
+	**/
 	public static function getLocalUsing() :  Array<Type.Ref<Type.ClassType>> {
 	public static function getLocalUsing() :  Array<Type.Ref<Type.ClassType>> {
 		return load("local_using", 0)();
 		return load("local_using", 0)();
 	}
 	}
@@ -123,8 +123,8 @@ class Context {
 		Returns the value defined through -D key=value
 		Returns the value defined through -D key=value
 	**/
 	**/
 	public static function definedValue( key : String ) : String {
 	public static function definedValue( key : String ) : String {
-		return load("defined_value", 1)(untyped key.__s);
-	}	
+		return new String(load("defined_value", 1)(untyped key.__s));
+	}
 
 
 	/**
 	/**
 		Resolve a type from its name.
 		Resolve a type from its name.