{"action":"created","comment":{"url":"https://api.github.com/repos/chaijs/chai/pulls/comments/81530321","pull_request_review_id":2503128,"id":81530321,"diff_hunk":"@@ -537,8 +537,8 @@ module.exports = function (chai, _) {\n         itemsCount = val.length;\n         break;\n       case 'function':\n-        var name = val.name ? ' ' + val.name : '';\n-        throw new TypeError('.empty was passed a function' + name);\n+        var msg = '.empty was passed a function ' + _.getName(val);\n+        throw new TypeError(msg.trim());","path":"lib/chai/core/assertions.js","position":7,"original_position":7,"commit_id":"5af5e519397cb155204548073e3bfe0aa85a38da","original_commit_id":"5af5e519397cb155204548073e3bfe0aa85a38da","user":{"login":"meeber","id":17260989,"avatar_url":"https://avatars.githubusercontent.com/u/17260989?v=3","gravatar_id":"","url":"https://api.github.com/users/meeber","html_url":"https://github.com/meeber","followers_url":"https://api.github.com/users/meeber/followers","following_url":"https://api.github.com/users/meeber/following{/other_user}","gists_url":"https://api.github.com/users/meeber/gists{/gist_id}","starred_url":"https://api.github.com/users/meeber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meeber/subscriptions","organizations_url":"https://api.github.com/users/meeber/orgs","repos_url":"https://api.github.com/users/meeber/repos","events_url":"https://api.github.com/users/meeber/events{/privacy}","received_events_url":"https://api.github.com/users/meeber/received_events","type":"User","site_admin":false},"body":"The `trim` in this case isn't being used because `getName` might return a string with spaces on the end (as far as I can tell it wouldn't) but rather because if `getName` returned an empty string then the `msg` that's being constructed on line 540 would have a space on the end. In other words, the `trim` would still be needed here even if `getName` did it itself.","created_at":"2016-10-03T11:09:38Z","updated_at":"2016-10-03T11:09:38Z","html_url":"https://github.com/chaijs/chai/pull/813#discussion_r81530321","pull_request_url":"https://api.github.com/repos/chaijs/chai/pulls/813","_links":{"self":{"href":"https://api.github.com/repos/chaijs/chai/pulls/comments/81530321"},"html":{"href":"https://github.com/chaijs/chai/pull/813#discussion_r81530321"},"pull_request":{"href":"https://api.github.com/repos/chaijs/chai/pulls/813"}}},"pull_request":{"url":"https://api.github.com/repos/chaijs/chai/pulls/813","id":87638995,"html_url":"https://github.com/chaijs/chai/pull/813","diff_url":"https://github.com/chaijs/chai/pull/813.diff","patch_url":"https://github.com/chaijs/chai/pull/813.patch","issue_url":"https://api.github.com/repos/chaijs/chai/issues/813","number":813,"state":"closed","locked":false,"title":"Make `utils.getName` more robust & use it in `empty`","user":{"login":"shvaikalesh","id":5098878,"avatar_url":"https://avatars.githubusercontent.com/u/5098878?v=3","gravatar_id":"","url":"https://api.github.com/users/shvaikalesh","html_url":"https://github.com/shvaikalesh","followers_url":"https://api.github.com/users/shvaikalesh/followers","following_url":"https://api.github.com/users/shvaikalesh/following{/other_user}","gists_url":"https://api.github.com/users/shvaikalesh/gists{/gist_id}","starred_url":"https://api.github.com/users/shvaikalesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shvaikalesh/subscriptions","organizations_url":"https://api.github.com/users/shvaikalesh/orgs","repos_url":"https://api.github.com/users/shvaikalesh/repos","events_url":"https://api.github.com/users/shvaikalesh/events{/privacy}","received_events_url":"https://api.github.com/users/shvaikalesh/received_events","type":"User","site_admin":false},"body":"Current ponyfill routine does not handle `toString` defined on functions. That is kinda rare, but does not take much effort to support. Beware, proposed \"fix\" will throw on non-functions (is that desirable?). Also, added basic tests for `getName`.","created_at":"2016-10-02T16:44:32Z","updated_at":"2016-10-03T11:09:38Z","closed_at":"2016-10-02T19:57:40Z","merged_at":"2016-10-02T19:57:40Z","merge_commit_sha":"fdd0f8cffe8933273114e0216f2b785ea48fa7f2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/chaijs/chai/pulls/813/commits","review_comments_url":"https://api.github.com/repos/chaijs/chai/pulls/813/comments","review_comment_url":"https://api.github.com/repos/chaijs/chai/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chaijs/chai/issues/813/comments","statuses_url":"https://api.github.com/repos/chaijs/chai/statuses/5af5e519397cb155204548073e3bfe0aa85a38da","head":{"label":"shvaikalesh:use-get-name","ref":"use-get-name","sha":"5af5e519397cb155204548073e3bfe0aa85a38da","user":{"login":"shvaikalesh","id":5098878,"avatar_url":"https://avatars.githubusercontent.com/u/5098878?v=3","gravatar_id":"","url":"https://api.github.com/users/shvaikalesh","html_url":"https://github.com/shvaikalesh","followers_url":"https://api.github.com/users/shvaikalesh/followers","following_url":"https://api.github.com/users/shvaikalesh/following{/other_user}","gists_url":"https://api.github.com/users/shvaikalesh/gists{/gist_id}","starred_url":"https://api.github.com/users/shvaikalesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shvaikalesh/subscriptions","organizations_url":"https://api.github.com/users/shvaikalesh/orgs","repos_url":"https://api.github.com/users/shvaikalesh/repos","events_url":"https://api.github.com/users/shvaikalesh/events{/privacy}","received_events_url":"https://api.github.com/users/shvaikalesh/received_events","type":"User","site_admin":false},"repo":null},"base":{"label":"chaijs:master","ref":"master","sha":"5b170b2e3bae6e918ef723c168668d829d7bc61b","user":{"login":"chaijs","id":1515293,"avatar_url":"https://avatars.githubusercontent.com/u/1515293?v=3","gravatar_id":"","url":"https://api.github.com/users/chaijs","html_url":"https://github.com/chaijs","followers_url":"https://api.github.com/users/chaijs/followers","following_url":"https://api.github.com/users/chaijs/following{/other_user}","gists_url":"https://api.github.com/users/chaijs/gists{/gist_id}","starred_url":"https://api.github.com/users/chaijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaijs/subscriptions","organizations_url":"https://api.github.com/users/chaijs/orgs","repos_url":"https://api.github.com/users/chaijs/repos","events_url":"https://api.github.com/users/chaijs/events{/privacy}","received_events_url":"https://api.github.com/users/chaijs/received_events","type":"Organization","site_admin":false},"repo":{"id":2931111,"name":"chai","full_name":"chaijs/chai","owner":{"login":"chaijs","id":1515293,"avatar_url":"https://avatars.githubusercontent.com/u/1515293?v=3","gravatar_id":"","url":"https://api.github.com/users/chaijs","html_url":"https://github.com/chaijs","followers_url":"https://api.github.com/users/chaijs/followers","following_url":"https://api.github.com/users/chaijs/following{/other_user}","gists_url":"https://api.github.com/users/chaijs/gists{/gist_id}","starred_url":"https://api.github.com/users/chaijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaijs/subscriptions","organizations_url":"https://api.github.com/users/chaijs/orgs","repos_url":"https://api.github.com/users/chaijs/repos","events_url":"https://api.github.com/users/chaijs/events{/privacy}","received_events_url":"https://api.github.com/users/chaijs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chaijs/chai","description":"BDD / TDD assertion framework for node.js and the browser that can be paired with any testing framework.","fork":false,"url":"https://api.github.com/repos/chaijs/chai","forks_url":"https://api.github.com/repos/chaijs/chai/forks","keys_url":"https://api.github.com/repos/chaijs/chai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chaijs/chai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chaijs/chai/teams","hooks_url":"https://api.github.com/repos/chaijs/chai/hooks","issue_events_url":"https://api.github.com/repos/chaijs/chai/issues/events{/number}","events_url":"https://api.github.com/repos/chaijs/chai/events","assignees_url":"https://api.github.com/repos/chaijs/chai/assignees{/user}","branches_url":"https://api.github.com/repos/chaijs/chai/branches{/branch}","tags_url":"https://api.github.com/repos/chaijs/chai/tags","blobs_url":"https://api.github.com/repos/chaijs/chai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chaijs/chai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chaijs/chai/git/refs{/sha}","trees_url":"https://api.github.com/repos/chaijs/chai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chaijs/chai/statuses/{sha}","languages_url":"https://api.github.com/repos/chaijs/chai/languages","stargazers_url":"https://api.github.com/repos/chaijs/chai/stargazers","contributors_url":"https://api.github.com/repos/chaijs/chai/contributors","subscribers_url":"https://api.github.com/repos/chaijs/chai/subscribers","subscription_url":"https://api.github.com/repos/chaijs/chai/subscription","commits_url":"https://api.github.com/repos/chaijs/chai/commits{/sha}","git_commits_url":"https://api.github.com/repos/chaijs/chai/git/commits{/sha}","comments_url":"https://api.github.com/repos/chaijs/chai/comments{/number}","issue_comment_url":"https://api.github.com/repos/chaijs/chai/issues/comments{/number}","contents_url":"https://api.github.com/repos/chaijs/chai/contents/{+path}","compare_url":"https://api.github.com/repos/chaijs/chai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chaijs/chai/merges","archive_url":"https://api.github.com/repos/chaijs/chai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chaijs/chai/downloads","issues_url":"https://api.github.com/repos/chaijs/chai/issues{/number}","pulls_url":"https://api.github.com/repos/chaijs/chai/pulls{/number}","milestones_url":"https://api.github.com/repos/chaijs/chai/milestones{/number}","notifications_url":"https://api.github.com/repos/chaijs/chai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chaijs/chai/labels{/name}","releases_url":"https://api.github.com/repos/chaijs/chai/releases{/id}","deployments_url":"https://api.github.com/repos/chaijs/chai/deployments","created_at":"2011-12-07T08:06:35Z","updated_at":"2016-10-03T04:32:09Z","pushed_at":"2016-10-03T11:05:50Z","git_url":"git://github.com/chaijs/chai.git","ssh_url":"git@github.com:chaijs/chai.git","clone_url":"https://github.com/chaijs/chai.git","svn_url":"https://github.com/chaijs/chai","homepage":"http://chaijs.com","size":3638,"stargazers_count":3375,"watchers_count":3375,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":314,"mirror_url":null,"open_issues_count":26,"forks":314,"open_issues":26,"watchers":3375,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chaijs/chai/pulls/813"},"html":{"href":"https://github.com/chaijs/chai/pull/813"},"issue":{"href":"https://api.github.com/repos/chaijs/chai/issues/813"},"comments":{"href":"https://api.github.com/repos/chaijs/chai/issues/813/comments"},"review_comments":{"href":"https://api.github.com/repos/chaijs/chai/pulls/813/comments"},"review_comment":{"href":"https://api.github.com/repos/chaijs/chai/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chaijs/chai/pulls/813/commits"},"statuses":{"href":"https://api.github.com/repos/chaijs/chai/statuses/5af5e519397cb155204548073e3bfe0aa85a38da"}}}}
{"actor":{"display_login":"meeber"}}