{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/29681695","id":29681695,"diff_hunk":"@@ -0,0 +1,47 @@\n+/*\n+\tThis file is part of cpp-ethereum.\n+\n+\tcpp-ethereum is free software: you can redistribute it and/or modify\n+\tit under the terms of the GNU General Public License as published by\n+\tthe Free Software Foundation, either version 3 of the License, or\n+\t(at your option) any later version.\n+\n+\tcpp-ethereum is distributed in the hope that it will be useful,\n+\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n+\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+\tGNU General Public License for more details.\n+\n+\tYou should have received a copy of the GNU General Public License\n+\talong with cpp-ethereum.  If not, see <http://www.gnu.org/licenses/>.\n+*/\n+/** @file JSV8Printer.cpp\n+ * @author Marek Kotewicz <marek@ethdev.com>\n+ * @date 2015\n+ * Ethereum client.\n+ */\n+\n+#include <string>\n+#include \"JSV8Printer.h\"\n+#include \"libjsengine/JSEngineResources.hpp\"\n+\n+using namespace std;\n+using namespace dev;\n+using namespace eth;\n+\n+JSV8Printer::JSV8Printer(JSV8Engine const& _engine): m_engine(_engine)\n+{\n+\tJSEngineResources resources;\n+\tstring prettyPrint = resources.loadResourceAsString(\"pretty_print\");\n+\tm_engine.eval(prettyPrint.c_str());\n+}\n+\n+JSString JSV8Printer::prettyPrint(JSV8Value const& _value) const\n+{\n+\tv8::HandleScope handleScope;\n+\tv8::Local<v8::String> pp = v8::String::New(\"prettyPrint\");\n+\tv8::Handle<v8::Function> func = v8::Handle<v8::Function>::Cast(m_engine.context()->Global()->Get(pp));\n+\tv8::Local<v8::Value> values[1] = {v8::Local<v8::Value>::New(_value.value())};\n+\tv8::Local<v8::Value> res = func->Call(func, 1, values);\n+\tv8::String::Utf8Value str(res);\n+\treturn *str ? *str : \"<pretty print conversion failed>\";","path":"libjsengine/JSV8Printer.cpp","position":46,"original_position":46,"commit_id":"5c2be28a2d2b009327c108a97b89b8e6e7c046c8","original_commit_id":"5c2be28a2d2b009327c108a97b89b8e6e7c046c8","user":{"login":"arkpar","id":9008569,"avatar_url":"https://avatars.githubusercontent.com/u/9008569?v=3","gravatar_id":"","url":"https://api.github.com/users/arkpar","html_url":"https://github.com/arkpar","followers_url":"https://api.github.com/users/arkpar/followers","following_url":"https://api.github.com/users/arkpar/following{/other_user}","gists_url":"https://api.github.com/users/arkpar/gists{/gist_id}","starred_url":"https://api.github.com/users/arkpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkpar/subscriptions","organizations_url":"https://api.github.com/users/arkpar/orgs","repos_url":"https://api.github.com/users/arkpar/repos","events_url":"https://api.github.com/users/arkpar/events{/privacy}","received_events_url":"https://api.github.com/users/arkpar/received_events","type":"User","site_admin":false},"body":"Throw error instead?","created_at":"2015-05-05T15:45:02Z","updated_at":"2015-05-05T15:45:02Z","html_url":"https://github.com/ethereum/cpp-ethereum/pull/1771#discussion_r29681695","pull_request_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1771","_links":{"self":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments/29681695"},"html":{"href":"https://github.com/ethereum/cpp-ethereum/pull/1771#discussion_r29681695"},"pull_request":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1771"}}},"pull_request":{"url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1771","id":34417050,"html_url":"https://github.com/ethereum/cpp-ethereum/pull/1771","diff_url":"https://github.com/ethereum/cpp-ethereum/pull/1771.diff","patch_url":"https://github.com/ethereum/cpp-ethereum/pull/1771.patch","issue_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/1771","number":1771,"state":"open","locked":false,"title":"v8 javascript console","user":{"login":"debris","id":2613714,"avatar_url":"https://avatars.githubusercontent.com/u/2613714?v=3","gravatar_id":"","url":"https://api.github.com/users/debris","html_url":"https://github.com/debris","followers_url":"https://api.github.com/users/debris/followers","following_url":"https://api.github.com/users/debris/following{/other_user}","gists_url":"https://api.github.com/users/debris/gists{/gist_id}","starred_url":"https://api.github.com/users/debris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debris/subscriptions","organizations_url":"https://api.github.com/users/debris/orgs","repos_url":"https://api.github.com/users/debris/repos","events_url":"https://api.github.com/users/debris/events{/privacy}","received_events_url":"https://api.github.com/users/debris/received_events","type":"User","site_admin":false},"body":"progress of the task is in #1763","created_at":"2015-04-29T23:45:08Z","updated_at":"2015-05-05T15:45:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc0b05561ec359820b0ad365a76a680fa258384b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1771/commits","review_comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1771/comments","review_comment_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/1771/comments","statuses_url":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/5c2be28a2d2b009327c108a97b89b8e6e7c046c8","head":{"label":"debris:v8console","ref":"v8console","sha":"5c2be28a2d2b009327c108a97b89b8e6e7c046c8","user":{"login":"debris","id":2613714,"avatar_url":"https://avatars.githubusercontent.com/u/2613714?v=3","gravatar_id":"","url":"https://api.github.com/users/debris","html_url":"https://github.com/debris","followers_url":"https://api.github.com/users/debris/followers","following_url":"https://api.github.com/users/debris/following{/other_user}","gists_url":"https://api.github.com/users/debris/gists{/gist_id}","starred_url":"https://api.github.com/users/debris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debris/subscriptions","organizations_url":"https://api.github.com/users/debris/orgs","repos_url":"https://api.github.com/users/debris/repos","events_url":"https://api.github.com/users/debris/events{/privacy}","received_events_url":"https://api.github.com/users/debris/received_events","type":"User","site_admin":false},"repo":{"id":25056321,"name":"cpp-ethereum","full_name":"debris/cpp-ethereum","owner":{"login":"debris","id":2613714,"avatar_url":"https://avatars.githubusercontent.com/u/2613714?v=3","gravatar_id":"","url":"https://api.github.com/users/debris","html_url":"https://github.com/debris","followers_url":"https://api.github.com/users/debris/followers","following_url":"https://api.github.com/users/debris/following{/other_user}","gists_url":"https://api.github.com/users/debris/gists{/gist_id}","starred_url":"https://api.github.com/users/debris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/debris/subscriptions","organizations_url":"https://api.github.com/users/debris/orgs","repos_url":"https://api.github.com/users/debris/repos","events_url":"https://api.github.com/users/debris/events{/privacy}","received_events_url":"https://api.github.com/users/debris/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/debris/cpp-ethereum","description":"Gavin Wood's C++ implementation of the Ethereum yellowpaper.","fork":true,"url":"https://api.github.com/repos/debris/cpp-ethereum","forks_url":"https://api.github.com/repos/debris/cpp-ethereum/forks","keys_url":"https://api.github.com/repos/debris/cpp-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/debris/cpp-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/debris/cpp-ethereum/teams","hooks_url":"https://api.github.com/repos/debris/cpp-ethereum/hooks","issue_events_url":"https://api.github.com/repos/debris/cpp-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/debris/cpp-ethereum/events","assignees_url":"https://api.github.com/repos/debris/cpp-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/debris/cpp-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/debris/cpp-ethereum/tags","blobs_url":"https://api.github.com/repos/debris/cpp-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/debris/cpp-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/debris/cpp-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/debris/cpp-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/debris/cpp-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/debris/cpp-ethereum/languages","stargazers_url":"https://api.github.com/repos/debris/cpp-ethereum/stargazers","contributors_url":"https://api.github.com/repos/debris/cpp-ethereum/contributors","subscribers_url":"https://api.github.com/repos/debris/cpp-ethereum/subscribers","subscription_url":"https://api.github.com/repos/debris/cpp-ethereum/subscription","commits_url":"https://api.github.com/repos/debris/cpp-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/debris/cpp-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/debris/cpp-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/debris/cpp-ethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/debris/cpp-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/debris/cpp-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/debris/cpp-ethereum/merges","archive_url":"https://api.github.com/repos/debris/cpp-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/debris/cpp-ethereum/downloads","issues_url":"https://api.github.com/repos/debris/cpp-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/debris/cpp-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/debris/cpp-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/debris/cpp-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/debris/cpp-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/debris/cpp-ethereum/releases{/id}","created_at":"2014-10-10T23:01:05Z","updated_at":"2015-04-29T07:11:41Z","pushed_at":"2015-05-05T08:37:24Z","git_url":"git://github.com/debris/cpp-ethereum.git","ssh_url":"git@github.com:debris/cpp-ethereum.git","clone_url":"https://github.com/debris/cpp-ethereum.git","svn_url":"https://github.com/debris/cpp-ethereum","homepage":"www.gavwood.com/Paper.pdf","size":22968,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"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":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"84ecbaff9e2540d06a5c1fccf547a528158dd0b1","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":15460666,"name":"cpp-ethereum","full_name":"ethereum/cpp-ethereum","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars.githubusercontent.com/u/6250754?v=3","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/cpp-ethereum","description":"Gavin Wood's C++ implementation of the Ethereum yellowpaper.","fork":false,"url":"https://api.github.com/repos/ethereum/cpp-ethereum","forks_url":"https://api.github.com/repos/ethereum/cpp-ethereum/forks","keys_url":"https://api.github.com/repos/ethereum/cpp-ethereum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/cpp-ethereum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/cpp-ethereum/teams","hooks_url":"https://api.github.com/repos/ethereum/cpp-ethereum/hooks","issue_events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/cpp-ethereum/events","assignees_url":"https://api.github.com/repos/ethereum/cpp-ethereum/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/cpp-ethereum/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/cpp-ethereum/tags","blobs_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/cpp-ethereum/languages","stargazers_url":"https://api.github.com/repos/ethereum/cpp-ethereum/stargazers","contributors_url":"https://api.github.com/repos/ethereum/cpp-ethereum/contributors","subscribers_url":"https://api.github.com/repos/ethereum/cpp-ethereum/subscribers","subscription_url":"https://api.github.com/repos/ethereum/cpp-ethereum/subscription","commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/cpp-ethereum/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/cpp-ethereum/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/cpp-ethereum/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/cpp-ethereum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/cpp-ethereum/merges","archive_url":"https://api.github.com/repos/ethereum/cpp-ethereum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/cpp-ethereum/downloads","issues_url":"https://api.github.com/repos/ethereum/cpp-ethereum/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/cpp-ethereum/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/cpp-ethereum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/cpp-ethereum/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/cpp-ethereum/releases{/id}","created_at":"2013-12-26T21:26:06Z","updated_at":"2015-05-05T14:06:18Z","pushed_at":"2015-05-05T15:26:26Z","git_url":"git://github.com/ethereum/cpp-ethereum.git","ssh_url":"git@github.com:ethereum/cpp-ethereum.git","clone_url":"https://github.com/ethereum/cpp-ethereum.git","svn_url":"https://github.com/ethereum/cpp-ethereum","homepage":"www.gavwood.com/Paper.pdf","size":96434,"stargazers_count":459,"watchers_count":459,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":156,"mirror_url":null,"open_issues_count":126,"forks":156,"open_issues":126,"watchers":459,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1771"},"html":{"href":"https://github.com/ethereum/cpp-ethereum/pull/1771"},"issue":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/1771"},"comments":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/issues/1771/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1771/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/pulls/1771/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/cpp-ethereum/statuses/5c2be28a2d2b009327c108a97b89b8e6e7c046c8"}}}}