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

feat(Zone): check global for rootZoneSpec #521

Closed
wants to merge 4 commits into from

Conversation

hmdhk
Copy link
Contributor

@hmdhk hmdhk commented Nov 25, 2016

closes #513

@JiaLiPassion
Copy link
Collaborator

As described in comment of #513, I am not sure my thinking is correct or not, but I think we shouldn't allow access ZoneSpec at any level.

Copy link
Collaborator

@JiaLiPassion JiaLiPassion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

const symbolRootZoneSpec = '__rootZoneSpec__'
var rootZone: Zone = new Zone(null, null);
if (global[symbolRootZoneSpec]) {
rootZone = <Zone>rootZone.fork(global[symbolRootZoneSpec]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we delete the rootZoneSpec after create rootZone?

 const symbolRootZoneSpec = '__rootZoneSpec__'
 var rootZone: Zone = new Zone(null, null);
 if (global[symbolRootZoneSpec]) {
   rootZone = <Zone>rootZone.fork(global[symbolRootZoneSpec]);
   delete global[symbolRootZoneSpec];
 }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should so that we don't clutter global space.
I can't see any reason not to.

@@ -952,7 +952,14 @@ const Zone: ZoneType = (function(global: any) {
const symbolPromise = __symbol__('Promise');
const symbolThen = __symbol__('then');

let _currentZoneFrame = new ZoneFrame(null, new Zone(null, null));
const symbolRootZoneSpec = '__rootZoneSpec__'
var rootZone: Zone = new Zone(null, null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use let instead of var

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@hmdhk
Copy link
Contributor Author

hmdhk commented Dec 5, 2016

Could you please rerun the tests on travis?
I'm not sure what is causing the failure.

@JiaLiPassion
Copy link
Collaborator

Sorry, I have no permission to rerun the test on travis, the error seems to be timeout, it should be ok to run again, in your PR, a ';' is missing in line 955, maybe you can commit the ';' and it will trigger a new travis test run.

@@ -952,7 +952,14 @@ const Zone: ZoneType = (function(global: any) {
const symbolPromise = __symbol__('Promise');
const symbolThen = __symbol__('then');

let _currentZoneFrame = new ZoneFrame(null, new Zone(null, null));
const symbolRootZoneSpec = '__rootZoneSpec__'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more, missing ';' here.

@JiaLiPassion
Copy link
Collaborator

JiaLiPassion commented Dec 5, 2016

The build should be ok now, to trigger tavis build again without adding more useless commit, you may rollback your commit by

git reset HEAD~1

and redo the last change (add semicolon) and commit again.

@hmdhk hmdhk force-pushed the feat-root-zone-spec branch from be8c7d6 to f8ffd60 Compare December 6, 2016 12:00
@hmdhk
Copy link
Contributor Author

hmdhk commented Dec 6, 2016

just rebased, tests are passing now. can we merge this one?

@mhevery
Copy link
Contributor

mhevery commented Dec 18, 2016

Sorry, but this is by design. RootZone should be indistinguishable for no zone at all. This requirement is here so that if we standardize the Zones in TC39, the browser vendors will not have to pay the cost for all of the applications. All zones must be entered explicitly.

@mhevery mhevery closed this Dec 18, 2016
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.

Configuring Root zone
4 participants