{"action":"created","comment":{"url":"https://api.github.com/repos/iojs/io.js/pulls/comments/29475965","id":29475965,"diff_hunk":"@@ -24,7 +24,7 @@ exports.createInterface = function(input, output, completer, terminal) {\n };\n \n \n-function Interface(input, output, completer, terminal) {\n+function Interface(input, output, completer, terminal, historySize) {","path":"lib/readline.js","position":5,"original_position":5,"commit_id":"2985c8d8687df16b11333472053febee80bacf7b","original_commit_id":"2985c8d8687df16b11333472053febee80bacf7b","user":{"login":"chrisdickinson","id":37303,"avatar_url":"https://avatars.githubusercontent.com/u/37303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdickinson","html_url":"https://github.com/chrisdickinson","followers_url":"https://api.github.com/users/chrisdickinson/followers","following_url":"https://api.github.com/users/chrisdickinson/following{/other_user}","gists_url":"https://api.github.com/users/chrisdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdickinson/subscriptions","organizations_url":"https://api.github.com/users/chrisdickinson/orgs","repos_url":"https://api.github.com/users/chrisdickinson/repos","events_url":"https://api.github.com/users/chrisdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdickinson/received_events","type":"User","site_admin":false},"body":"We should add that to the v3.0.0 milestone, I think.","created_at":"2015-04-30T22:15:35Z","updated_at":"2015-04-30T22:15:35Z","html_url":"https://github.com/iojs/io.js/pull/1513#discussion_r29475965","pull_request_url":"https://api.github.com/repos/iojs/io.js/pulls/1513","_links":{"self":{"href":"https://api.github.com/repos/iojs/io.js/pulls/comments/29475965"},"html":{"href":"https://github.com/iojs/io.js/pull/1513#discussion_r29475965"},"pull_request":{"href":"https://api.github.com/repos/iojs/io.js/pulls/1513"}}},"pull_request":{"url":"https://api.github.com/repos/iojs/io.js/pulls/1513","id":34000605,"html_url":"https://github.com/iojs/io.js/pull/1513","diff_url":"https://github.com/iojs/io.js/pull/1513.diff","patch_url":"https://github.com/iojs/io.js/pull/1513.patch","issue_url":"https://api.github.com/repos/iojs/io.js/issues/1513","number":1513,"state":"open","locked":false,"title":"REPL – Add \"magic\" mode detection, persistent history support","user":{"login":"chrisdickinson","id":37303,"avatar_url":"https://avatars.githubusercontent.com/u/37303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdickinson","html_url":"https://github.com/chrisdickinson","followers_url":"https://api.github.com/users/chrisdickinson/followers","following_url":"https://api.github.com/users/chrisdickinson/following{/other_user}","gists_url":"https://api.github.com/users/chrisdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdickinson/subscriptions","organizations_url":"https://api.github.com/users/chrisdickinson/orgs","repos_url":"https://api.github.com/users/chrisdickinson/repos","events_url":"https://api.github.com/users/chrisdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdickinson/received_events","type":"User","site_admin":false},"body":"This PR adds two public API features: the ability to configure the maximum history size of readline, and the ability to change the \"mode\" a REPL is started in – where \"mode\" may be \"strict mode\", \"sloppy mode\", or \"magic / auto-detect mode\". Auto-detect mode catches SyntaxErrors due to V8's lack of support for certain constructs (classes, let, and const) outside of strict mode, and retries the utterance in strict mode. User REPLs default to \"sloppy mode\" as before.\r\n\r\nIt also adds an internal module that controls the built-in CLI REPL. This module augments the REPL instance with the following features:\r\n\r\n1. If `NODE_REPL_HISTORY` is set to a file path, it will attempt to use that file to back up history in JSON format. This punts on the painful issue of trying to determine a user's home directory in a cross-platform way.\r\n2. If `NODE_REPL_HISTORY` is not set, pressing \"up\" (or \"ctrl p\") in the CLI REPL when there are no other lines in history will print instructions on how to set up persistent history support. It will only print this message once per session. The goal is to capture intent and communicate a way to enable support.\r\n3. If `NODE_REPL_MODE` is set, it will start the REPL in that mode. The options are `strict`, `sloppy`, and `magic`. If not given, the REPL will start in \"magic\" mode. The goal is to reduce surprise when folks get the new V8 and try to write a class in the REPL immediately.\r\n4. If `NODE_REPL_HISTORY_SIZE` is set and is a Number, it will set the maximum history to that size.\r\n\r\nNone of these features interact in any way with the REPL module, and are strictly additive for the CLI *only*.\r\n\r\nPutting this up for an early review to make sure the features (and approach) are acceptable.\r\n\r\nR=@rvagg\r\n\r\n#### history example\r\n\r\n![just-a-test](https://cloud.githubusercontent.com/assets/37303/7308326/5a77126a-e9c8-11e4-9165-fbcfff811a74.gif)\r\n\r\n#### modes example\r\n\r\nFirst, \"sloppy\" mode (default as of old iojs), then \"strict\" mode, then \"magic\" mode.\r\n\r\n![modes](https://cloud.githubusercontent.com/assets/37303/7308632/169ed566-e9cb-11e4-84bf-18888662df51.gif)","created_at":"2015-04-23T21:51:54Z","updated_at":"2015-04-30T22:15:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8c30bd7f35a1e5c8ab94f999e9a368104e86a1a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/iojs/io.js/pulls/1513/commits","review_comments_url":"https://api.github.com/repos/iojs/io.js/pulls/1513/comments","review_comment_url":"https://api.github.com/repos/iojs/io.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/1513/comments","statuses_url":"https://api.github.com/repos/iojs/io.js/statuses/2985c8d8687df16b11333472053febee80bacf7b","head":{"label":"chrisdickinson:improve-repl","ref":"improve-repl","sha":"2985c8d8687df16b11333472053febee80bacf7b","user":{"login":"chrisdickinson","id":37303,"avatar_url":"https://avatars.githubusercontent.com/u/37303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdickinson","html_url":"https://github.com/chrisdickinson","followers_url":"https://api.github.com/users/chrisdickinson/followers","following_url":"https://api.github.com/users/chrisdickinson/following{/other_user}","gists_url":"https://api.github.com/users/chrisdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdickinson/subscriptions","organizations_url":"https://api.github.com/users/chrisdickinson/orgs","repos_url":"https://api.github.com/users/chrisdickinson/repos","events_url":"https://api.github.com/users/chrisdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdickinson/received_events","type":"User","site_admin":false},"repo":{"id":27841890,"name":"io.js","full_name":"chrisdickinson/io.js","owner":{"login":"chrisdickinson","id":37303,"avatar_url":"https://avatars.githubusercontent.com/u/37303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdickinson","html_url":"https://github.com/chrisdickinson","followers_url":"https://api.github.com/users/chrisdickinson/followers","following_url":"https://api.github.com/users/chrisdickinson/following{/other_user}","gists_url":"https://api.github.com/users/chrisdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdickinson/subscriptions","organizations_url":"https://api.github.com/users/chrisdickinson/orgs","repos_url":"https://api.github.com/users/chrisdickinson/repos","events_url":"https://api.github.com/users/chrisdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdickinson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrisdickinson/io.js","description":"Evented IO for V8 JavaScript","fork":true,"url":"https://api.github.com/repos/chrisdickinson/io.js","forks_url":"https://api.github.com/repos/chrisdickinson/io.js/forks","keys_url":"https://api.github.com/repos/chrisdickinson/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrisdickinson/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrisdickinson/io.js/teams","hooks_url":"https://api.github.com/repos/chrisdickinson/io.js/hooks","issue_events_url":"https://api.github.com/repos/chrisdickinson/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/chrisdickinson/io.js/events","assignees_url":"https://api.github.com/repos/chrisdickinson/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/chrisdickinson/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/chrisdickinson/io.js/tags","blobs_url":"https://api.github.com/repos/chrisdickinson/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrisdickinson/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrisdickinson/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrisdickinson/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrisdickinson/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/chrisdickinson/io.js/languages","stargazers_url":"https://api.github.com/repos/chrisdickinson/io.js/stargazers","contributors_url":"https://api.github.com/repos/chrisdickinson/io.js/contributors","subscribers_url":"https://api.github.com/repos/chrisdickinson/io.js/subscribers","subscription_url":"https://api.github.com/repos/chrisdickinson/io.js/subscription","commits_url":"https://api.github.com/repos/chrisdickinson/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrisdickinson/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrisdickinson/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrisdickinson/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrisdickinson/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/chrisdickinson/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrisdickinson/io.js/merges","archive_url":"https://api.github.com/repos/chrisdickinson/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrisdickinson/io.js/downloads","issues_url":"https://api.github.com/repos/chrisdickinson/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/chrisdickinson/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/chrisdickinson/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/chrisdickinson/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrisdickinson/io.js/labels{/name}","releases_url":"https://api.github.com/repos/chrisdickinson/io.js/releases{/id}","created_at":"2014-12-10T22:02:21Z","updated_at":"2014-12-10T22:02:25Z","pushed_at":"2015-04-30T19:08:30Z","git_url":"git://github.com/chrisdickinson/io.js.git","ssh_url":"git@github.com:chrisdickinson/io.js.git","clone_url":"https://github.com/chrisdickinson/io.js.git","svn_url":"https://github.com/chrisdickinson/io.js","homepage":null,"size":128268,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"v0.12"}},"base":{"label":"iojs:master","ref":"master","sha":"3d3083b91f02ca14acddde97612cec98e97ffe38","user":{"login":"iojs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/iojs","html_url":"https://github.com/iojs","followers_url":"https://api.github.com/users/iojs/followers","following_url":"https://api.github.com/users/iojs/following{/other_user}","gists_url":"https://api.github.com/users/iojs/gists{/gist_id}","starred_url":"https://api.github.com/users/iojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iojs/subscriptions","organizations_url":"https://api.github.com/users/iojs/orgs","repos_url":"https://api.github.com/users/iojs/repos","events_url":"https://api.github.com/users/iojs/events{/privacy}","received_events_url":"https://api.github.com/users/iojs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"io.js","full_name":"iojs/io.js","owner":{"login":"iojs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/iojs","html_url":"https://github.com/iojs","followers_url":"https://api.github.com/users/iojs/followers","following_url":"https://api.github.com/users/iojs/following{/other_user}","gists_url":"https://api.github.com/users/iojs/gists{/gist_id}","starred_url":"https://api.github.com/users/iojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iojs/subscriptions","organizations_url":"https://api.github.com/users/iojs/orgs","repos_url":"https://api.github.com/users/iojs/repos","events_url":"https://api.github.com/users/iojs/events{/privacy}","received_events_url":"https://api.github.com/users/iojs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iojs/io.js","description":"A friendly fork of Node.js with an open governance model","fork":false,"url":"https://api.github.com/repos/iojs/io.js","forks_url":"https://api.github.com/repos/iojs/io.js/forks","keys_url":"https://api.github.com/repos/iojs/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iojs/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iojs/io.js/teams","hooks_url":"https://api.github.com/repos/iojs/io.js/hooks","issue_events_url":"https://api.github.com/repos/iojs/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/iojs/io.js/events","assignees_url":"https://api.github.com/repos/iojs/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/iojs/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/iojs/io.js/tags","blobs_url":"https://api.github.com/repos/iojs/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iojs/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iojs/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/iojs/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iojs/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/iojs/io.js/languages","stargazers_url":"https://api.github.com/repos/iojs/io.js/stargazers","contributors_url":"https://api.github.com/repos/iojs/io.js/contributors","subscribers_url":"https://api.github.com/repos/iojs/io.js/subscribers","subscription_url":"https://api.github.com/repos/iojs/io.js/subscription","commits_url":"https://api.github.com/repos/iojs/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/iojs/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/iojs/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/iojs/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/iojs/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/iojs/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iojs/io.js/merges","archive_url":"https://api.github.com/repos/iojs/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iojs/io.js/downloads","issues_url":"https://api.github.com/repos/iojs/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/iojs/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/iojs/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/iojs/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iojs/io.js/labels{/name}","releases_url":"https://api.github.com/repos/iojs/io.js/releases{/id}","created_at":"2014-11-26T19:57:11Z","updated_at":"2015-04-30T20:46:42Z","pushed_at":"2015-04-30T22:11:30Z","git_url":"git://github.com/iojs/io.js.git","ssh_url":"git@github.com:iojs/io.js.git","clone_url":"https://github.com/iojs/io.js.git","svn_url":"https://github.com/iojs/io.js","homepage":"https://iojs.org","size":175520,"stargazers_count":11909,"watchers_count":11909,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":851,"mirror_url":null,"open_issues_count":249,"forks":851,"open_issues":249,"watchers":11909,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/iojs/io.js/pulls/1513"},"html":{"href":"https://github.com/iojs/io.js/pull/1513"},"issue":{"href":"https://api.github.com/repos/iojs/io.js/issues/1513"},"comments":{"href":"https://api.github.com/repos/iojs/io.js/issues/1513/comments"},"review_comments":{"href":"https://api.github.com/repos/iojs/io.js/pulls/1513/comments"},"review_comment":{"href":"https://api.github.com/repos/iojs/io.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iojs/io.js/pulls/1513/commits"},"statuses":{"href":"https://api.github.com/repos/iojs/io.js/statuses/2985c8d8687df16b11333472053febee80bacf7b"}}}}