浏览代码

support nodejs in haxe.EntryPoint

Dan Korostelev 9 年之前
父节点
当前提交
5bfddb9b63
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      std/haxe/EntryPoint.hx

+ 5 - 0
std/haxe/EntryPoint.hx

@@ -113,11 +113,16 @@ class EntryPoint {
 		#if js
 
 		processEvents();
+
+		#if nodejs
+		(untyped process).nextTick(run);
+		#else
 		var window : Dynamic = js.Browser.window;
 		var rqf : Dynamic = window.requestAnimationFrame ||
 			window.webkitRequestAnimationFrame ||
 			window.mozRequestAnimationFrame;
 		rqf(run);
+		#end
 
 		#elseif flash