chrisdickinson / raf

requestAnimationFrame polyfill library
MIT License
742 stars 54 forks source link

Add raf.polyfill #30

Closed caseyWebb closed 8 years ago

CMTegner commented 8 years ago

Thanks! My only gripe with this change is that it doesn't polyfill global in a node environment. Perhaps global = typeof window === 'undefined' ? {} : window should be expanded to also check the actual global object (the variable will probably have to be renamed).

ljharb commented 8 years ago

I'm not sure what you mean - global will work in node, and browserify/webpack will make the same work in browsers.

caseyWebb commented 8 years ago

global is a local var here that hides node's global

ljharb commented 8 years ago

aha, that's a good point. We shouldn't have a local variable named "global".

caseyWebb commented 8 years ago

shabam :tada:

CMTegner commented 8 years ago

Good stuff! Published to npm as 3.2.0.