{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/134067013","pull_request_review_id":57324944,"id":134067013,"diff_hunk":"@@ -674,10 +702,21 @@ v8::Local<v8::Object> CreateAccessorCallbackData(napi_env env,\n   return cbdata;\n }\n \n+// Pointer used to identify deferred objects created by N-API.\n+const char napi_deferred_name[] = \"N-API Deferred\";\n+\n // Pointer used to identify items wrapped by N-API. Used by FindWrapper and\n // napi_wrap().\n const char napi_wrap_name[] = \"N-API Wrapper\";\n \n+bool WrapperTypeCheck(v8::Local<v8::Object> wrapper, const char type_name[]) {","path":"src/node_api.cc","position":114,"original_position":114,"commit_id":"1be0bcd496bb1cc367336a6d3405af4707058a04","original_commit_id":"1be0bcd496bb1cc367336a6d3405af4707058a04","user":{"login":"addaleax","id":899444,"avatar_url":"https://avatars2.githubusercontent.com/u/899444?v=4","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":"Just curious, why this instead of `const char* type_name`?","created_at":"2017-08-18T22:28:01Z","updated_at":"2017-08-18T22:33:28Z","html_url":"https://github.com/nodejs/node/pull/14365#discussion_r134067013","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/14365","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/134067013"},"html":{"href":"https://github.com/nodejs/node/pull/14365#discussion_r134067013"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/14365"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/14365","id":131308995,"html_url":"https://github.com/nodejs/node/pull/14365","diff_url":"https://github.com/nodejs/node/pull/14365.diff","patch_url":"https://github.com/nodejs/node/pull/14365.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/14365","number":14365,"state":"open","locked":false,"title":"n-api: implement promise","user":{"login":"gabrielschulhof","id":976081,"avatar_url":"https://avatars2.githubusercontent.com/u/976081?v=4","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":"Promise is implemented as a pair of objects. `napi_create_promise()`\r\nreturns both a JavaScript promise and a \"deferred\" in its out-params.\r\nThe deferred is linked to the promise such that the deferred can be\r\npassed to `napi_conclude_deferred()` to rejct/resolve the promise. The\r\ndeferred is a valid JavaScript value, but it is a shell object offering\r\nno useful JavaScript functionality. In contrast, the promise returned\r\nby `napi_create_promise()` is a full-fledged native JavaScript Promise\r\nwhich can be used for chaining in JavaScript.\r\n\r\n`napi_is_promise()` can be used to check if a `napi_value` is a native\r\npromise - that is, a promise created by the underlying engine, rather\r\nthan a pure JS implementation of a promise.\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-07-19T12:28:08Z","updated_at":"2017-08-18T22:33:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b20584b669cb49ecafdbca4760470c7550a126dc","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/14365/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/14365/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/14365/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/1be0bcd496bb1cc367336a6d3405af4707058a04","head":{"label":"gabrielschulhof:napi-promise","ref":"napi-promise","sha":"1be0bcd496bb1cc367336a6d3405af4707058a04","user":{"login":"gabrielschulhof","id":976081,"avatar_url":"https://avatars2.githubusercontent.com/u/976081?v=4","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://avatars2.githubusercontent.com/u/976081?v=4","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-08-18T10:53:34Z","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":305328,"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":"9ecc4406421dcc89a010000b1253d3ad0efae64a","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","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://avatars3.githubusercontent.com/u/9950313?v=4","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-08-18T22:06:48Z","pushed_at":"2017-08-18T22:08:58Z","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":308362,"stargazers_count":38259,"watchers_count":38259,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7609,"mirror_url":null,"open_issues_count":832,"forks":7609,"open_issues":832,"watchers":38259,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/14365"},"html":{"href":"https://github.com/nodejs/node/pull/14365"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/14365"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/14365/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/14365/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/14365/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/1be0bcd496bb1cc367336a6d3405af4707058a04"}}}}
{"actor":{"display_login":"addaleax"}}