{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/124086197","pull_request_review_id":46345276,"id":124086197,"diff_hunk":"@@ -2836,6 +2836,14 @@ required in order to enable correct proper of the reference.\n Afterward, additional manipulation of the wrapper's prototype chain may cause\n `napi_unwrap()` to fail.\n \n+*Note*: Calling `napi_wrap()` a second time on an object that already has a\n+native instance associated with it by virtue of a previous call to\n+`napi_wrap()` will have the effect that the new instance will replace the old\n+instance, and the old instance will eventually be freed by the JavaScript","path":"doc/api/n-api.md","position":18,"original_position":18,"commit_id":"ad017226af1479a2c7626935ce024f454c87442c","original_commit_id":"ad017226af1479a2c7626935ce024f454c87442c","user":{"login":"mhdawson","id":9373002,"avatar_url":"https://avatars0.githubusercontent.com/u/9373002?v=3","gravatar_id":"","url":"https://api.github.com/users/mhdawson","html_url":"https://github.com/mhdawson","followers_url":"https://api.github.com/users/mhdawson/followers","following_url":"https://api.github.com/users/mhdawson/following{/other_user}","gists_url":"https://api.github.com/users/mhdawson/gists{/gist_id}","starred_url":"https://api.github.com/users/mhdawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhdawson/subscriptions","organizations_url":"https://api.github.com/users/mhdawson/orgs","repos_url":"https://api.github.com/users/mhdawson/repos","events_url":"https://api.github.com/users/mhdawson/events{/privacy}","received_events_url":"https://api.github.com/users/mhdawson/received_events","type":"User","site_admin":false},"body":"I think this needs to be updated to reflect an error will be thrown.","created_at":"2017-06-26T18:35:48Z","updated_at":"2017-06-26T18:41:29Z","html_url":"https://github.com/nodejs/node/pull/13872#discussion_r124086197","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/13872","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/124086197"},"html":{"href":"https://github.com/nodejs/node/pull/13872#discussion_r124086197"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/13872"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/13872","id":126973717,"html_url":"https://github.com/nodejs/node/pull/13872","diff_url":"https://github.com/nodejs/node/pull/13872.diff","patch_url":"https://github.com/nodejs/node/pull/13872.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/13872","number":13872,"state":"open","locked":false,"title":"N-API: Implement stricter wrapping","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":"Use a stronger criterion to identify objects in the prototype chain that store\r\npointers to native data that were added by previous calls to `napi_wrap()`.\r\n\r\nWhereas the old criterion for identifying `napi_wrap()`-injected prototype\r\nchain objects was to consider an object with an internal field\r\ncount of 1 to be such an object, the new criterion is to consider an object\r\nwith an internal field count of 2 such that the second field holds a\r\n`v8::External` which itself contains a pointer to a global static string unique\r\nto N-API to be a `napi_wrap()`-injected prototype chain object.\r\n\r\nThis greatly reduces the possibility of returning a pointer that was not\r\npreviously added with `napi_wrap()`, and it allows us to recognize that an\r\nobject has already undergone `napi_wrap()` and we can thus replace the old\r\n`v8::External` with the new one such that, when the old one will be garbage-\r\ncollected, any finalize callback for its native pointer will also be called.\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\n","created_at":"2017-06-22T11:52:11Z","updated_at":"2017-06-26T18:41:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e67419df1eaa9413aea6289b75e65807fcb4ce1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/13872/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/13872/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/13872/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/ad017226af1479a2c7626935ce024f454c87442c","head":{"label":"gabrielschulhof:stricter-wrapping","ref":"stricter-wrapping","sha":"ad017226af1479a2c7626935ce024f454c87442c","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-23T20:28:28Z","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":296553,"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":"3e178848a5f5f128f38b0ede5ab73210194c8aa6","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-26T17:46:33Z","pushed_at":"2017-06-26T18:26:30Z","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":296320,"stargazers_count":36484,"watchers_count":36484,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7077,"mirror_url":null,"open_issues_count":1030,"forks":7077,"open_issues":1030,"watchers":36484,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/13872"},"html":{"href":"https://github.com/nodejs/node/pull/13872"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/13872"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/13872/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/13872/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/13872/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/ad017226af1479a2c7626935ce024f454c87442c"}}}}
{"actor":{"display_login":"mhdawson"}}