greensock / GSAP

GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web
https://gsap.com
19.83k stars 1.72k forks source link

TypeError: Constructor Animation requires 'new' [Firefox 50.1] #185

Closed lisovskyvlad closed 7 years ago

lisovskyvlad commented 7 years ago

Hallo, thanks for good library.

I found a problem which is only for Firefox.

TypeError: Constructor Animation requires 'new'.

It happens at line 560 of TweenLine.js https://github.com/greensock/GreenSock-JS/blob/master/src/uncompressed/TweenLite.js#L560

switch (l) {
  case 0: callback.call(scope); break;
  case 1: callback.call(scope, params[0]); break;
  case 2: callback.call(scope, params[0], params[1]); break;
  default: callback.apply(scope, params);
}
jackdoyle commented 7 years ago

Hm, it sounds like perhaps a problem in your callback. Do you have a reduced test case we could peek at? A codepen or jsfiddle would be perfect.

lisovskyvlad commented 7 years ago

Yeah, sorry for this issue, it was my problem. Don't know why but I named one variable upcase as Animation, and may be js thinks that it`s class/function. Thanks!

jackdoyle commented 7 years ago

Cool, thanks for letting us know.