{"action":"created","comment":{"url":"https://api.github.com/repos/mochajs/mocha/pulls/comments/27284278","id":27284278,"diff_hunk":"@@ -168,11 +168,17 @@ exports.list = function(failures){\n     var err = test.err\n       , message = err.message || ''\n       , stack = err.stack || message\n-      , index = stack.indexOf(message) + message.length\n-      , msg = stack.slice(0, index)\n+      , index = stack.indexOf(message)\n       , actual = err.actual\n       , expected = err.expected\n       , escape = true;\n+    if (index === -1) {\n+      msg = message;\n+    } else {\n+      index += message.length;\n+      msg = stack.slice(0, index);\n+      stack = stack.slice(index + 1)","path":"lib/reporters/base.js","position":null,"original_position":15,"commit_id":"7efdd38410d3a6ed6a1154f7a52bc23ac75eec26","original_commit_id":"52dcc9b0b4c03d9221773d57dea464631bca65bf","user":{"login":"mantoni","id":332271,"avatar_url":"https://avatars.githubusercontent.com/u/332271?v=3","gravatar_id":"","url":"https://api.github.com/users/mantoni","html_url":"https://github.com/mantoni","followers_url":"https://api.github.com/users/mantoni/followers","following_url":"https://api.github.com/users/mantoni/following{/other_user}","gists_url":"https://api.github.com/users/mantoni/gists{/gist_id}","starred_url":"https://api.github.com/users/mantoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantoni/subscriptions","organizations_url":"https://api.github.com/users/mantoni/orgs","repos_url":"https://api.github.com/users/mantoni/repos","events_url":"https://api.github.com/users/mantoni/events{/privacy}","received_events_url":"https://api.github.com/users/mantoni/received_events","type":"User","site_admin":false},"body":"Oh yes, thank you. I removed the `stack.slice` call at line 208, added a missing `;` and fixed the code doc. Please have another look.","created_at":"2015-03-27T09:49:51Z","updated_at":"2015-03-27T09:49:51Z","html_url":"https://github.com/mochajs/mocha/pull/1631#discussion_r27284278","pull_request_url":"https://api.github.com/repos/mochajs/mocha/pulls/1631","_links":{"self":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/comments/27284278"},"html":{"href":"https://github.com/mochajs/mocha/pull/1631#discussion_r27284278"},"pull_request":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/1631"}}},"pull_request":{"url":"https://api.github.com/repos/mochajs/mocha/pulls/1631","id":32073200,"html_url":"https://github.com/mochajs/mocha/pull/1631","diff_url":"https://github.com/mochajs/mocha/pull/1631.diff","patch_url":"https://github.com/mochajs/mocha/pull/1631.patch","issue_url":"https://api.github.com/repos/mochajs/mocha/issues/1631","number":1631,"state":"open","locked":false,"title":"fix(reporter/base): don't assume error message is first line of stack","user":{"login":"mantoni","id":332271,"avatar_url":"https://avatars.githubusercontent.com/u/332271?v=3","gravatar_id":"","url":"https://api.github.com/users/mantoni","html_url":"https://github.com/mantoni","followers_url":"https://api.github.com/users/mantoni/followers","following_url":"https://api.github.com/users/mantoni/following{/other_user}","gists_url":"https://api.github.com/users/mantoni/gists{/gist_id}","starred_url":"https://api.github.com/users/mantoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantoni/subscriptions","organizations_url":"https://api.github.com/users/mantoni/orgs","repos_url":"https://api.github.com/users/mantoni/repos","events_url":"https://api.github.com/users/mantoni/events{/privacy}","received_events_url":"https://api.github.com/users/mantoni/received_events","type":"User","site_admin":false},"body":"The current implementation assumes that the first line of the err.stack is the error message. This is not the case for Safari. When using Mocha with a different HTML generator (e.g. Consolify) this produces weirdly formatted output with no error message.\r\n\r\nI don't know how to come up with a test case for this. Please advise if there is anything I can provide.\r\nThe attached screenshot was produced with `mochify --consolify runner.html`.\r\n\r\n![stacktrace](https://cloud.githubusercontent.com/assets/332271/6859707/6e322108-d41c-11e4-93b9-72a0a32ed6aa.png)\r\n","created_at":"2015-03-27T00:00:07Z","updated_at":"2015-03-27T09:49:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17c70a4d6d776fc9c4658fecce48a8655f36f528","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mochajs/mocha/pulls/1631/commits","review_comments_url":"https://api.github.com/repos/mochajs/mocha/pulls/1631/comments","review_comment_url":"https://api.github.com/repos/mochajs/mocha/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mochajs/mocha/issues/1631/comments","statuses_url":"https://api.github.com/repos/mochajs/mocha/statuses/7efdd38410d3a6ed6a1154f7a52bc23ac75eec26","head":{"label":"mantoni:fix-safari-consolify","ref":"fix-safari-consolify","sha":"7efdd38410d3a6ed6a1154f7a52bc23ac75eec26","user":{"login":"mantoni","id":332271,"avatar_url":"https://avatars.githubusercontent.com/u/332271?v=3","gravatar_id":"","url":"https://api.github.com/users/mantoni","html_url":"https://github.com/mantoni","followers_url":"https://api.github.com/users/mantoni/followers","following_url":"https://api.github.com/users/mantoni/following{/other_user}","gists_url":"https://api.github.com/users/mantoni/gists{/gist_id}","starred_url":"https://api.github.com/users/mantoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantoni/subscriptions","organizations_url":"https://api.github.com/users/mantoni/orgs","repos_url":"https://api.github.com/users/mantoni/repos","events_url":"https://api.github.com/users/mantoni/events{/privacy}","received_events_url":"https://api.github.com/users/mantoni/received_events","type":"User","site_admin":false},"repo":{"id":32949518,"name":"mocha","full_name":"mantoni/mocha","owner":{"login":"mantoni","id":332271,"avatar_url":"https://avatars.githubusercontent.com/u/332271?v=3","gravatar_id":"","url":"https://api.github.com/users/mantoni","html_url":"https://github.com/mantoni","followers_url":"https://api.github.com/users/mantoni/followers","following_url":"https://api.github.com/users/mantoni/following{/other_user}","gists_url":"https://api.github.com/users/mantoni/gists{/gist_id}","starred_url":"https://api.github.com/users/mantoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantoni/subscriptions","organizations_url":"https://api.github.com/users/mantoni/orgs","repos_url":"https://api.github.com/users/mantoni/repos","events_url":"https://api.github.com/users/mantoni/events{/privacy}","received_events_url":"https://api.github.com/users/mantoni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mantoni/mocha","description":"mocha - simple, flexible, fun javascript test framework for node.js & the browser. (BDD, TDD, QUnit styles via interfaces)","fork":true,"url":"https://api.github.com/repos/mantoni/mocha","forks_url":"https://api.github.com/repos/mantoni/mocha/forks","keys_url":"https://api.github.com/repos/mantoni/mocha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantoni/mocha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantoni/mocha/teams","hooks_url":"https://api.github.com/repos/mantoni/mocha/hooks","issue_events_url":"https://api.github.com/repos/mantoni/mocha/issues/events{/number}","events_url":"https://api.github.com/repos/mantoni/mocha/events","assignees_url":"https://api.github.com/repos/mantoni/mocha/assignees{/user}","branches_url":"https://api.github.com/repos/mantoni/mocha/branches{/branch}","tags_url":"https://api.github.com/repos/mantoni/mocha/tags","blobs_url":"https://api.github.com/repos/mantoni/mocha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantoni/mocha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantoni/mocha/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantoni/mocha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantoni/mocha/statuses/{sha}","languages_url":"https://api.github.com/repos/mantoni/mocha/languages","stargazers_url":"https://api.github.com/repos/mantoni/mocha/stargazers","contributors_url":"https://api.github.com/repos/mantoni/mocha/contributors","subscribers_url":"https://api.github.com/repos/mantoni/mocha/subscribers","subscription_url":"https://api.github.com/repos/mantoni/mocha/subscription","commits_url":"https://api.github.com/repos/mantoni/mocha/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantoni/mocha/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantoni/mocha/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantoni/mocha/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantoni/mocha/contents/{+path}","compare_url":"https://api.github.com/repos/mantoni/mocha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantoni/mocha/merges","archive_url":"https://api.github.com/repos/mantoni/mocha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantoni/mocha/downloads","issues_url":"https://api.github.com/repos/mantoni/mocha/issues{/number}","pulls_url":"https://api.github.com/repos/mantoni/mocha/pulls{/number}","milestones_url":"https://api.github.com/repos/mantoni/mocha/milestones{/number}","notifications_url":"https://api.github.com/repos/mantoni/mocha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantoni/mocha/labels{/name}","releases_url":"https://api.github.com/repos/mantoni/mocha/releases{/id}","created_at":"2015-03-26T20:13:27Z","updated_at":"2015-03-26T20:13:28Z","pushed_at":"2015-03-27T09:49:04Z","git_url":"git://github.com/mantoni/mocha.git","ssh_url":"git@github.com:mantoni/mocha.git","clone_url":"https://github.com/mantoni/mocha.git","svn_url":"https://github.com/mantoni/mocha","homepage":"http://mochajs.org","size":13057,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mochajs:master","ref":"master","sha":"ec6440ebbc886668bb1ed81f35a15beba8aefdfa","user":{"login":"mochajs","id":8770005,"avatar_url":"https://avatars.githubusercontent.com/u/8770005?v=3","gravatar_id":"","url":"https://api.github.com/users/mochajs","html_url":"https://github.com/mochajs","followers_url":"https://api.github.com/users/mochajs/followers","following_url":"https://api.github.com/users/mochajs/following{/other_user}","gists_url":"https://api.github.com/users/mochajs/gists{/gist_id}","starred_url":"https://api.github.com/users/mochajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mochajs/subscriptions","organizations_url":"https://api.github.com/users/mochajs/orgs","repos_url":"https://api.github.com/users/mochajs/repos","events_url":"https://api.github.com/users/mochajs/events{/privacy}","received_events_url":"https://api.github.com/users/mochajs/received_events","type":"Organization","site_admin":false},"repo":{"id":1451352,"name":"mocha","full_name":"mochajs/mocha","owner":{"login":"mochajs","id":8770005,"avatar_url":"https://avatars.githubusercontent.com/u/8770005?v=3","gravatar_id":"","url":"https://api.github.com/users/mochajs","html_url":"https://github.com/mochajs","followers_url":"https://api.github.com/users/mochajs/followers","following_url":"https://api.github.com/users/mochajs/following{/other_user}","gists_url":"https://api.github.com/users/mochajs/gists{/gist_id}","starred_url":"https://api.github.com/users/mochajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mochajs/subscriptions","organizations_url":"https://api.github.com/users/mochajs/orgs","repos_url":"https://api.github.com/users/mochajs/repos","events_url":"https://api.github.com/users/mochajs/events{/privacy}","received_events_url":"https://api.github.com/users/mochajs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mochajs/mocha","description":"mocha - simple, flexible, fun javascript test framework for node.js & the browser. (BDD, TDD, QUnit styles via interfaces)","fork":false,"url":"https://api.github.com/repos/mochajs/mocha","forks_url":"https://api.github.com/repos/mochajs/mocha/forks","keys_url":"https://api.github.com/repos/mochajs/mocha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mochajs/mocha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mochajs/mocha/teams","hooks_url":"https://api.github.com/repos/mochajs/mocha/hooks","issue_events_url":"https://api.github.com/repos/mochajs/mocha/issues/events{/number}","events_url":"https://api.github.com/repos/mochajs/mocha/events","assignees_url":"https://api.github.com/repos/mochajs/mocha/assignees{/user}","branches_url":"https://api.github.com/repos/mochajs/mocha/branches{/branch}","tags_url":"https://api.github.com/repos/mochajs/mocha/tags","blobs_url":"https://api.github.com/repos/mochajs/mocha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mochajs/mocha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mochajs/mocha/git/refs{/sha}","trees_url":"https://api.github.com/repos/mochajs/mocha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mochajs/mocha/statuses/{sha}","languages_url":"https://api.github.com/repos/mochajs/mocha/languages","stargazers_url":"https://api.github.com/repos/mochajs/mocha/stargazers","contributors_url":"https://api.github.com/repos/mochajs/mocha/contributors","subscribers_url":"https://api.github.com/repos/mochajs/mocha/subscribers","subscription_url":"https://api.github.com/repos/mochajs/mocha/subscription","commits_url":"https://api.github.com/repos/mochajs/mocha/commits{/sha}","git_commits_url":"https://api.github.com/repos/mochajs/mocha/git/commits{/sha}","comments_url":"https://api.github.com/repos/mochajs/mocha/comments{/number}","issue_comment_url":"https://api.github.com/repos/mochajs/mocha/issues/comments{/number}","contents_url":"https://api.github.com/repos/mochajs/mocha/contents/{+path}","compare_url":"https://api.github.com/repos/mochajs/mocha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mochajs/mocha/merges","archive_url":"https://api.github.com/repos/mochajs/mocha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mochajs/mocha/downloads","issues_url":"https://api.github.com/repos/mochajs/mocha/issues{/number}","pulls_url":"https://api.github.com/repos/mochajs/mocha/pulls{/number}","milestones_url":"https://api.github.com/repos/mochajs/mocha/milestones{/number}","notifications_url":"https://api.github.com/repos/mochajs/mocha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mochajs/mocha/labels{/name}","releases_url":"https://api.github.com/repos/mochajs/mocha/releases{/id}","created_at":"2011-03-07T18:44:25Z","updated_at":"2015-03-27T04:31:24Z","pushed_at":"2015-03-27T09:49:06Z","git_url":"git://github.com/mochajs/mocha.git","ssh_url":"git@github.com:mochajs/mocha.git","clone_url":"https://github.com/mochajs/mocha.git","svn_url":"https://github.com/mochajs/mocha","homepage":"http://mochajs.org","size":13057,"stargazers_count":6294,"watchers_count":6294,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1015,"mirror_url":null,"open_issues_count":151,"forks":1015,"open_issues":151,"watchers":6294,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/1631"},"html":{"href":"https://github.com/mochajs/mocha/pull/1631"},"issue":{"href":"https://api.github.com/repos/mochajs/mocha/issues/1631"},"comments":{"href":"https://api.github.com/repos/mochajs/mocha/issues/1631/comments"},"review_comments":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/1631/comments"},"review_comment":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mochajs/mocha/pulls/1631/commits"},"statuses":{"href":"https://api.github.com/repos/mochajs/mocha/statuses/7efdd38410d3a6ed6a1154f7a52bc23ac75eec26"}}}}