Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix issue 538, currentZone in all hook methods will not be correct if… #539

Merged
merged 1 commit into from Dec 18, 2016

Conversation

JiaLiPassion
Copy link
Collaborator

based on issue #538, all hook methods will pass wrong currentZone if the zonespec has no hook method but the parent Zone spec has.

the issue can be described as following case.

 var zone = Zone.current;
      var zoneA = zone.fork({
        name: 'A',
        onInvoke: function(parentDelegate, currentZone, targetZone, callback, applyThis, applyArgs, source) {
          expect(currentZone.name).toEqual('A');
          return parentDelegate.invoke(targetZone, callback, applyThis, applyArgs, source);
        }
      });
      var zoneB = zoneA.fork({
        name: 'B',
        onInvoke: function(parentDelegate, currentZone, targetZone, callback, applyThis, applyArgs, source) {
          expect(currentZone.name).toEqual('B');
          return parentDelegate.invoke(targetZone, callback, applyThis, applyArgs, source);
        }
      });
      var zoneC = zoneB.fork({
        name: 'C'
      });
      zoneC.run(function() {
      });

@JiaLiPassion JiaLiPassion changed the title fix issue 538, currentzone in all hook methods will not be corrent if… fix issue 538, currentZone in all hook methods will not be correct if… Dec 15, 2016
@mhevery
Copy link
Contributor

mhevery commented Dec 18, 2016

Very nice work!

@mhevery mhevery merged commit dc12d8e into angular:master Dec 18, 2016
@JiaLiPassion JiaLiPassion deleted the issue-587 branch December 19, 2016 00:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants