{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/75552768","id":75552768,"diff_hunk":"@@ -28,11 +29,16 @@ function setupProcessWarnings() {\n \n   // process.emitWarning(error)\n   // process.emitWarning(str[, name][, ctor])\n-  process.emitWarning = function(warning, name, ctor) {\n+  // process.emitWarning(str[, name][, ctor][, warned])\n+  process.emitWarning = function(warning, name, ctor, warned) {\n     if (typeof name === 'function') {\n       ctor = name;\n       name = 'Warning';\n     }\n+    if (typeof arguments[arguments.length - 1] === 'boolean') {\n+      warned = arguments[arguments.length - 1];\n+    }","path":"lib/internal/process/warning.js","position":21,"original_position":21,"commit_id":"30509161ffa788c2a4b7beff5f3b63da057c06c0","original_commit_id":"30509161ffa788c2a4b7beff5f3b63da057c06c0","user":{"login":"jasnell","id":439929,"avatar_url":"https://avatars.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"body":"Perhaps something like...\r\n\r\n```js\r\nwarned = Boolean(arguments.length >= 4 ?\r\n    arguments[3] :\r\n    arguments[arguments.length - 1]);\r\n```\r\n\r\nThis would allow any truthy value to be passed as the `warned` and would protect against devs passing in extra arguments, e.g. `emitWarning(msg, 'DeprecationWarning', undefined, true, 0)`. The additional arguments at the end would be ignored.\r\n","created_at":"2016-08-19T21:17:29Z","updated_at":"2016-08-19T21:17:29Z","html_url":"https://github.com/nodejs/node/pull/8184#discussion_r75552768","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/8184","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/75552768"},"html":{"href":"https://github.com/nodejs/node/pull/8184#discussion_r75552768"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/8184"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/8184","id":82008009,"html_url":"https://github.com/nodejs/node/pull/8184","diff_url":"https://github.com/nodejs/node/pull/8184.diff","patch_url":"https://github.com/nodejs/node/pull/8184.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/8184","number":8184,"state":"open","locked":false,"title":"process: add the optional `once` to `emitWarning`","user":{"login":"yorkie","id":1935767,"avatar_url":"https://avatars.githubusercontent.com/u/1935767?v=3","gravatar_id":"","url":"https://api.github.com/users/yorkie","html_url":"https://github.com/yorkie","followers_url":"https://api.github.com/users/yorkie/followers","following_url":"https://api.github.com/users/yorkie/following{/other_user}","gists_url":"https://api.github.com/users/yorkie/gists{/gist_id}","starred_url":"https://api.github.com/users/yorkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yorkie/subscriptions","organizations_url":"https://api.github.com/users/yorkie/orgs","repos_url":"https://api.github.com/users/yorkie/repos","events_url":"https://api.github.com/users/yorkie/events{/privacy}","received_events_url":"https://api.github.com/users/yorkie/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for your pull request. Please review below requirements.\r\n\r\nBug fixes and new features should include tests and possibly benchmarks.\r\n\r\nContributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test nosign` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows commit guidelines\r\n\r\n##### Affected core subsystem(s)\r\n<!-- Provide affected core subsystem(s) (like doc, cluster, crypto, etc). -->\r\nprocess\r\n\r\n##### Description of change\r\n<!-- Provide a description of the change below this comment. -->\r\n\r\nImproves the method `process.emitWarning()` to simplify the avoiding\r\nduplicate warnings.\r\n\r\nThis also introduces a new property `warnings` on the `process` object.\r\n\r\n_What's the reason to this pull-request?_ Recently I did find some pull-requests which hard-deprecates functions which always needs another variable to avoid duplicating warnings as https://nodejs.org/dist/latest-v6.x/docs/api/process.html#process_avoiding_duplicate_warnings. This patch simplifies the above progress.\r\n\r\nIf this change is acceptable widely, I'm also able to gonna update relevant calls in other modules.\r\n","created_at":"2016-08-19T16:24:50Z","updated_at":"2016-08-19T21:17:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd35c91f0ee362dc10e8d9e5c06373367171b5da","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/8184/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/8184/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/8184/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/30509161ffa788c2a4b7beff5f3b63da057c06c0","head":{"label":"yorkie:improve/emitWarning","ref":"improve/emitWarning","sha":"30509161ffa788c2a4b7beff5f3b63da057c06c0","user":{"login":"yorkie","id":1935767,"avatar_url":"https://avatars.githubusercontent.com/u/1935767?v=3","gravatar_id":"","url":"https://api.github.com/users/yorkie","html_url":"https://github.com/yorkie","followers_url":"https://api.github.com/users/yorkie/followers","following_url":"https://api.github.com/users/yorkie/following{/other_user}","gists_url":"https://api.github.com/users/yorkie/gists{/gist_id}","starred_url":"https://api.github.com/users/yorkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yorkie/subscriptions","organizations_url":"https://api.github.com/users/yorkie/orgs","repos_url":"https://api.github.com/users/yorkie/repos","events_url":"https://api.github.com/users/yorkie/events{/privacy}","received_events_url":"https://api.github.com/users/yorkie/received_events","type":"User","site_admin":false},"repo":{"id":40772284,"name":"node","full_name":"yorkie/node","owner":{"login":"yorkie","id":1935767,"avatar_url":"https://avatars.githubusercontent.com/u/1935767?v=3","gravatar_id":"","url":"https://api.github.com/users/yorkie","html_url":"https://github.com/yorkie","followers_url":"https://api.github.com/users/yorkie/followers","following_url":"https://api.github.com/users/yorkie/following{/other_user}","gists_url":"https://api.github.com/users/yorkie/gists{/gist_id}","starred_url":"https://api.github.com/users/yorkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yorkie/subscriptions","organizations_url":"https://api.github.com/users/yorkie/orgs","repos_url":"https://api.github.com/users/yorkie/repos","events_url":"https://api.github.com/users/yorkie/events{/privacy}","received_events_url":"https://api.github.com/users/yorkie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yorkie/node","description":"Future Node.js releases will be from this repo.","fork":true,"url":"https://api.github.com/repos/yorkie/node","forks_url":"https://api.github.com/repos/yorkie/node/forks","keys_url":"https://api.github.com/repos/yorkie/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yorkie/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yorkie/node/teams","hooks_url":"https://api.github.com/repos/yorkie/node/hooks","issue_events_url":"https://api.github.com/repos/yorkie/node/issues/events{/number}","events_url":"https://api.github.com/repos/yorkie/node/events","assignees_url":"https://api.github.com/repos/yorkie/node/assignees{/user}","branches_url":"https://api.github.com/repos/yorkie/node/branches{/branch}","tags_url":"https://api.github.com/repos/yorkie/node/tags","blobs_url":"https://api.github.com/repos/yorkie/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yorkie/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yorkie/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/yorkie/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yorkie/node/statuses/{sha}","languages_url":"https://api.github.com/repos/yorkie/node/languages","stargazers_url":"https://api.github.com/repos/yorkie/node/stargazers","contributors_url":"https://api.github.com/repos/yorkie/node/contributors","subscribers_url":"https://api.github.com/repos/yorkie/node/subscribers","subscription_url":"https://api.github.com/repos/yorkie/node/subscription","commits_url":"https://api.github.com/repos/yorkie/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/yorkie/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/yorkie/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/yorkie/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/yorkie/node/contents/{+path}","compare_url":"https://api.github.com/repos/yorkie/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yorkie/node/merges","archive_url":"https://api.github.com/repos/yorkie/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yorkie/node/downloads","issues_url":"https://api.github.com/repos/yorkie/node/issues{/number}","pulls_url":"https://api.github.com/repos/yorkie/node/pulls{/number}","milestones_url":"https://api.github.com/repos/yorkie/node/milestones{/number}","notifications_url":"https://api.github.com/repos/yorkie/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yorkie/node/labels{/name}","releases_url":"https://api.github.com/repos/yorkie/node/releases{/id}","deployments_url":"https://api.github.com/repos/yorkie/node/deployments","created_at":"2015-08-15T16:54:25Z","updated_at":"2015-08-15T16:54:29Z","pushed_at":"2016-08-19T20:21:06Z","git_url":"git://github.com/yorkie/node.git","ssh_url":"git@github.com:yorkie/node.git","clone_url":"https://github.com/yorkie/node.git","svn_url":"https://github.com/yorkie/node","homepage":"https://iojs.org","size":206935,"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":"nodejs:master","ref":"master","sha":"76007079ec866317c0119b1f4526d0f67b3998fc","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2016-08-19T20:49:45Z","pushed_at":"2016-08-19T21:04:28Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":291278,"stargazers_count":25892,"watchers_count":25892,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3987,"mirror_url":null,"open_issues_count":748,"forks":3987,"open_issues":748,"watchers":25892,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/8184"},"html":{"href":"https://github.com/nodejs/node/pull/8184"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/8184"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/8184/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/8184/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/8184/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/30509161ffa788c2a4b7beff5f3b63da057c06c0"}}}}
{"actor":{"display_login":"jasnell"}}