Browse Source

Merge pull request #2383 from nadako/cs_resources_dce_fix

[cs] fix usage of StringMap.get in haxe.Resource so it doesn't get removed by DCE
Simon Krajewski 11 years ago
parent
commit
f7c4b032ed
1 changed files with 4 additions and 2 deletions
  1. 4 2
      std/haxe/Resource.hx

+ 4 - 2
std/haxe/Resource.hx

@@ -87,7 +87,8 @@ class Resource {
 		var stream = new java.io.NativeInput(stream);
 		return stream.readAll().toString();
 		#elseif cs
-		var str:cs.system.io.Stream = untyped __cs__("typeof(haxe.Resource).Assembly.GetManifestResourceStream((string)getPaths().get(name).@value)");
+		var path = getPaths().get(name);
+		var str:cs.system.io.Stream = untyped __cs__("typeof(haxe.Resource).Assembly.GetManifestResourceStream(path)");
 		if (str != null)
 			return new cs.io.NativeInput(str).readAll().toString();
 		return null;
@@ -120,7 +121,8 @@ class Resource {
 		var stream = new java.io.NativeInput(stream);
 		return stream.readAll();
 		#elseif cs
-		var str:cs.system.io.Stream = untyped __cs__("typeof(haxe.Resource).Assembly.GetManifestResourceStream((string)getPaths().get(name).@value)");
+		var path = getPaths().get(name);
+		var str:cs.system.io.Stream = untyped __cs__("typeof(haxe.Resource).Assembly.GetManifestResourceStream(path)");
 		if (str != null)
 			return new cs.io.NativeInput(str).readAll();
 		return null;