Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/bugsnag: implement own polyfilling for requestAnimationFrame #75

Closed
wants to merge 2 commits into from

Conversation

kyrylo
Copy link

@kyrylo kyrylo commented Sep 5, 2014

Fixes #72 (requestAnimationFrame wrapper doesn't honor the passed
timestamp)

The old approach rely on hijackTimeFunc, which expects a callback to
accept at least two arguments. If the function being wrapped accepts
only argument, it is being swallowed.

Tested manually on IE 6,7,8,9,10, and modern Chrome.

Fixes #72 (`requestAnimationFrame` wrapper doesn't honor the passed
timestamp)

The old approach rely on `hijackTimeFunc`, which expects a callback to
accept at least two arguments. If the function being wrapped accepts
only argument, it is being swallowed.
}
};
});

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctly me if I'm wrong, but I think the following is the equivalent, but much less code;

polyFill(window, "requestAnimationFrame", function (_super) {
  return function (callback) {
    if (typeof callback === "function") {
      callback = wrap(callback);
    }
    return _super(callback);
  };
});

@kyrylo kyrylo force-pushed the 72-fix-requestanimframe branch from 9c4a19a to 88b31be Compare September 5, 2014 08:25
@kyrylo kyrylo closed this Sep 5, 2014
kattrali pushed a commit that referenced this pull request Apr 22, 2021
Upload cucumber failure logs when tests fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants