{"action":"created","comment":{"url":"https://api.github.com/repos/amb26/linux/pulls/comments/47279041","id":47279041,"diff_hunk":"@@ -15,119 +16,131 @@\n  */\n \n \n-#include <node.h>\n-#include <v8.h>\n-\n+#include <nan.h>\n #include <gio/gio.h>\n \n using namespace v8;\n+using v8::FunctionTemplate;\n+using v8::Handle;\n+using v8::Isolate;\n+using v8::Object;\n+using v8::String;\n+using Nan::GetFunction;\n+using Nan::New;\n+using Nan::Set;\n+using Nan::ThrowError;\n \n-Handle<Value> get_gsetting_keys(const Arguments& args) {\n-  HandleScope scope;\n+NAN_METHOD(get_gsetting_keys) {\n+  Isolate *isolate = info.GetIsolate();\n   GSettings *settings;\n-  char schema[1024];\n   gchar ** keys;\n   gint i;\n   gint size = 0;\n-  args[0]->ToString()->WriteAscii(schema);\n-  settings = g_settings_new(schema);\n+  Local<String> schema = info[0].As<String>();\n+  settings = g_settings_new(*String::Utf8Value(schema));\n   keys = g_settings_list_keys(settings);\n+\n   for (i = 0; keys[i]; i++) {\n     size++; // Figure out how to do this in 1 loop\n   }\n-  Handle<Array> togo;\n-  togo = Array::New(size);\n+  Handle<Array> togo = Array::New(isolate, size);\n   for (i = 0; keys[i]; i++) {\n-    togo->Set(i,String::New(keys[i]));\n+    togo->Set(i,String::NewFromUtf8(isolate, keys[i]));","path":"gpii/node_modules/gsettingsBridge/nodegsettings/nodegsettings.cc","position":52,"original_position":52,"commit_id":"b9d6154c2a01e400e142bd6e7e95c25ba9fd9711","original_commit_id":"b9d6154c2a01e400e142bd6e7e95c25ba9fd9711","user":{"login":"amb26","id":561418,"avatar_url":"https://avatars.githubusercontent.com/u/561418?v=3","gravatar_id":"","url":"https://api.github.com/users/amb26","html_url":"https://github.com/amb26","followers_url":"https://api.github.com/users/amb26/followers","following_url":"https://api.github.com/users/amb26/following{/other_user}","gists_url":"https://api.github.com/users/amb26/gists{/gist_id}","starred_url":"https://api.github.com/users/amb26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amb26/subscriptions","organizations_url":"https://api.github.com/users/amb26/orgs","repos_url":"https://api.github.com/users/amb26/repos","events_url":"https://api.github.com/users/amb26/events{/privacy}","received_events_url":"https://api.github.com/users/amb26/received_events","type":"User","site_admin":false},"body":"I don't see this strategy for constructing strings advertised in the public NAN docs - where did you find the recommendation?\r\n\r\nWhat I see in the docs is this: https://github.com/nodejs/nan/blob/master/doc/string_bytes.md#api_nan_encode which seems to avoid the need for the bizarre \"Isolate\" reference...","created_at":"2015-12-10T20:16:31Z","updated_at":"2015-12-10T20:16:31Z","html_url":"https://github.com/amb26/linux/pull/2#discussion_r47279041","pull_request_url":"https://api.github.com/repos/amb26/linux/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/amb26/linux/pulls/comments/47279041"},"html":{"href":"https://github.com/amb26/linux/pull/2#discussion_r47279041"},"pull_request":{"href":"https://api.github.com/repos/amb26/linux/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/amb26/linux/pulls/2","id":52924251,"html_url":"https://github.com/amb26/linux/pull/2","diff_url":"https://github.com/amb26/linux/pull/2.diff","patch_url":"https://github.com/amb26/linux/pull/2.patch","issue_url":"https://api.github.com/repos/amb26/linux/issues/2","number":2,"state":"open","locked":false,"title":"GPII-1526: Port native addons to nan","user":{"login":"javihernandez","id":821790,"avatar_url":"https://avatars.githubusercontent.com/u/821790?v=3","gravatar_id":"","url":"https://api.github.com/users/javihernandez","html_url":"https://github.com/javihernandez","followers_url":"https://api.github.com/users/javihernandez/followers","following_url":"https://api.github.com/users/javihernandez/following{/other_user}","gists_url":"https://api.github.com/users/javihernandez/gists{/gist_id}","starred_url":"https://api.github.com/users/javihernandez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javihernandez/subscriptions","organizations_url":"https://api.github.com/users/javihernandez/orgs","repos_url":"https://api.github.com/users/javihernandez/repos","events_url":"https://api.github.com/users/javihernandez/events{/privacy}","received_events_url":"https://api.github.com/users/javihernandez/received_events","type":"User","site_admin":false},"body":"Hey @amb26, \r\n\r\nI've ported our native modules to nan, so this is ready for you to start reviewing it.\r\nThe only missing piece is the packageKit addon, which is being ported by @klown and will end up in this branch for you to review too.","created_at":"2015-12-08T00:56:09Z","updated_at":"2015-12-10T20:16:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74d793a432087f563c79ecd7d45ca1e5f80594d9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amb26/linux/pulls/2/commits","review_comments_url":"https://api.github.com/repos/amb26/linux/pulls/2/comments","review_comment_url":"https://api.github.com/repos/amb26/linux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amb26/linux/issues/2/comments","statuses_url":"https://api.github.com/repos/amb26/linux/statuses/b9d6154c2a01e400e142bd6e7e95c25ba9fd9711","head":{"label":"javihernandez:GPII-1526","ref":"GPII-1526","sha":"b9d6154c2a01e400e142bd6e7e95c25ba9fd9711","user":{"login":"javihernandez","id":821790,"avatar_url":"https://avatars.githubusercontent.com/u/821790?v=3","gravatar_id":"","url":"https://api.github.com/users/javihernandez","html_url":"https://github.com/javihernandez","followers_url":"https://api.github.com/users/javihernandez/followers","following_url":"https://api.github.com/users/javihernandez/following{/other_user}","gists_url":"https://api.github.com/users/javihernandez/gists{/gist_id}","starred_url":"https://api.github.com/users/javihernandez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javihernandez/subscriptions","organizations_url":"https://api.github.com/users/javihernandez/orgs","repos_url":"https://api.github.com/users/javihernandez/repos","events_url":"https://api.github.com/users/javihernandez/events{/privacy}","received_events_url":"https://api.github.com/users/javihernandez/received_events","type":"User","site_admin":false},"repo":{"id":4283441,"name":"linux","full_name":"javihernandez/linux","owner":{"login":"javihernandez","id":821790,"avatar_url":"https://avatars.githubusercontent.com/u/821790?v=3","gravatar_id":"","url":"https://api.github.com/users/javihernandez","html_url":"https://github.com/javihernandez","followers_url":"https://api.github.com/users/javihernandez/followers","following_url":"https://api.github.com/users/javihernandez/following{/other_user}","gists_url":"https://api.github.com/users/javihernandez/gists{/gist_id}","starred_url":"https://api.github.com/users/javihernandez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javihernandez/subscriptions","organizations_url":"https://api.github.com/users/javihernandez/orgs","repos_url":"https://api.github.com/users/javihernandez/repos","events_url":"https://api.github.com/users/javihernandez/events{/privacy}","received_events_url":"https://api.github.com/users/javihernandez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/javihernandez/linux","description":"","fork":true,"url":"https://api.github.com/repos/javihernandez/linux","forks_url":"https://api.github.com/repos/javihernandez/linux/forks","keys_url":"https://api.github.com/repos/javihernandez/linux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/javihernandez/linux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/javihernandez/linux/teams","hooks_url":"https://api.github.com/repos/javihernandez/linux/hooks","issue_events_url":"https://api.github.com/repos/javihernandez/linux/issues/events{/number}","events_url":"https://api.github.com/repos/javihernandez/linux/events","assignees_url":"https://api.github.com/repos/javihernandez/linux/assignees{/user}","branches_url":"https://api.github.com/repos/javihernandez/linux/branches{/branch}","tags_url":"https://api.github.com/repos/javihernandez/linux/tags","blobs_url":"https://api.github.com/repos/javihernandez/linux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/javihernandez/linux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/javihernandez/linux/git/refs{/sha}","trees_url":"https://api.github.com/repos/javihernandez/linux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/javihernandez/linux/statuses/{sha}","languages_url":"https://api.github.com/repos/javihernandez/linux/languages","stargazers_url":"https://api.github.com/repos/javihernandez/linux/stargazers","contributors_url":"https://api.github.com/repos/javihernandez/linux/contributors","subscribers_url":"https://api.github.com/repos/javihernandez/linux/subscribers","subscription_url":"https://api.github.com/repos/javihernandez/linux/subscription","commits_url":"https://api.github.com/repos/javihernandez/linux/commits{/sha}","git_commits_url":"https://api.github.com/repos/javihernandez/linux/git/commits{/sha}","comments_url":"https://api.github.com/repos/javihernandez/linux/comments{/number}","issue_comment_url":"https://api.github.com/repos/javihernandez/linux/issues/comments{/number}","contents_url":"https://api.github.com/repos/javihernandez/linux/contents/{+path}","compare_url":"https://api.github.com/repos/javihernandez/linux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/javihernandez/linux/merges","archive_url":"https://api.github.com/repos/javihernandez/linux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/javihernandez/linux/downloads","issues_url":"https://api.github.com/repos/javihernandez/linux/issues{/number}","pulls_url":"https://api.github.com/repos/javihernandez/linux/pulls{/number}","milestones_url":"https://api.github.com/repos/javihernandez/linux/milestones{/number}","notifications_url":"https://api.github.com/repos/javihernandez/linux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/javihernandez/linux/labels{/name}","releases_url":"https://api.github.com/repos/javihernandez/linux/releases{/id}","created_at":"2012-05-10T11:06:03Z","updated_at":"2015-02-09T10:45:06Z","pushed_at":"2015-12-09T16:29:24Z","git_url":"git://github.com/javihernandez/linux.git","ssh_url":"git@github.com:javihernandez/linux.git","clone_url":"https://github.com/javihernandez/linux.git","svn_url":"https://github.com/javihernandez/linux","homepage":"","size":659,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"amb26:GPII-1318","ref":"GPII-1318","sha":"3e6b6b662ef9e550d6a3fb11d787e9f9ce1f9b0a","user":{"login":"amb26","id":561418,"avatar_url":"https://avatars.githubusercontent.com/u/561418?v=3","gravatar_id":"","url":"https://api.github.com/users/amb26","html_url":"https://github.com/amb26","followers_url":"https://api.github.com/users/amb26/followers","following_url":"https://api.github.com/users/amb26/following{/other_user}","gists_url":"https://api.github.com/users/amb26/gists{/gist_id}","starred_url":"https://api.github.com/users/amb26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amb26/subscriptions","organizations_url":"https://api.github.com/users/amb26/orgs","repos_url":"https://api.github.com/users/amb26/repos","events_url":"https://api.github.com/users/amb26/events{/privacy}","received_events_url":"https://api.github.com/users/amb26/received_events","type":"User","site_admin":false},"repo":{"id":22614513,"name":"linux","full_name":"amb26/linux","owner":{"login":"amb26","id":561418,"avatar_url":"https://avatars.githubusercontent.com/u/561418?v=3","gravatar_id":"","url":"https://api.github.com/users/amb26","html_url":"https://github.com/amb26","followers_url":"https://api.github.com/users/amb26/followers","following_url":"https://api.github.com/users/amb26/following{/other_user}","gists_url":"https://api.github.com/users/amb26/gists{/gist_id}","starred_url":"https://api.github.com/users/amb26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amb26/subscriptions","organizations_url":"https://api.github.com/users/amb26/orgs","repos_url":"https://api.github.com/users/amb26/repos","events_url":"https://api.github.com/users/amb26/events{/privacy}","received_events_url":"https://api.github.com/users/amb26/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amb26/linux","description":"","fork":true,"url":"https://api.github.com/repos/amb26/linux","forks_url":"https://api.github.com/repos/amb26/linux/forks","keys_url":"https://api.github.com/repos/amb26/linux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amb26/linux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amb26/linux/teams","hooks_url":"https://api.github.com/repos/amb26/linux/hooks","issue_events_url":"https://api.github.com/repos/amb26/linux/issues/events{/number}","events_url":"https://api.github.com/repos/amb26/linux/events","assignees_url":"https://api.github.com/repos/amb26/linux/assignees{/user}","branches_url":"https://api.github.com/repos/amb26/linux/branches{/branch}","tags_url":"https://api.github.com/repos/amb26/linux/tags","blobs_url":"https://api.github.com/repos/amb26/linux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amb26/linux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amb26/linux/git/refs{/sha}","trees_url":"https://api.github.com/repos/amb26/linux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amb26/linux/statuses/{sha}","languages_url":"https://api.github.com/repos/amb26/linux/languages","stargazers_url":"https://api.github.com/repos/amb26/linux/stargazers","contributors_url":"https://api.github.com/repos/amb26/linux/contributors","subscribers_url":"https://api.github.com/repos/amb26/linux/subscribers","subscription_url":"https://api.github.com/repos/amb26/linux/subscription","commits_url":"https://api.github.com/repos/amb26/linux/commits{/sha}","git_commits_url":"https://api.github.com/repos/amb26/linux/git/commits{/sha}","comments_url":"https://api.github.com/repos/amb26/linux/comments{/number}","issue_comment_url":"https://api.github.com/repos/amb26/linux/issues/comments{/number}","contents_url":"https://api.github.com/repos/amb26/linux/contents/{+path}","compare_url":"https://api.github.com/repos/amb26/linux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amb26/linux/merges","archive_url":"https://api.github.com/repos/amb26/linux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amb26/linux/downloads","issues_url":"https://api.github.com/repos/amb26/linux/issues{/number}","pulls_url":"https://api.github.com/repos/amb26/linux/pulls{/number}","milestones_url":"https://api.github.com/repos/amb26/linux/milestones{/number}","notifications_url":"https://api.github.com/repos/amb26/linux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amb26/linux/labels{/name}","releases_url":"https://api.github.com/repos/amb26/linux/releases{/id}","created_at":"2014-08-04T18:09:21Z","updated_at":"2014-07-11T20:07:51Z","pushed_at":"2015-12-09T16:29:26Z","git_url":"git://github.com/amb26/linux.git","ssh_url":"git@github.com:amb26/linux.git","clone_url":"https://github.com/amb26/linux.git","svn_url":"https://github.com/amb26/linux","homepage":"","size":569,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amb26/linux/pulls/2"},"html":{"href":"https://github.com/amb26/linux/pull/2"},"issue":{"href":"https://api.github.com/repos/amb26/linux/issues/2"},"comments":{"href":"https://api.github.com/repos/amb26/linux/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/amb26/linux/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/amb26/linux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amb26/linux/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/amb26/linux/statuses/b9d6154c2a01e400e142bd6e7e95c25ba9fd9711"}}}}