From 7ba68b9a2426392390bc63c970dc39121c216663 Mon Sep 17 00:00:00 2001 From: chenxsan Date: Mon, 28 Dec 2015 09:51:39 +0800 Subject: [PATCH] Fixed 'Uncaught ReferenceError' When using snabbdom with webpack, the webpack output file is in strict mode, and that would cause error: > Uncaught ReferenceError: requestAnimationFrame is not defined at ... This pull request fixed it. --- modules/style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/style.js b/modules/style.js index 978c7cd..d062931 100644 --- a/modules/style.js +++ b/modules/style.js @@ -1,4 +1,4 @@ -var raf = requestAnimationFrame || setTimeout; +var raf = (window && window.requestAnimationFrame) || setTimeout; var nextFrame = function(fn) { raf(function() { raf(fn); }); }; function setNextFrame(obj, prop, val) {