{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/j2me.js/pulls/comments/27734536","id":27734536,"diff_hunk":"@@ -466,8 +490,10 @@ module J2ME {\n     }\n \n     start(frames: Frame[]) {\n-      frames.unshift(Frame.Start);\n-      this.frames = frames;\n+      this.frames = [Frame.Start];\n+      for (var i = 0; i < frames.length; i++) {\n+        this.pushFrame(frames[i]);\n+      }","path":"vm/context.ts","position":77,"original_position":77,"commit_id":"ce8654a4e21937c63b3fe3e96cee45885b3f5c75","original_commit_id":"ce8654a4e21937c63b3fe3e96cee45885b3f5c75","user":{"login":"mykmelez","id":305455,"avatar_url":"https://avatars.githubusercontent.com/u/305455?v=3","gravatar_id":"","url":"https://api.github.com/users/mykmelez","html_url":"https://github.com/mykmelez","followers_url":"https://api.github.com/users/mykmelez/followers","following_url":"https://api.github.com/users/mykmelez/following{/other_user}","gists_url":"https://api.github.com/users/mykmelez/gists{/gist_id}","starred_url":"https://api.github.com/users/mykmelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykmelez/subscriptions","organizations_url":"https://api.github.com/users/mykmelez/orgs","repos_url":"https://api.github.com/users/mykmelez/repos","events_url":"https://api.github.com/users/mykmelez/events{/privacy}","received_events_url":"https://api.github.com/users/mykmelez/received_events","type":"User","site_admin":false},"body":"I like this refactoring too, since it avoids side-effects in the caller. It does result in the allocation of an extra array, but this method seems unlikely to be hot, so I don't think it matters.\r\n\r\nNevertheless, note that *this.frames* is already initialized to a new empty array in the *Context* constructor, so you could initialize it to `[Frame.Start]` there and then merely push the *frames* onto it here.\r\n","created_at":"2015-04-03T15:15:00Z","updated_at":"2015-04-03T15:15:00Z","html_url":"https://github.com/mozilla/j2me.js/pull/1382#discussion_r27734536","pull_request_url":"https://api.github.com/repos/mozilla/j2me.js/pulls/1382","_links":{"self":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/comments/27734536"},"html":{"href":"https://github.com/mozilla/j2me.js/pull/1382#discussion_r27734536"},"pull_request":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/1382"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/j2me.js/pulls/1382","id":32536576,"html_url":"https://github.com/mozilla/j2me.js/pull/1382","diff_url":"https://github.com/mozilla/j2me.js/pull/1382.diff","patch_url":"https://github.com/mozilla/j2me.js/pull/1382.patch","issue_url":"https://api.github.com/repos/mozilla/j2me.js/issues/1382","number":1382,"state":"open","locked":false,"title":"Show profiles per thread and don't leave() on unwinds.","user":{"login":"brendandahl","id":942640,"avatar_url":"https://avatars.githubusercontent.com/u/942640?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandahl","html_url":"https://github.com/brendandahl","followers_url":"https://api.github.com/users/brendandahl/followers","following_url":"https://api.github.com/users/brendandahl/following{/other_user}","gists_url":"https://api.github.com/users/brendandahl/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandahl/subscriptions","organizations_url":"https://api.github.com/users/brendandahl/orgs","repos_url":"https://api.github.com/users/brendandahl/repos","events_url":"https://api.github.com/users/brendandahl/events{/privacy}","received_events_url":"https://api.github.com/users/brendandahl/received_events","type":"User","site_admin":false},"body":"Makes it easier to get the full picture of thread execution.  Some notes:\r\n\r\n- The profiler intercepts scroll events so to hack this so we can scroll down I added a \"bumper\" bar on the side so you can put your mouse there and scroll to see more of the threads.\r\n- We don't currently have a good way to track async natives. I currently just always leave() the native even during an unwind.  This will cause whatever called an async native to appear as if it has been executing for a long time. To make this better would require some further hacking on the timeline and our code.","created_at":"2015-04-02T18:21:00Z","updated_at":"2015-04-03T15:15:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40571bb4f44dbe0df286f2087b28c8ba444dd298","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/j2me.js/pulls/1382/commits","review_comments_url":"https://api.github.com/repos/mozilla/j2me.js/pulls/1382/comments","review_comment_url":"https://api.github.com/repos/mozilla/j2me.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/j2me.js/issues/1382/comments","statuses_url":"https://api.github.com/repos/mozilla/j2me.js/statuses/ce8654a4e21937c63b3fe3e96cee45885b3f5c75","head":{"label":"brendandahl:per-thread-timeline","ref":"per-thread-timeline","sha":"ce8654a4e21937c63b3fe3e96cee45885b3f5c75","user":{"login":"brendandahl","id":942640,"avatar_url":"https://avatars.githubusercontent.com/u/942640?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandahl","html_url":"https://github.com/brendandahl","followers_url":"https://api.github.com/users/brendandahl/followers","following_url":"https://api.github.com/users/brendandahl/following{/other_user}","gists_url":"https://api.github.com/users/brendandahl/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandahl/subscriptions","organizations_url":"https://api.github.com/users/brendandahl/orgs","repos_url":"https://api.github.com/users/brendandahl/repos","events_url":"https://api.github.com/users/brendandahl/events{/privacy}","received_events_url":"https://api.github.com/users/brendandahl/received_events","type":"User","site_admin":false},"repo":{"id":24194419,"name":"j2me.js","full_name":"brendandahl/j2me.js","owner":{"login":"brendandahl","id":942640,"avatar_url":"https://avatars.githubusercontent.com/u/942640?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandahl","html_url":"https://github.com/brendandahl","followers_url":"https://api.github.com/users/brendandahl/followers","following_url":"https://api.github.com/users/brendandahl/following{/other_user}","gists_url":"https://api.github.com/users/brendandahl/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandahl/subscriptions","organizations_url":"https://api.github.com/users/brendandahl/orgs","repos_url":"https://api.github.com/users/brendandahl/repos","events_url":"https://api.github.com/users/brendandahl/events{/privacy}","received_events_url":"https://api.github.com/users/brendandahl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brendandahl/j2me.js","description":"J2ME VM in JavaScript","fork":true,"url":"https://api.github.com/repos/brendandahl/j2me.js","forks_url":"https://api.github.com/repos/brendandahl/j2me.js/forks","keys_url":"https://api.github.com/repos/brendandahl/j2me.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brendandahl/j2me.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brendandahl/j2me.js/teams","hooks_url":"https://api.github.com/repos/brendandahl/j2me.js/hooks","issue_events_url":"https://api.github.com/repos/brendandahl/j2me.js/issues/events{/number}","events_url":"https://api.github.com/repos/brendandahl/j2me.js/events","assignees_url":"https://api.github.com/repos/brendandahl/j2me.js/assignees{/user}","branches_url":"https://api.github.com/repos/brendandahl/j2me.js/branches{/branch}","tags_url":"https://api.github.com/repos/brendandahl/j2me.js/tags","blobs_url":"https://api.github.com/repos/brendandahl/j2me.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brendandahl/j2me.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brendandahl/j2me.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/brendandahl/j2me.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brendandahl/j2me.js/statuses/{sha}","languages_url":"https://api.github.com/repos/brendandahl/j2me.js/languages","stargazers_url":"https://api.github.com/repos/brendandahl/j2me.js/stargazers","contributors_url":"https://api.github.com/repos/brendandahl/j2me.js/contributors","subscribers_url":"https://api.github.com/repos/brendandahl/j2me.js/subscribers","subscription_url":"https://api.github.com/repos/brendandahl/j2me.js/subscription","commits_url":"https://api.github.com/repos/brendandahl/j2me.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/brendandahl/j2me.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/brendandahl/j2me.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/brendandahl/j2me.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/brendandahl/j2me.js/contents/{+path}","compare_url":"https://api.github.com/repos/brendandahl/j2me.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brendandahl/j2me.js/merges","archive_url":"https://api.github.com/repos/brendandahl/j2me.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brendandahl/j2me.js/downloads","issues_url":"https://api.github.com/repos/brendandahl/j2me.js/issues{/number}","pulls_url":"https://api.github.com/repos/brendandahl/j2me.js/pulls{/number}","milestones_url":"https://api.github.com/repos/brendandahl/j2me.js/milestones{/number}","notifications_url":"https://api.github.com/repos/brendandahl/j2me.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brendandahl/j2me.js/labels{/name}","releases_url":"https://api.github.com/repos/brendandahl/j2me.js/releases{/id}","created_at":"2014-09-18T15:48:12Z","updated_at":"2015-02-12T00:25:10Z","pushed_at":"2015-04-02T23:50:54Z","git_url":"git://github.com/brendandahl/j2me.js.git","ssh_url":"git@github.com:brendandahl/j2me.js.git","clone_url":"https://github.com/brendandahl/j2me.js.git","svn_url":"https://github.com/brendandahl/j2me.js","homepage":null,"size":29090,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"1ddcbaa23a0b0a8f96c9a65f88a8efb318282a80","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":21724513,"name":"j2me.js","full_name":"mozilla/j2me.js","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/j2me.js","description":"J2ME VM in JavaScript","fork":false,"url":"https://api.github.com/repos/mozilla/j2me.js","forks_url":"https://api.github.com/repos/mozilla/j2me.js/forks","keys_url":"https://api.github.com/repos/mozilla/j2me.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/j2me.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/j2me.js/teams","hooks_url":"https://api.github.com/repos/mozilla/j2me.js/hooks","issue_events_url":"https://api.github.com/repos/mozilla/j2me.js/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/j2me.js/events","assignees_url":"https://api.github.com/repos/mozilla/j2me.js/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/j2me.js/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/j2me.js/tags","blobs_url":"https://api.github.com/repos/mozilla/j2me.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/j2me.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/j2me.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/j2me.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/j2me.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/j2me.js/languages","stargazers_url":"https://api.github.com/repos/mozilla/j2me.js/stargazers","contributors_url":"https://api.github.com/repos/mozilla/j2me.js/contributors","subscribers_url":"https://api.github.com/repos/mozilla/j2me.js/subscribers","subscription_url":"https://api.github.com/repos/mozilla/j2me.js/subscription","commits_url":"https://api.github.com/repos/mozilla/j2me.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/j2me.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/j2me.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/j2me.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/j2me.js/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/j2me.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/j2me.js/merges","archive_url":"https://api.github.com/repos/mozilla/j2me.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/j2me.js/downloads","issues_url":"https://api.github.com/repos/mozilla/j2me.js/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/j2me.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/j2me.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/j2me.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/j2me.js/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/j2me.js/releases{/id}","created_at":"2014-07-11T06:23:27Z","updated_at":"2015-04-03T01:01:45Z","pushed_at":"2015-04-03T14:51:37Z","git_url":"git://github.com/mozilla/j2me.js.git","ssh_url":"git@github.com:mozilla/j2me.js.git","clone_url":"https://github.com/mozilla/j2me.js.git","svn_url":"https://github.com/mozilla/j2me.js","homepage":null,"size":38025,"stargazers_count":68,"watchers_count":68,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":197,"forks":20,"open_issues":197,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/1382"},"html":{"href":"https://github.com/mozilla/j2me.js/pull/1382"},"issue":{"href":"https://api.github.com/repos/mozilla/j2me.js/issues/1382"},"comments":{"href":"https://api.github.com/repos/mozilla/j2me.js/issues/1382/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/1382/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/j2me.js/pulls/1382/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/j2me.js/statuses/ce8654a4e21937c63b3fe3e96cee45885b3f5c75"}}}}