Provide a fake window in needed, making runtime run on node.js

This commit is contained in:
Evan Czaplicki 2013-10-30 16:33:44 +01:00
parent 71fb0a3663
commit 117294ee94

View file

@ -34,6 +34,7 @@ ElmRuntime.filterDeadInputs = function(inputs) {
// define the draw function
var vendors = ['ms', 'moz', 'webkit', 'o'];
var window = window || {};
for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
window.requestAnimationFrame = window[vendors[i]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[i]+'CancelAnimationFrame'] ||