You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot find any uses of the Chain.disable API outside of the tests in this package. It is unnecessary complexity. Removing the functionality may also remove some of the overhead from this package since we can omit a boolean check and reading a zone variable for every zone callback.
No real opinion on removing the behavior. Sure, go for it!
The implementation looks potentially unsafe. If you disable stack chaining using this function, then start a new stack chaining inside it, then the value won't be correct. (It will enable the outer stack chaining zone as well).
The test, if anything, should be if (!identical(this, zone[Chain._specKey])) return parent.registerCallback(zone, f);,
and then you don't need the extra boolean zone-variable.
(Don't read Zone.current in a zone callback, always use the zone parameter. A subzone might have chosen to change that argument deliberately.)
I cannot find any uses of the
Chain.disable
API outside of the tests in this package. It is unnecessary complexity. Removing the functionality may also remove some of the overhead from this package since we can omit a boolean check and reading a zone variable for every zone callback.Any concerns @jakemac53 @lrhn ?
The text was updated successfully, but these errors were encountered: