Closed matthewp closed 8 years ago
It's possible #2 would work on it's own. Even if code does override globals, it eventually does have to call something asynchronous, so eventually one of our globals would be used (global.Promise might be overridden but underlying that it would use MutationObserver). It's worth giving a shot.
Closed by #63
@justinbmeyer today mentioned an alternative implementation. Want to break down the current implementation and compare it to the other, to discuss their strengths and weaknesses.
1. Wrap when each task is run
This is how it is currently implemented. Each time a Task is run we setup the globals and after the Task completes we restore the original values.
Strength
This is important so that we can ensure all Tasks run within a Zone.
Weakness
2. Wrap at execution time only
This would be if the wrapping only happen
Strength
Weakness
3. Both?
I think this is probably possible, use method 1 to ensure our versions are the outer layer of the onion and method 2 to ensure local references are covered.