Erik Arvidsson
unread,Dec 16, 2013, 10:22:19 AM12/16/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to florian...@quantumedia.de, blink-dev, Philip Jägenstedt, Adam Barth, Elliott Sprehn
Remember that VariableDeclarations hoist and are initialized to
undefined, as well as all global bindings become own properties on the
global object (which is the window in a web browser).
There are a few solutions (Adam mentioned one).
1. Do not use global variables. The original code is fine inside a
function scope.
2. Use `window.requestAnimationFrame = ...`
3. You can also skip the var if you are in non-strict mode.
--
erik