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

Updated timers for limited execution environment #1522

Merged
merged 1 commit into from
Jul 31, 2015
Merged

Updated timers for limited execution environment #1522

merged 1 commit into from
Jul 31, 2015

Conversation

schmuli
Copy link
Contributor

@schmuli schmuli commented Jul 28, 2015

In limited execution environments the setTimeout/clearTimeout functions
need to be delegated to, rather than stored as references.

This is a follow up to #1519

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@schmuli
Copy link
Contributor Author

schmuli commented Jul 28, 2015

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

timer: ['value', {setTimeout: setTimeout, clearTimeout: clearTimeout}]
timer: ['value', {
setTimeout: function () { return setTimeout.apply(root, arguments)},
clearTimeout: function (timeoutId) { clearTimeout(timeoutId)}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be applied as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

setTimeout has variables args, whereas clearTimeout only ever receives a single arg. I can change it if you think this is less consistent.

@dignifiedquire
Copy link
Member

Thanks, can you please squash your commits and change the commit message to follow our convention.

In limited execution environments the setTimeout/clearTimeout functions
need to be delegated to, rather than stored as references, otherwise an
Illegal Invocation error is thrown by the runtime.

Closes #1519
@dignifiedquire
Copy link
Member

Thanks :octocat:

dignifiedquire added a commit that referenced this pull request Jul 31, 2015
Updated timers for limited execution environment
@dignifiedquire dignifiedquire merged commit 69cd909 into karma-runner:master Jul 31, 2015
@schmuli schmuli deleted the fix-timers branch November 7, 2015 22:16
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.

3 participants