Skip to content

fix(zone.js): clearTimeout/clearInterval should call on object global#37858

Closed
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:native-bind
Closed

fix(zone.js): clearTimeout/clearInterval should call on object global#37858
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:native-bind

Conversation

@JiaLiPassion
Copy link
Copy Markdown
Contributor

Close #37333

clearTimeout is patched by zone.js, and it finally calls the native version of clearTimeout,
the current implemention only call clearNative(id), but it should call on object global like
clearNative.call(global, id). Otherwise in some env, it will throw error
clearTimeout called on an object that does not implement interface Window

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: 37333

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@JiaLiPassion JiaLiPassion requested a review from mhevery June 30, 2020 21:16
@JiaLiPassion JiaLiPassion added area: zones Issues related to zone.js target: patch This PR is targeted for the next patch release labels Jul 1, 2020
@ngbot ngbot Bot modified the milestone: needsTriage Jul 1, 2020
Comment thread packages/zone.js/lib/common/timers.ts Outdated
@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Jul 15, 2020

presubmit

Close angular#37333

`clearTimeout` is patched by `zone.js`, and it finally calls the native delegate of `clearTimeout`,
the current implemention only call `clearNative(id)`, but it should call on object `global` like
`clearNative.call(global, id)`. Otherwise in some env, it will throw error
`clearTimeout called on an object that does not implement interface Window`
@mhevery mhevery added the action: merge The PR is ready for merge by the caretaker label Jul 24, 2020
@mhevery mhevery closed this in a71f114 Jul 24, 2020
mhevery pushed a commit that referenced this pull request Jul 24, 2020
…#37858)

Close #37333

`clearTimeout` is patched by `zone.js`, and it finally calls the native delegate of `clearTimeout`,
the current implemention only call `clearNative(id)`, but it should call on object `global` like
`clearNative.call(global, id)`. Otherwise in some env, it will throw error
`clearTimeout called on an object that does not implement interface Window`

PR Close #37858
Splaktar pushed a commit to angular-hispano/angular that referenced this pull request Aug 8, 2020
…angular#37858)

Close angular#37333

`clearTimeout` is patched by `zone.js`, and it finally calls the native delegate of `clearTimeout`,
the current implemention only call `clearNative(id)`, but it should call on object `global` like
`clearNative.call(global, id)`. Otherwise in some env, it will throw error
`clearTimeout called on an object that does not implement interface Window`

PR Close angular#37858
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Aug 24, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
…angular#37858)

Close angular#37333

`clearTimeout` is patched by `zone.js`, and it finally calls the native delegate of `clearTimeout`,
the current implemention only call `clearNative(id)`, but it should call on object `global` like
`clearNative.call(global, id)`. Otherwise in some env, it will throw error
`clearTimeout called on an object that does not implement interface Window`

PR Close angular#37858
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: zones Issues related to zone.js cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Firefox content script does not allow clearTimeout and clearInterval to be called in a non-global context

4 participants