{"action":"created","comment":{"url":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/comments/43733636","id":43733636,"diff_hunk":"@@ -0,0 +1,57 @@\n+#include \"UnmanagedType.h\"\n+\n+namespace NativeScript {\n+using namespace JSC;\n+\n+const ClassInfo UnmanagedType::s_info = { \"Unmanaged\", &Base::s_info, 0, CREATE_METHOD_TABLE(UnmanagedType) };\n+\n+void UnmanagedType::finishCreation(VM& vm, JSCell* returnType) {\n+    Base::finishCreation(vm);\n+\n+    this->_returnType.set(vm, this, returnType);\n+\n+    this->_ffiTypeMethodTable.ffiType = &ffi_type_pointer;\n+    this->_ffiTypeMethodTable.read = &read;\n+    this->_ffiTypeMethodTable.write = &write;\n+    this->_ffiTypeMethodTable.canConvert = &canConvert;\n+    this->_ffiTypeMethodTable.encode = &encode;\n+}\n+\n+JSValue UnmanagedType::read(ExecState* execState, const void* buffer, JSCell* self) {\n+    const void* data = *reinterpret_cast<void* const*>(buffer);\n+\n+    if (!data) {\n+        return jsNull();\n+    }\n+\n+    GlobalObject* globalObject = jsCast<GlobalObject*>(execState->lexicalGlobalObject());\n+    UnmanagedType* constructor = jsCast<UnmanagedType*>(self);\n+\n+    return UnmanagedInstance::create(execState->vm(), globalObject->unmanagedInstanceStructure(), constructor->_returnType.get(), const_cast<void*>(data));\n+}\n+\n+void UnmanagedType::visitChildren(JSCell* cell, SlotVisitor& visitor) {\n+    Base::visitChildren(cell, visitor);\n+\n+    UnmanagedType* constructor = jsCast<UnmanagedType*>(cell);\n+    visitor.append(&constructor->_returnType);\n+}\n+\n+void UnmanagedType::write(ExecState* execState, const JSValue&, void*, JSCell* self) {\n+    throwVMTypeError(execState, WTF::ASCIILiteral(\"Unmanaged type could not be consumed from native. Try calling takeRetained/takeUnretained before.\"));\n+}\n+\n+bool UnmanagedType::canConvert(ExecState*, const JSValue&, JSCell* self) {\n+    return false;\n+}\n+\n+const char* UnmanagedType::encode(JSCell* cell) {","path":"src/NativeScript/ObjC/Unmanaged/UnmanagedType.cpp","position":48,"original_position":48,"commit_id":"2d42c5acbb5606138552b019ef1ff25c4977a5cb","original_commit_id":"1a944abb46f5a8f18fc1c525d0a8f18a26e1b893","user":{"login":"fealebenpae","id":289915,"avatar_url":"https://avatars.githubusercontent.com/u/289915?v=3","gravatar_id":"","url":"https://api.github.com/users/fealebenpae","html_url":"https://github.com/fealebenpae","followers_url":"https://api.github.com/users/fealebenpae/followers","following_url":"https://api.github.com/users/fealebenpae/following{/other_user}","gists_url":"https://api.github.com/users/fealebenpae/gists{/gist_id}","starred_url":"https://api.github.com/users/fealebenpae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fealebenpae/subscriptions","organizations_url":"https://api.github.com/users/fealebenpae/orgs","repos_url":"https://api.github.com/users/fealebenpae/repos","events_url":"https://api.github.com/users/fealebenpae/events{/privacy}","received_events_url":"https://api.github.com/users/fealebenpae/received_events","type":"User","site_admin":false},"body":"@jasssonpet, what do you think?","created_at":"2015-11-03T10:35:15Z","updated_at":"2015-11-03T10:35:15Z","html_url":"https://github.com/NativeScript/ios-runtime/pull/386#discussion_r43733636","pull_request_url":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/386","_links":{"self":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/comments/43733636"},"html":{"href":"https://github.com/NativeScript/ios-runtime/pull/386#discussion_r43733636"},"pull_request":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/386"}}},"pull_request":{"url":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/386","id":48875517,"html_url":"https://github.com/NativeScript/ios-runtime/pull/386","diff_url":"https://github.com/NativeScript/ios-runtime/pull/386.diff","patch_url":"https://github.com/NativeScript/ios-runtime/pull/386.patch","issue_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/386","number":386,"state":"open","locked":false,"title":"Return an Unmanaged Type when we don't know how to memory manage an item","user":{"login":"KristinaKoeva","id":2101401,"avatar_url":"https://avatars.githubusercontent.com/u/2101401?v=3","gravatar_id":"","url":"https://api.github.com/users/KristinaKoeva","html_url":"https://github.com/KristinaKoeva","followers_url":"https://api.github.com/users/KristinaKoeva/followers","following_url":"https://api.github.com/users/KristinaKoeva/following{/other_user}","gists_url":"https://api.github.com/users/KristinaKoeva/gists{/gist_id}","starred_url":"https://api.github.com/users/KristinaKoeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KristinaKoeva/subscriptions","organizations_url":"https://api.github.com/users/KristinaKoeva/orgs","repos_url":"https://api.github.com/users/KristinaKoeva/repos","events_url":"https://api.github.com/users/KristinaKoeva/events{/privacy}","received_events_url":"https://api.github.com/users/KristinaKoeva/received_events","type":"User","site_admin":false},"body":"#13\r\n\r\nhttps://github.com/NativeScript/ios-metadata-generator/pull/32","created_at":"2015-10-27T14:13:00Z","updated_at":"2015-11-03T10:35:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e54f2a821ae1d693dd04e2800fb2455579160c30","assignee":{"login":"KristinaKoeva","id":2101401,"avatar_url":"https://avatars.githubusercontent.com/u/2101401?v=3","gravatar_id":"","url":"https://api.github.com/users/KristinaKoeva","html_url":"https://github.com/KristinaKoeva","followers_url":"https://api.github.com/users/KristinaKoeva/followers","following_url":"https://api.github.com/users/KristinaKoeva/following{/other_user}","gists_url":"https://api.github.com/users/KristinaKoeva/gists{/gist_id}","starred_url":"https://api.github.com/users/KristinaKoeva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KristinaKoeva/subscriptions","organizations_url":"https://api.github.com/users/KristinaKoeva/orgs","repos_url":"https://api.github.com/users/KristinaKoeva/repos","events_url":"https://api.github.com/users/KristinaKoeva/events{/privacy}","received_events_url":"https://api.github.com/users/KristinaKoeva/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/NativeScript/ios-runtime/milestones/9","html_url":"https://github.com/NativeScript/ios-runtime/milestones/1.5.0","labels_url":"https://api.github.com/repos/NativeScript/ios-runtime/milestones/9/labels","id":1308223,"number":9,"title":"1.5.0","description":"","creator":{"login":"fealebenpae","id":289915,"avatar_url":"https://avatars.githubusercontent.com/u/289915?v=3","gravatar_id":"","url":"https://api.github.com/users/fealebenpae","html_url":"https://github.com/fealebenpae","followers_url":"https://api.github.com/users/fealebenpae/followers","following_url":"https://api.github.com/users/fealebenpae/following{/other_user}","gists_url":"https://api.github.com/users/fealebenpae/gists{/gist_id}","starred_url":"https://api.github.com/users/fealebenpae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fealebenpae/subscriptions","organizations_url":"https://api.github.com/users/fealebenpae/orgs","repos_url":"https://api.github.com/users/fealebenpae/repos","events_url":"https://api.github.com/users/fealebenpae/events{/privacy}","received_events_url":"https://api.github.com/users/fealebenpae/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":21,"state":"open","created_at":"2015-09-16T10:47:51Z","updated_at":"2015-11-02T18:13:06Z","due_on":"2015-11-17T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/386/commits","review_comments_url":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/386/comments","review_comment_url":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/386/comments","statuses_url":"https://api.github.com/repos/NativeScript/ios-runtime/statuses/2d42c5acbb5606138552b019ef1ff25c4977a5cb","head":{"label":"NativeScript:KristinaKoeva/AddUnmanaged","ref":"KristinaKoeva/AddUnmanaged","sha":"2d42c5acbb5606138552b019ef1ff25c4977a5cb","user":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"repo":{"id":29675401,"name":"ios-runtime","full_name":"NativeScript/ios-runtime","owner":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NativeScript/ios-runtime","description":"iOS runtime for NativeScript (based on JavaScriptCore)","fork":false,"url":"https://api.github.com/repos/NativeScript/ios-runtime","forks_url":"https://api.github.com/repos/NativeScript/ios-runtime/forks","keys_url":"https://api.github.com/repos/NativeScript/ios-runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NativeScript/ios-runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NativeScript/ios-runtime/teams","hooks_url":"https://api.github.com/repos/NativeScript/ios-runtime/hooks","issue_events_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/events{/number}","events_url":"https://api.github.com/repos/NativeScript/ios-runtime/events","assignees_url":"https://api.github.com/repos/NativeScript/ios-runtime/assignees{/user}","branches_url":"https://api.github.com/repos/NativeScript/ios-runtime/branches{/branch}","tags_url":"https://api.github.com/repos/NativeScript/ios-runtime/tags","blobs_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NativeScript/ios-runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/NativeScript/ios-runtime/languages","stargazers_url":"https://api.github.com/repos/NativeScript/ios-runtime/stargazers","contributors_url":"https://api.github.com/repos/NativeScript/ios-runtime/contributors","subscribers_url":"https://api.github.com/repos/NativeScript/ios-runtime/subscribers","subscription_url":"https://api.github.com/repos/NativeScript/ios-runtime/subscription","commits_url":"https://api.github.com/repos/NativeScript/ios-runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/NativeScript/ios-runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/NativeScript/ios-runtime/contents/{+path}","compare_url":"https://api.github.com/repos/NativeScript/ios-runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NativeScript/ios-runtime/merges","archive_url":"https://api.github.com/repos/NativeScript/ios-runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NativeScript/ios-runtime/downloads","issues_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues{/number}","pulls_url":"https://api.github.com/repos/NativeScript/ios-runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/NativeScript/ios-runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/NativeScript/ios-runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NativeScript/ios-runtime/labels{/name}","releases_url":"https://api.github.com/repos/NativeScript/ios-runtime/releases{/id}","created_at":"2015-01-22T11:21:31Z","updated_at":"2015-10-25T14:31:21Z","pushed_at":"2015-11-03T08:16:29Z","git_url":"git://github.com/NativeScript/ios-runtime.git","ssh_url":"git@github.com:NativeScript/ios-runtime.git","clone_url":"https://github.com/NativeScript/ios-runtime.git","svn_url":"https://github.com/NativeScript/ios-runtime","homepage":"http://docs.nativescript.org/runtimes/ios","size":84344,"stargazers_count":76,"watchers_count":76,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":59,"forks":13,"open_issues":59,"watchers":76,"default_branch":"master"}},"base":{"label":"NativeScript:master","ref":"master","sha":"b66f04284cf08100a6f93dba273843c86755c583","user":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"repo":{"id":29675401,"name":"ios-runtime","full_name":"NativeScript/ios-runtime","owner":{"login":"NativeScript","id":7392261,"avatar_url":"https://avatars.githubusercontent.com/u/7392261?v=3","gravatar_id":"","url":"https://api.github.com/users/NativeScript","html_url":"https://github.com/NativeScript","followers_url":"https://api.github.com/users/NativeScript/followers","following_url":"https://api.github.com/users/NativeScript/following{/other_user}","gists_url":"https://api.github.com/users/NativeScript/gists{/gist_id}","starred_url":"https://api.github.com/users/NativeScript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NativeScript/subscriptions","organizations_url":"https://api.github.com/users/NativeScript/orgs","repos_url":"https://api.github.com/users/NativeScript/repos","events_url":"https://api.github.com/users/NativeScript/events{/privacy}","received_events_url":"https://api.github.com/users/NativeScript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NativeScript/ios-runtime","description":"iOS runtime for NativeScript (based on JavaScriptCore)","fork":false,"url":"https://api.github.com/repos/NativeScript/ios-runtime","forks_url":"https://api.github.com/repos/NativeScript/ios-runtime/forks","keys_url":"https://api.github.com/repos/NativeScript/ios-runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NativeScript/ios-runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NativeScript/ios-runtime/teams","hooks_url":"https://api.github.com/repos/NativeScript/ios-runtime/hooks","issue_events_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/events{/number}","events_url":"https://api.github.com/repos/NativeScript/ios-runtime/events","assignees_url":"https://api.github.com/repos/NativeScript/ios-runtime/assignees{/user}","branches_url":"https://api.github.com/repos/NativeScript/ios-runtime/branches{/branch}","tags_url":"https://api.github.com/repos/NativeScript/ios-runtime/tags","blobs_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NativeScript/ios-runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/NativeScript/ios-runtime/languages","stargazers_url":"https://api.github.com/repos/NativeScript/ios-runtime/stargazers","contributors_url":"https://api.github.com/repos/NativeScript/ios-runtime/contributors","subscribers_url":"https://api.github.com/repos/NativeScript/ios-runtime/subscribers","subscription_url":"https://api.github.com/repos/NativeScript/ios-runtime/subscription","commits_url":"https://api.github.com/repos/NativeScript/ios-runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/NativeScript/ios-runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/NativeScript/ios-runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/NativeScript/ios-runtime/contents/{+path}","compare_url":"https://api.github.com/repos/NativeScript/ios-runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NativeScript/ios-runtime/merges","archive_url":"https://api.github.com/repos/NativeScript/ios-runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NativeScript/ios-runtime/downloads","issues_url":"https://api.github.com/repos/NativeScript/ios-runtime/issues{/number}","pulls_url":"https://api.github.com/repos/NativeScript/ios-runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/NativeScript/ios-runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/NativeScript/ios-runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NativeScript/ios-runtime/labels{/name}","releases_url":"https://api.github.com/repos/NativeScript/ios-runtime/releases{/id}","created_at":"2015-01-22T11:21:31Z","updated_at":"2015-10-25T14:31:21Z","pushed_at":"2015-11-03T08:16:29Z","git_url":"git://github.com/NativeScript/ios-runtime.git","ssh_url":"git@github.com:NativeScript/ios-runtime.git","clone_url":"https://github.com/NativeScript/ios-runtime.git","svn_url":"https://github.com/NativeScript/ios-runtime","homepage":"http://docs.nativescript.org/runtimes/ios","size":84344,"stargazers_count":76,"watchers_count":76,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":59,"forks":13,"open_issues":59,"watchers":76,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/386"},"html":{"href":"https://github.com/NativeScript/ios-runtime/pull/386"},"issue":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/issues/386"},"comments":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/issues/386/comments"},"review_comments":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/386/comments"},"review_comment":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/pulls/386/commits"},"statuses":{"href":"https://api.github.com/repos/NativeScript/ios-runtime/statuses/2d42c5acbb5606138552b019ef1ff25c4977a5cb"}}}}