From 9391a789ea425aaec5303c4868e53e62a7153866 Mon Sep 17 00:00:00 2001 From: Ondrej Date: Wed, 14 Jan 2015 22:13:21 +0100 Subject: [PATCH] fixes TypeError: Illegal Invocation in node-webkit requestAnimationFrame, setTimeout and clearTimeout need to be called on the window object explicitely in node-webkit. --- mithril.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index ddd94405..6fb276ad 100644 --- a/mithril.js +++ b/mithril.js @@ -11,8 +11,8 @@ var m = (function app(window, undefined) { function initialize(window){ $document = window.document; $location = window.location; - $cancelAnimationFrame = window.cancelAnimationFrame || window.clearTimeout; - $requestAnimationFrame = window.requestAnimationFrame || window.setTimeout; + $cancelAnimationFrame = (window.cancelAnimationFrame || window.clearTimeout).bind(window); + $requestAnimationFrame = (window.requestAnimationFrame || window.setTimeout).bind(window); } initialize(window);