leapmotion/leapjs — pull request #129 by pehrlich (2013-12-12 02:40:31+00:00)
Title: Don't use "window" when it's not defined. [nodejs]

Bug, without this pull:

```
node leap.js

/Users/pehrlich/leap/projects/leapjs/leap.js:6953
if (window !== 'undefined' && typeof(window.requestAnimationFrame) !== 'functi
^
ReferenceError: window is not defined
at Object.../lib/index (/Users/pehrlich/leap/projects/leapjs/leap.js:6953:5)
at i (/Users/pehrlich/leap/projects/leapjs/leap.js:1:281)
at module.exports.pos (/Users/pehrlich/leap/projects/leapjs/leap.js:1:444)
at Object. (/Users/pehrlich/leap/projects/leapjs/leap.js:1:462)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
```

This particular code block inside of entry.js is used by controller.js only. https://github.com/leapmotion/leapjs/blob/master/lib/controller.js#L87-L96

This was not picked up by our node example, because it does not employ entry.js.

https://github.com/leapmotion/leapjs/blob/master/lib/controller.js#L87-L96

I would suggest a couple further things to prevent this from regressing:
- Move code out of entry.js and in to controller.js.
- Have node.js work with the compiled code, possibly. (This might not be worth it.)