瀏覽代碼

Avoid explicit window references, so this will work in Node.

Fixes issue #1195.
Bruno Garcia 13 年之前
父節點
當前提交
f75b2aabfa
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      std/haxe/Timer.hx

+ 2 - 2
std/haxe/Timer.hx

@@ -45,7 +45,7 @@ class Timer {
 			id = untyped _global["setInterval"](function() { me.run(); },time_ms);
 		#elseif js
 			var me = this;
-			id = untyped window.setInterval(function() me.run(),time_ms);
+			id = untyped setInterval(function() me.run(),time_ms);
 		#end
 	}
 
@@ -60,7 +60,7 @@ class Timer {
 		#elseif flash
 			untyped _global["clearInterval"](id);
 		#elseif js
-			untyped window.clearInterval(id);
+			untyped clearInterval(id);
 		#end
 		id = null;
 	}