{"action":"created","comment":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/comments/167411101","pull_request_review_id":95633447,"id":167411101,"diff_hunk":"@@ -131,7 +145,8 @@ mergeInto(LibraryManager.library, {\n           } else if (typeof window != 'undefined' &&\n             typeof window.prompt == 'function') {\n             // Browser.\n-            result = window.prompt('Input: ');  // returns null on cancel\n+            var result;\n+            result = window.prompt('Input: ');   // returns null on cancel","path":"src/library_tty.js","position":41,"original_position":41,"commit_id":"10a7f6dd8000ccb760d42bbc329c1397a129d1be","original_commit_id":"10a7f6dd8000ccb760d42bbc329c1397a129d1be","user":{"login":"eclecticdave","id":12257,"avatar_url":"https://avatars2.githubusercontent.com/u/12257?v=4","gravatar_id":"","url":"https://api.github.com/users/eclecticdave","html_url":"https://github.com/eclecticdave","followers_url":"https://api.github.com/users/eclecticdave/followers","following_url":"https://api.github.com/users/eclecticdave/following{/other_user}","gists_url":"https://api.github.com/users/eclecticdave/gists{/gist_id}","starred_url":"https://api.github.com/users/eclecticdave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclecticdave/subscriptions","organizations_url":"https://api.github.com/users/eclecticdave/orgs","repos_url":"https://api.github.com/users/eclecticdave/repos","events_url":"https://api.github.com/users/eclecticdave/events{/privacy}","received_events_url":"https://api.github.com/users/eclecticdave/received_events","type":"User","site_admin":false},"body":"Yeah, in fact there's already a 'var result  = null' at the top of the function, so this line isn't needed at all.","created_at":"2018-02-10T21:07:36Z","updated_at":"2018-02-10T21:07:36Z","html_url":"https://github.com/kripken/emscripten/pull/6080#discussion_r167411101","pull_request_url":"https://api.github.com/repos/kripken/emscripten/pulls/6080","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/comments/167411101"},"html":{"href":"https://github.com/kripken/emscripten/pull/6080#discussion_r167411101"},"pull_request":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/6080"}},"in_reply_to_id":167001388},"pull_request":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/6080","id":162860735,"html_url":"https://github.com/kripken/emscripten/pull/6080","diff_url":"https://github.com/kripken/emscripten/pull/6080.diff","patch_url":"https://github.com/kripken/emscripten/pull/6080.patch","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/6080","number":6080,"state":"open","locked":false,"title":"Implement rawPrint and rawPrintErr","user":{"login":"eclecticdave","id":12257,"avatar_url":"https://avatars2.githubusercontent.com/u/12257?v=4","gravatar_id":"","url":"https://api.github.com/users/eclecticdave","html_url":"https://github.com/eclecticdave","followers_url":"https://api.github.com/users/eclecticdave/followers","following_url":"https://api.github.com/users/eclecticdave/following{/other_user}","gists_url":"https://api.github.com/users/eclecticdave/gists{/gist_id}","starred_url":"https://api.github.com/users/eclecticdave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclecticdave/subscriptions","organizations_url":"https://api.github.com/users/eclecticdave/orgs","repos_url":"https://api.github.com/users/eclecticdave/repos","events_url":"https://api.github.com/users/eclecticdave/events{/privacy}","received_events_url":"https://api.github.com/users/eclecticdave/received_events","type":"User","site_admin":false},"body":"As discussed, this PR is the first part of PR #6003 split out and includes the implementation of rawPrint and rawPrintErr.\r\n\r\nThese methods print to stdout and stderr without requiring strings to be terminated with newlines. They have been added to the Module object for Node and to shell[_minimal].html for browsers. Unfortunately spidermonkey has no equivalent of putstr that prints to stderr so only rawPrint is implemented there.\r\n\r\nIn addition tty.read has been modified slightly to return when a whole line has been entered, rather than waiting for EOF.  On Node and SpiderMonkey, this makes input from stdin (e.g. scanf) work the same way as native terminals when run interactively.\r\n\r\nI've added a new test to the 'others' suite - test_stdin2.  This is a simple prompt and response program which demonstrates the changes.  Although it is setup to run under the test suite, it's really better run interactively, since it isn't so much important what it prints as when it flushes the output to the screen and running it as an automated test doesn't really capture that subtlety.  It runs best interactively under Node as the lack of rawPrintErr under Spidermonkey causes the last prompt to not be flushed until after the response is entered.\r\n\r\n* Implement rawPrint and rawPrintErr (see Issue #4366)\r\n* Some tests need modifying due to output changing validly because of\r\n  rawPrint:\r\n  - test_exceptions_uncaught_2 and test_remove - std:cout now no longer\r\n    automatically appends an eol, so added '<< std:endl' as needed.\r\n  - test_fs_trackingdelegate - printf, for reasons known only to itself,\r\n    splits its calls to 'write' into two, the first 26 characters followed\r\n    by the remaining 2 chars.  Since rawPrint does not buffer data across\r\n    calls to 'write', this results in the text 'Wrote to file \"/dev/tty\"'\r\n    getting output after the first 26 characters have been output.\r\n  - test_printf - line 'no_new_line' is now not followed with a new line,\r\n    this is valid - modified output.txt accordingly.\r\n  - test_rounding, test_simd15 - last printf now correctly doesn't emit a\r\n    new line - .out files modified accordingly.\r\n* Fix to make sure tty read returns on EOL, instead of requiring EOF.\r\n* New test test_stdin2 added.","created_at":"2018-01-15T03:01:17Z","updated_at":"2018-02-10T21:07:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a12945fedc2d45db28896988c006248c75847232","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kripken/emscripten/pulls/6080/commits","review_comments_url":"https://api.github.com/repos/kripken/emscripten/pulls/6080/comments","review_comment_url":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/6080/comments","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/10a7f6dd8000ccb760d42bbc329c1397a129d1be","head":{"label":"eclecticdave:topic-rawprint-impl","ref":"topic-rawprint-impl","sha":"10a7f6dd8000ccb760d42bbc329c1397a129d1be","user":{"login":"eclecticdave","id":12257,"avatar_url":"https://avatars2.githubusercontent.com/u/12257?v=4","gravatar_id":"","url":"https://api.github.com/users/eclecticdave","html_url":"https://github.com/eclecticdave","followers_url":"https://api.github.com/users/eclecticdave/followers","following_url":"https://api.github.com/users/eclecticdave/following{/other_user}","gists_url":"https://api.github.com/users/eclecticdave/gists{/gist_id}","starred_url":"https://api.github.com/users/eclecticdave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclecticdave/subscriptions","organizations_url":"https://api.github.com/users/eclecticdave/orgs","repos_url":"https://api.github.com/users/eclecticdave/repos","events_url":"https://api.github.com/users/eclecticdave/events{/privacy}","received_events_url":"https://api.github.com/users/eclecticdave/received_events","type":"User","site_admin":false},"repo":{"id":2736813,"name":"emscripten","full_name":"eclecticdave/emscripten","owner":{"login":"eclecticdave","id":12257,"avatar_url":"https://avatars2.githubusercontent.com/u/12257?v=4","gravatar_id":"","url":"https://api.github.com/users/eclecticdave","html_url":"https://github.com/eclecticdave","followers_url":"https://api.github.com/users/eclecticdave/followers","following_url":"https://api.github.com/users/eclecticdave/following{/other_user}","gists_url":"https://api.github.com/users/eclecticdave/gists{/gist_id}","starred_url":"https://api.github.com/users/eclecticdave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclecticdave/subscriptions","organizations_url":"https://api.github.com/users/eclecticdave/orgs","repos_url":"https://api.github.com/users/eclecticdave/repos","events_url":"https://api.github.com/users/eclecticdave/events{/privacy}","received_events_url":"https://api.github.com/users/eclecticdave/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eclecticdave/emscripten","description":"Emscripten: An LLVM-to-JavaScript Compiler","fork":true,"url":"https://api.github.com/repos/eclecticdave/emscripten","forks_url":"https://api.github.com/repos/eclecticdave/emscripten/forks","keys_url":"https://api.github.com/repos/eclecticdave/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclecticdave/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclecticdave/emscripten/teams","hooks_url":"https://api.github.com/repos/eclecticdave/emscripten/hooks","issue_events_url":"https://api.github.com/repos/eclecticdave/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/eclecticdave/emscripten/events","assignees_url":"https://api.github.com/repos/eclecticdave/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/eclecticdave/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/eclecticdave/emscripten/tags","blobs_url":"https://api.github.com/repos/eclecticdave/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclecticdave/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclecticdave/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclecticdave/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclecticdave/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/eclecticdave/emscripten/languages","stargazers_url":"https://api.github.com/repos/eclecticdave/emscripten/stargazers","contributors_url":"https://api.github.com/repos/eclecticdave/emscripten/contributors","subscribers_url":"https://api.github.com/repos/eclecticdave/emscripten/subscribers","subscription_url":"https://api.github.com/repos/eclecticdave/emscripten/subscription","commits_url":"https://api.github.com/repos/eclecticdave/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclecticdave/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclecticdave/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclecticdave/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclecticdave/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/eclecticdave/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclecticdave/emscripten/merges","archive_url":"https://api.github.com/repos/eclecticdave/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclecticdave/emscripten/downloads","issues_url":"https://api.github.com/repos/eclecticdave/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/eclecticdave/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/eclecticdave/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/eclecticdave/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclecticdave/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/eclecticdave/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/eclecticdave/emscripten/deployments","created_at":"2011-11-08T20:39:10Z","updated_at":"2017-12-28T20:38:31Z","pushed_at":"2018-02-06T21:51:12Z","git_url":"git://github.com/eclecticdave/emscripten.git","ssh_url":"git@github.com:eclecticdave/emscripten.git","clone_url":"https://github.com/eclecticdave/emscripten.git","svn_url":"https://github.com/eclecticdave/emscripten","homepage":"","size":152428,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"kripken:incoming","ref":"incoming","sha":"fa703b7390d3a790269eed9eeb3b56bb1b619d71","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"repo":{"id":1357796,"name":"emscripten","full_name":"kripken/emscripten","owner":{"login":"kripken","id":173661,"avatar_url":"https://avatars0.githubusercontent.com/u/173661?v=4","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kripken/emscripten","description":"Emscripten: An LLVM-to-JavaScript Compiler","fork":false,"url":"https://api.github.com/repos/kripken/emscripten","forks_url":"https://api.github.com/repos/kripken/emscripten/forks","keys_url":"https://api.github.com/repos/kripken/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kripken/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kripken/emscripten/teams","hooks_url":"https://api.github.com/repos/kripken/emscripten/hooks","issue_events_url":"https://api.github.com/repos/kripken/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/kripken/emscripten/events","assignees_url":"https://api.github.com/repos/kripken/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/kripken/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/kripken/emscripten/tags","blobs_url":"https://api.github.com/repos/kripken/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kripken/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kripken/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/kripken/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/kripken/emscripten/languages","stargazers_url":"https://api.github.com/repos/kripken/emscripten/stargazers","contributors_url":"https://api.github.com/repos/kripken/emscripten/contributors","subscribers_url":"https://api.github.com/repos/kripken/emscripten/subscribers","subscription_url":"https://api.github.com/repos/kripken/emscripten/subscription","commits_url":"https://api.github.com/repos/kripken/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/kripken/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/kripken/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/kripken/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/kripken/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/kripken/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kripken/emscripten/merges","archive_url":"https://api.github.com/repos/kripken/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kripken/emscripten/downloads","issues_url":"https://api.github.com/repos/kripken/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/kripken/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/kripken/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/kripken/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kripken/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/kripken/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/kripken/emscripten/deployments","created_at":"2011-02-12T05:23:30Z","updated_at":"2018-02-10T15:49:55Z","pushed_at":"2018-02-10T00:41:16Z","git_url":"git://github.com/kripken/emscripten.git","ssh_url":"git@github.com:kripken/emscripten.git","clone_url":"https://github.com/kripken/emscripten.git","svn_url":"https://github.com/kripken/emscripten","homepage":"","size":157837,"stargazers_count":14062,"watchers_count":14062,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1682,"mirror_url":null,"archived":false,"open_issues_count":1365,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1682,"open_issues":1365,"watchers":14062,"default_branch":"incoming"}},"_links":{"self":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/6080"},"html":{"href":"https://github.com/kripken/emscripten/pull/6080"},"issue":{"href":"https://api.github.com/repos/kripken/emscripten/issues/6080"},"comments":{"href":"https://api.github.com/repos/kripken/emscripten/issues/6080/comments"},"review_comments":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/6080/comments"},"review_comment":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/6080/commits"},"statuses":{"href":"https://api.github.com/repos/kripken/emscripten/statuses/10a7f6dd8000ccb760d42bbc329c1397a129d1be"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"eclecticdave"}}