julianshapiro / velocity

Accelerated JavaScript animation.
VelocityJS.org
MIT License
17.29k stars 1.56k forks source link

Unexpected error when in non-strict mode and slideUp/slideDown redirects are involved #761

Closed futpib closed 7 years ago

futpib commented 7 years ago

Originally reproduced in IE9, though I expect it to reproduce wherever strict mode is not supported.

Steps to reproduce

  1. Run in no-strict-mode environment
  2. Velocity.Promise is set to a Promise A+ implementation
  3. Code:
    const element = document.createElement('div');
    Velocity(element, 'slideDown').then(function () {
    console.log('resolved');
    }, function (e) {
    console.log('rejected', e);
    });

    Expected

    Prints 'resolved' (or 'rejected' if something went wrong)

    Actual

    Prints (in IE9)

    Velocity: First argument ([object HTMLDivElement]) was not a property map, a known action, or a registered redirect. Aborting.

Debugging thoughts

Rycochet commented 7 years ago

I've got a strong feeling that's (supposed to have) been fixed in the latest release - can you just check what version of Velocity you're running against?

futpib commented 7 years ago

1.4.3, latest available on npm. Should I check against master?

futpib commented 7 years ago

Also #757 is somewhat related (the Type.isWrapped(windows) part of this issue)

Rycochet commented 7 years ago

@futpib Nope, that's cool - they're currently the same - drat, looks like I need to spend more time on IE9 too - hoping to get some time to look at the various obsolete IE issues over the weekend...

futpib commented 7 years ago

Just checked that #757 fixes this indeed.

futpib commented 7 years ago

I guess this had nothing to do with promise rejection propagation