-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
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! |
CLAs look good, thanks! |
timer: ['value', {setTimeout: setTimeout, clearTimeout: clearTimeout}] | ||
timer: ['value', { | ||
setTimeout: function () { return setTimeout.apply(root, arguments)}, | ||
clearTimeout: function (timeoutId) { clearTimeout(timeoutId)} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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
Thanks |
Updated timers for limited execution environment
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