浏览代码

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 年之前
父节点
当前提交
f7c4b032ed
共有 1 个文件被更改,包括 4 次插入2 次删除
  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);
 		var stream = new java.io.NativeInput(stream);
 		return stream.readAll().toString();
 		return stream.readAll().toString();
 		#elseif cs
 		#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)
 		if (str != null)
 			return new cs.io.NativeInput(str).readAll().toString();
 			return new cs.io.NativeInput(str).readAll().toString();
 		return null;
 		return null;
@@ -120,7 +121,8 @@ class Resource {
 		var stream = new java.io.NativeInput(stream);
 		var stream = new java.io.NativeInput(stream);
 		return stream.readAll();
 		return stream.readAll();
 		#elseif cs
 		#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)
 		if (str != null)
 			return new cs.io.NativeInput(str).readAll();
 			return new cs.io.NativeInput(str).readAll();
 		return null;
 		return null;