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
fix(zone.js): make sure fakeasync use the same id pool with native #54600
Conversation
fa13986
to
1dfcd17
Compare
nativeSetTimeout: (global.setTimeout as any)[Zone.__symbol__('OriginalDelegate')], | ||
nativeClearTimeout: (global.clearTimeout as any)[Zone.__symbol__('OriginalDelegate')], |
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 these two lines rather be the following:
nativeSetTimeout: global[Zone.__symbol__('setTimeout')],
nativeClearTimeout: global[Zone.__symbol__('clearTimeout')],
If setTimeout
or clearTimeout
is patched again outside of zone.js
but after the patching done by zone.js
, the OriginalDelegate
symbols will most likely be missing on these functions, so grabbing them from global
seems safer.
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.
@JiaLiPassion Can you address this comment as well? I believe this is accurate and would be correct. The line where the unpatched methods are assigned directly to global
is here:
angular/packages/zone.js/lib/common/utils.ts
Line 403 in ee3bb81
delegate = proto[delegateName] = proto[name]; |
@JiaLiPassion if you could rebase this, and I think the comment about multiple patches is accurate. |
3291c9b
to
b157845
Compare
Close angular#54323 fakeAsync should use the same timerId pool with native, so they will not conflict.
b157845
to
403a113
Compare
@jonathan-meier |
caretaker note: sync will require patching in these changes to the 3 failing tests in TGP cl/619480497 |
As mentioned in angular#54600 (comment) a more effective way of getting the unpatched version of a zone-patched API is to grab it from global[Zone.__symbol__('apiname')].
As mentioned in angular#54600 (comment) a more effective way of getting the unpatched version of a zone-patched API is to grab it from global[Zone.__symbol__('apiname')].
This PR was merged into the repository by commit ddbf6bb. |
As mentioned in angular#54600 (comment) a more effective way of getting the unpatched version of a zone-patched API is to grab it from global[Zone.__symbol__('apiname')].
As mentioned in angular#54600 (comment) a more effective way of getting the unpatched version of a zone-patched API is to grab it from global[Zone.__symbol__('apiname')].
As mentioned in angular#54600 (comment) a more effective way of getting the unpatched version of a zone-patched API is to grab it from global[Zone.__symbol__('apiname')].
Thank you all for the help in landing this fix! It seems to work great so far 👍 |
…55092) As mentioned in #54600 (comment) a more effective way of getting the unpatched version of a zone-patched API is to grab it from global[Zone.__symbol__('apiname')]. PR Close #55092
…ngular#54600) Close angular#54323 fakeAsync should use the same timerId pool with native, so they will not conflict. PR Close angular#54600
…ngular#55092) As mentioned in angular#54600 (comment) a more effective way of getting the unpatched version of a zone-patched API is to grab it from global[Zone.__symbol__('apiname')]. PR Close angular#55092
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Close #54323
fakeAsync should use the same timerId pool with native, so they will not conflict.