{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/122451748","pull_request_review_id":44571665,"id":122451748,"diff_hunk":"@@ -2993,6 +2994,74 @@ support it:\n * If the function is not available, provide an alternate implementation\n   that does not use the function.\n \n+## Promises\n+\n+Promises facilitate the construction of chains of asynchronous actions each of\n+which hinges on the outcome of the previous.\n+\n+### napi_create_promise\n+<!-- YAML\n+added: v8.1.2","path":"doc/api/n-api.md","position":19,"original_position":19,"commit_id":"c53a6f8c83ac430e181e30700dedccf821d6919c","original_commit_id":"c53a6f8c83ac430e181e30700dedccf821d6919c","user":{"login":"addaleax","id":899444,"avatar_url":"https://avatars1.githubusercontent.com/u/899444?v=3","gravatar_id":"","url":"https://api.github.com/users/addaleax","html_url":"https://github.com/addaleax","followers_url":"https://api.github.com/users/addaleax/followers","following_url":"https://api.github.com/users/addaleax/following{/other_user}","gists_url":"https://api.github.com/users/addaleax/gists{/gist_id}","starred_url":"https://api.github.com/users/addaleax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addaleax/subscriptions","organizations_url":"https://api.github.com/users/addaleax/orgs","repos_url":"https://api.github.com/users/addaleax/repos","events_url":"https://api.github.com/users/addaleax/events{/privacy}","received_events_url":"https://api.github.com/users/addaleax/received_events","type":"User","site_admin":false},"body":"Can you use `added: REPLACEME` here (and below)?","created_at":"2017-06-16T14:16:58Z","updated_at":"2017-06-16T14:26:31Z","html_url":"https://github.com/nodejs/node/pull/13717#discussion_r122451748","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/13717","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/122451748"},"html":{"href":"https://github.com/nodejs/node/pull/13717#discussion_r122451748"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/13717"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/13717","id":126042403,"html_url":"https://github.com/nodejs/node/pull/13717","diff_url":"https://github.com/nodejs/node/pull/13717.diff","patch_url":"https://github.com/nodejs/node/pull/13717.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/13717","number":13717,"state":"open","locked":false,"title":"N-API: Implement Promise","user":{"login":"gabrielschulhof","id":976081,"avatar_url":"https://avatars1.githubusercontent.com/u/976081?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielschulhof","html_url":"https://github.com/gabrielschulhof","followers_url":"https://api.github.com/users/gabrielschulhof/followers","following_url":"https://api.github.com/users/gabrielschulhof/following{/other_user}","gists_url":"https://api.github.com/users/gabrielschulhof/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielschulhof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielschulhof/subscriptions","organizations_url":"https://api.github.com/users/gabrielschulhof/orgs","repos_url":"https://api.github.com/users/gabrielschulhof/repos","events_url":"https://api.github.com/users/gabrielschulhof/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielschulhof/received_events","type":"User","site_admin":false},"body":"`napi_create_promise()` creates a promise object and returns the resolve\r\nand reject callbacks as JS functions which can be called with\r\n`napi_call_function()`, passing a `napi_value` as the sole parameter to\r\nindicate the resolution of the promise resp. the reason for rejection.\r\n\r\n`napi_is_promise()` is a type check API returning `true` if the value\r\npassed in is a promise, and `false` otherwise.\r\n\r\nFixes https://github.com/nodejs/abi-stable-node/issues/242\r\n\r\n<!--\r\nThank you for your pull request. Please provide a description above and review\r\nthe requirements below.\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` (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](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines)\r\n\r\n##### Affected core subsystem(s)\r\n<!-- Provide affected core subsystem(s) (like doc, cluster, crypto, etc). -->\r\nN-API","created_at":"2017-06-16T14:15:16Z","updated_at":"2017-06-16T14:26:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3bffdcb9eb6678ff38f55015b18205c2c8dde2c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/13717/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/13717/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/13717/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/c53a6f8c83ac430e181e30700dedccf821d6919c","head":{"label":"gabrielschulhof:napi-promise","ref":"napi-promise","sha":"c53a6f8c83ac430e181e30700dedccf821d6919c","user":{"login":"gabrielschulhof","id":976081,"avatar_url":"https://avatars1.githubusercontent.com/u/976081?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielschulhof","html_url":"https://github.com/gabrielschulhof","followers_url":"https://api.github.com/users/gabrielschulhof/followers","following_url":"https://api.github.com/users/gabrielschulhof/following{/other_user}","gists_url":"https://api.github.com/users/gabrielschulhof/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielschulhof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielschulhof/subscriptions","organizations_url":"https://api.github.com/users/gabrielschulhof/orgs","repos_url":"https://api.github.com/users/gabrielschulhof/repos","events_url":"https://api.github.com/users/gabrielschulhof/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielschulhof/received_events","type":"User","site_admin":false},"repo":{"id":87114255,"name":"node","full_name":"gabrielschulhof/node","owner":{"login":"gabrielschulhof","id":976081,"avatar_url":"https://avatars1.githubusercontent.com/u/976081?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielschulhof","html_url":"https://github.com/gabrielschulhof","followers_url":"https://api.github.com/users/gabrielschulhof/followers","following_url":"https://api.github.com/users/gabrielschulhof/following{/other_user}","gists_url":"https://api.github.com/users/gabrielschulhof/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielschulhof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielschulhof/subscriptions","organizations_url":"https://api.github.com/users/gabrielschulhof/orgs","repos_url":"https://api.github.com/users/gabrielschulhof/repos","events_url":"https://api.github.com/users/gabrielschulhof/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielschulhof/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabrielschulhof/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/gabrielschulhof/node","forks_url":"https://api.github.com/repos/gabrielschulhof/node/forks","keys_url":"https://api.github.com/repos/gabrielschulhof/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabrielschulhof/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabrielschulhof/node/teams","hooks_url":"https://api.github.com/repos/gabrielschulhof/node/hooks","issue_events_url":"https://api.github.com/repos/gabrielschulhof/node/issues/events{/number}","events_url":"https://api.github.com/repos/gabrielschulhof/node/events","assignees_url":"https://api.github.com/repos/gabrielschulhof/node/assignees{/user}","branches_url":"https://api.github.com/repos/gabrielschulhof/node/branches{/branch}","tags_url":"https://api.github.com/repos/gabrielschulhof/node/tags","blobs_url":"https://api.github.com/repos/gabrielschulhof/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabrielschulhof/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabrielschulhof/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabrielschulhof/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabrielschulhof/node/statuses/{sha}","languages_url":"https://api.github.com/repos/gabrielschulhof/node/languages","stargazers_url":"https://api.github.com/repos/gabrielschulhof/node/stargazers","contributors_url":"https://api.github.com/repos/gabrielschulhof/node/contributors","subscribers_url":"https://api.github.com/repos/gabrielschulhof/node/subscribers","subscription_url":"https://api.github.com/repos/gabrielschulhof/node/subscription","commits_url":"https://api.github.com/repos/gabrielschulhof/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabrielschulhof/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabrielschulhof/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabrielschulhof/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/gabrielschulhof/node/contents/{+path}","compare_url":"https://api.github.com/repos/gabrielschulhof/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabrielschulhof/node/merges","archive_url":"https://api.github.com/repos/gabrielschulhof/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabrielschulhof/node/downloads","issues_url":"https://api.github.com/repos/gabrielschulhof/node/issues{/number}","pulls_url":"https://api.github.com/repos/gabrielschulhof/node/pulls{/number}","milestones_url":"https://api.github.com/repos/gabrielschulhof/node/milestones{/number}","notifications_url":"https://api.github.com/repos/gabrielschulhof/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabrielschulhof/node/labels{/name}","releases_url":"https://api.github.com/repos/gabrielschulhof/node/releases{/id}","deployments_url":"https://api.github.com/repos/gabrielschulhof/node/deployments","created_at":"2017-04-03T19:46:33Z","updated_at":"2017-04-03T19:47:01Z","pushed_at":"2017-06-16T14:14:41Z","git_url":"git://github.com/gabrielschulhof/node.git","ssh_url":"git@github.com:gabrielschulhof/node.git","clone_url":"https://github.com/gabrielschulhof/node.git","svn_url":"https://github.com/gabrielschulhof/node","homepage":"https://nodejs.org","size":295350,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"fe2caf6fb587a8373a4e45476a9c86f6b0993861","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars0.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://avatars0.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":"2017-06-16T14:23:48Z","pushed_at":"2017-06-16T14:15:16Z","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":295291,"stargazers_count":36159,"watchers_count":36159,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6974,"mirror_url":null,"open_issues_count":987,"forks":6974,"open_issues":987,"watchers":36159,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/13717"},"html":{"href":"https://github.com/nodejs/node/pull/13717"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/13717"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/13717/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/13717/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/13717/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/c53a6f8c83ac430e181e30700dedccf821d6919c"}}}}
{"actor":{"display_login":"addaleax"}}