{"action":"created","comment":{"url":"https://api.github.com/repos/angular/zone.js/pulls/comments/30873139","id":30873139,"diff_hunk":"@@ -11,6 +11,24 @@ describe('Zone', function () {\n     expect(zone.fork().$id).toBeGreaterThan(zone.$id);\n   });\n \n+  it('should be possible to override the auto-generated id', function () {\n+    zone.fork({'$id': 'test'}).run(function () {\n+      expect(zone.$id).toEqual('test');\n+    });\n+  });\n+\n+  it('should return the full path', function () {\n+    Zone.nextId = 2;\n+\n+    zone.fork().run(function () {\n+      zone.fork({'$id': 'foo'}).run(function () {","path":"test/zone.spec.js","position":14,"original_position":14,"commit_id":"42d2e49189a9128c7f3b94ce8a88ee98d8e944cc","original_commit_id":"42d2e49189a9128c7f3b94ce8a88ee98d8e944cc","user":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=3","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"body":"if you let people override $id, they could set it to 1, which could cause\nall kinds of issues.\n\nhow about zone.fork([label], [options])?\n\nso you would use it as:\n\nzone.fork('myZone', {...})\n\nI've also had a discussion with Misko about making custom zone installation\na different operation from forking, that would resolve this problem as well.\n\nOn Thu, May 21, 2015 at 11:36 PM Victor Berchet <notifications@github.com>\nwrote:\n\n> In test/zone.spec.js\n> <https://github.com/angular/zone.js/pull/120#discussion_r30872178>:\n>\n> > @@ -11,6 +11,24 @@ describe('Zone', function () {\n> >      expect(zone.fork().$id).toBeGreaterThan(zone.$id);\n> >    });\n> >\n> > +  it('should be possible to override the auto-generated id', function () {\n> > +    zone.fork({'$id': 'test'}).run(function () {\n> > +      expect(zone.$id).toEqual('test');\n> > +    });\n> > +  });\n> > +\n> > +  it('should return the full path', function () {\n> > +    Zone.nextId = 2;\n> > +\n> > +    zone.fork().run(function () {\n> > +      zone.fork({'$id': 'foo'}).run(function () {\n>\n> I've pick $id because:\n>\n>    - we get the id via $id why not use the same mechanism to set it ?\n>    - IMO the property name has to be \"special\", because you can set any\n>    value on a zone and name is certainly too generic and it would be easy\n>    to shoot yourself in a foot. I think it has to have some kind of\n>    escaping/prefix\n>\n> Also $id is already kind of special, it changes for any new zone.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/angular/zone.js/pull/120/files#r30872178>.\n>\n","created_at":"2015-05-22T07:04:21Z","updated_at":"2015-05-22T07:04:21Z","html_url":"https://github.com/angular/zone.js/pull/120#discussion_r30873139","pull_request_url":"https://api.github.com/repos/angular/zone.js/pulls/120","_links":{"self":{"href":"https://api.github.com/repos/angular/zone.js/pulls/comments/30873139"},"html":{"href":"https://github.com/angular/zone.js/pull/120#discussion_r30873139"},"pull_request":{"href":"https://api.github.com/repos/angular/zone.js/pulls/120"}}},"pull_request":{"url":"https://api.github.com/repos/angular/zone.js/pulls/120","id":35822595,"html_url":"https://github.com/angular/zone.js/pull/120","diff_url":"https://github.com/angular/zone.js/pull/120.diff","patch_url":"https://github.com/angular/zone.js/pull/120.patch","issue_url":"https://api.github.com/repos/angular/zone.js/issues/120","number":120,"state":"open","locked":false,"title":"feat(zone): ability to override $id + full path","user":{"login":"vicb","id":248818,"avatar_url":"https://avatars.githubusercontent.com/u/248818?v=3","gravatar_id":"","url":"https://api.github.com/users/vicb","html_url":"https://github.com/vicb","followers_url":"https://api.github.com/users/vicb/followers","following_url":"https://api.github.com/users/vicb/following{/other_user}","gists_url":"https://api.github.com/users/vicb/gists{/gist_id}","starred_url":"https://api.github.com/users/vicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicb/subscriptions","organizations_url":"https://api.github.com/users/vicb/orgs","repos_url":"https://api.github.com/users/vicb/repos","events_url":"https://api.github.com/users/vicb/events{/privacy}","received_events_url":"https://api.github.com/users/vicb/received_events","type":"User","site_admin":false},"body":"fix #45","created_at":"2015-05-20T11:36:54Z","updated_at":"2015-05-22T07:04:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ee697cbcfc81305cd3577f8e0251f46385b9747","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/angular/zone.js/pulls/120/commits","review_comments_url":"https://api.github.com/repos/angular/zone.js/pulls/120/comments","review_comment_url":"https://api.github.com/repos/angular/zone.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/zone.js/issues/120/comments","statuses_url":"https://api.github.com/repos/angular/zone.js/statuses/42d2e49189a9128c7f3b94ce8a88ee98d8e944cc","head":{"label":"vicb:0520-id","ref":"0520-id","sha":"42d2e49189a9128c7f3b94ce8a88ee98d8e944cc","user":{"login":"vicb","id":248818,"avatar_url":"https://avatars.githubusercontent.com/u/248818?v=3","gravatar_id":"","url":"https://api.github.com/users/vicb","html_url":"https://github.com/vicb","followers_url":"https://api.github.com/users/vicb/followers","following_url":"https://api.github.com/users/vicb/following{/other_user}","gists_url":"https://api.github.com/users/vicb/gists{/gist_id}","starred_url":"https://api.github.com/users/vicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicb/subscriptions","organizations_url":"https://api.github.com/users/vicb/orgs","repos_url":"https://api.github.com/users/vicb/repos","events_url":"https://api.github.com/users/vicb/events{/privacy}","received_events_url":"https://api.github.com/users/vicb/received_events","type":"User","site_admin":false},"repo":{"id":32878252,"name":"zone.js","full_name":"vicb/zone.js","owner":{"login":"vicb","id":248818,"avatar_url":"https://avatars.githubusercontent.com/u/248818?v=3","gravatar_id":"","url":"https://api.github.com/users/vicb","html_url":"https://github.com/vicb","followers_url":"https://api.github.com/users/vicb/followers","following_url":"https://api.github.com/users/vicb/following{/other_user}","gists_url":"https://api.github.com/users/vicb/gists{/gist_id}","starred_url":"https://api.github.com/users/vicb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vicb/subscriptions","organizations_url":"https://api.github.com/users/vicb/orgs","repos_url":"https://api.github.com/users/vicb/repos","events_url":"https://api.github.com/users/vicb/events{/privacy}","received_events_url":"https://api.github.com/users/vicb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vicb/zone.js","description":"Implements Zones for JavaScript","fork":true,"url":"https://api.github.com/repos/vicb/zone.js","forks_url":"https://api.github.com/repos/vicb/zone.js/forks","keys_url":"https://api.github.com/repos/vicb/zone.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vicb/zone.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vicb/zone.js/teams","hooks_url":"https://api.github.com/repos/vicb/zone.js/hooks","issue_events_url":"https://api.github.com/repos/vicb/zone.js/issues/events{/number}","events_url":"https://api.github.com/repos/vicb/zone.js/events","assignees_url":"https://api.github.com/repos/vicb/zone.js/assignees{/user}","branches_url":"https://api.github.com/repos/vicb/zone.js/branches{/branch}","tags_url":"https://api.github.com/repos/vicb/zone.js/tags","blobs_url":"https://api.github.com/repos/vicb/zone.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vicb/zone.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vicb/zone.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/vicb/zone.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vicb/zone.js/statuses/{sha}","languages_url":"https://api.github.com/repos/vicb/zone.js/languages","stargazers_url":"https://api.github.com/repos/vicb/zone.js/stargazers","contributors_url":"https://api.github.com/repos/vicb/zone.js/contributors","subscribers_url":"https://api.github.com/repos/vicb/zone.js/subscribers","subscription_url":"https://api.github.com/repos/vicb/zone.js/subscription","commits_url":"https://api.github.com/repos/vicb/zone.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/vicb/zone.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/vicb/zone.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/vicb/zone.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/vicb/zone.js/contents/{+path}","compare_url":"https://api.github.com/repos/vicb/zone.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vicb/zone.js/merges","archive_url":"https://api.github.com/repos/vicb/zone.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vicb/zone.js/downloads","issues_url":"https://api.github.com/repos/vicb/zone.js/issues{/number}","pulls_url":"https://api.github.com/repos/vicb/zone.js/pulls{/number}","milestones_url":"https://api.github.com/repos/vicb/zone.js/milestones{/number}","notifications_url":"https://api.github.com/repos/vicb/zone.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vicb/zone.js/labels{/name}","releases_url":"https://api.github.com/repos/vicb/zone.js/releases{/id}","created_at":"2015-03-25T16:54:03Z","updated_at":"2015-04-30T21:00:25Z","pushed_at":"2015-05-22T06:27:27Z","git_url":"git://github.com/vicb/zone.js.git","ssh_url":"git@github.com:vicb/zone.js.git","clone_url":"https://github.com/vicb/zone.js.git","svn_url":"https://github.com/vicb/zone.js","homepage":"https://github.com/angular/zone.js","size":801,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"8bce00ee44cd869f3f61d6d7a9cdf5928cfdd1bc","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":15467734,"name":"zone.js","full_name":"angular/zone.js","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/zone.js","description":"Implements Zones for JavaScript","fork":false,"url":"https://api.github.com/repos/angular/zone.js","forks_url":"https://api.github.com/repos/angular/zone.js/forks","keys_url":"https://api.github.com/repos/angular/zone.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/zone.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/zone.js/teams","hooks_url":"https://api.github.com/repos/angular/zone.js/hooks","issue_events_url":"https://api.github.com/repos/angular/zone.js/issues/events{/number}","events_url":"https://api.github.com/repos/angular/zone.js/events","assignees_url":"https://api.github.com/repos/angular/zone.js/assignees{/user}","branches_url":"https://api.github.com/repos/angular/zone.js/branches{/branch}","tags_url":"https://api.github.com/repos/angular/zone.js/tags","blobs_url":"https://api.github.com/repos/angular/zone.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/zone.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/zone.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/zone.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/zone.js/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/zone.js/languages","stargazers_url":"https://api.github.com/repos/angular/zone.js/stargazers","contributors_url":"https://api.github.com/repos/angular/zone.js/contributors","subscribers_url":"https://api.github.com/repos/angular/zone.js/subscribers","subscription_url":"https://api.github.com/repos/angular/zone.js/subscription","commits_url":"https://api.github.com/repos/angular/zone.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/zone.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/zone.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/zone.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/zone.js/contents/{+path}","compare_url":"https://api.github.com/repos/angular/zone.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/zone.js/merges","archive_url":"https://api.github.com/repos/angular/zone.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/zone.js/downloads","issues_url":"https://api.github.com/repos/angular/zone.js/issues{/number}","pulls_url":"https://api.github.com/repos/angular/zone.js/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/zone.js/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/zone.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/zone.js/labels{/name}","releases_url":"https://api.github.com/repos/angular/zone.js/releases{/id}","created_at":"2013-12-27T06:08:07Z","updated_at":"2015-05-21T14:34:21Z","pushed_at":"2015-05-22T06:28:39Z","git_url":"git://github.com/angular/zone.js.git","ssh_url":"git@github.com:angular/zone.js.git","clone_url":"https://github.com/angular/zone.js.git","svn_url":"https://github.com/angular/zone.js","homepage":"https://github.com/angular/zone.js","size":1672,"stargazers_count":722,"watchers_count":722,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":35,"forks":52,"open_issues":35,"watchers":722,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/zone.js/pulls/120"},"html":{"href":"https://github.com/angular/zone.js/pull/120"},"issue":{"href":"https://api.github.com/repos/angular/zone.js/issues/120"},"comments":{"href":"https://api.github.com/repos/angular/zone.js/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/zone.js/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/zone.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/zone.js/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/angular/zone.js/statuses/42d2e49189a9128c7f3b94ce8a88ee98d8e944cc"}}}}