michaelvillar / dynamics.js

Javascript library to create physics-based animations
http://dynamicsjs.com
7.57k stars 414 forks source link

Dynamics.js Uncaught TypeError for arguments.callee in strict mode. #23

Closed djfrsn closed 8 years ago

djfrsn commented 8 years ago

Hello Michael,

I've run into an issue using Dynamics.js in React component's with strict mode and ES6 classes. Using methods such as spring which use arguments.callee.defaults throw TypeErrors's. To solve this, I change the arguments.callee to the following format(dynamics.methodName.defaults) in order to avoid errors in my project. Is this something you would be interested in changing or having a pull request for?

Error Message: Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them

Example Solution for 'spring' method: applyDefaults(options, arguments.callee.defaults); now applyDefaults(options, dynamics.spring.defaults);

Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments/callee

michaelvillar commented 8 years ago

A pull request would be awesome! Would love better ES6 support!

djfrsn commented 8 years ago

Ok cool, I'll do that!