{"action":"created","comment":{"url":"https://api.github.com/repos/jashkenas/underscore/pulls/comments/39476201","id":39476201,"diff_hunk":"@@ -436,6 +436,18 @@\n   _.toArray = function(obj) {\n     if (!obj) return [];\n     if (_.isArray(obj)) return slice.call(obj);\n+    if (_.isString(obj)) {\n+      // Keep surrogate pair characters together\n+      // https://mathiasbynens.be/notes/javascript-unicode\n+      return _.reduce(obj, function (output, char, idx) {\n+        if (idx > 0 && obj[idx-1].match(/[\\uD800-\\uDBFF]/) && char.match(/[\\uDC00-\\uDFFF]/)) {\n+          output.push(output.pop() + char);","path":"underscore.js","position":null,"original_position":9,"commit_id":"7234aa34fb803bbfb307d2998be0e72a391c48be","original_commit_id":"252fb59f5df2a7c4f873b7f6b38c99bcaf8f3d31","user":{"login":"michaelficarra","id":218840,"avatar_url":"https://avatars.githubusercontent.com/u/218840?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelficarra","html_url":"https://github.com/michaelficarra","followers_url":"https://api.github.com/users/michaelficarra/followers","following_url":"https://api.github.com/users/michaelficarra/following{/other_user}","gists_url":"https://api.github.com/users/michaelficarra/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelficarra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelficarra/subscriptions","organizations_url":"https://api.github.com/users/michaelficarra/orgs","repos_url":"https://api.github.com/users/michaelficarra/repos","events_url":"https://api.github.com/users/michaelficarra/events{/privacy}","received_events_url":"https://api.github.com/users/michaelficarra/received_events","type":"User","site_admin":false},"body":"Why?","created_at":"2015-09-15T05:41:54Z","updated_at":"2015-09-15T05:41:54Z","html_url":"https://github.com/jashkenas/underscore/pull/2298#discussion_r39476201","pull_request_url":"https://api.github.com/repos/jashkenas/underscore/pulls/2298","_links":{"self":{"href":"https://api.github.com/repos/jashkenas/underscore/pulls/comments/39476201"},"html":{"href":"https://github.com/jashkenas/underscore/pull/2298#discussion_r39476201"},"pull_request":{"href":"https://api.github.com/repos/jashkenas/underscore/pulls/2298"}}},"pull_request":{"url":"https://api.github.com/repos/jashkenas/underscore/pulls/2298","id":45009840,"html_url":"https://github.com/jashkenas/underscore/pull/2298","diff_url":"https://github.com/jashkenas/underscore/pull/2298.diff","patch_url":"https://github.com/jashkenas/underscore/pull/2298.patch","issue_url":"https://api.github.com/repos/jashkenas/underscore/issues/2298","number":2298,"state":"open","locked":false,"title":"Maintain astral characters in _.toArray","user":{"login":"JonAbrams","id":1243092,"avatar_url":"https://avatars.githubusercontent.com/u/1243092?v=3","gravatar_id":"","url":"https://api.github.com/users/JonAbrams","html_url":"https://github.com/JonAbrams","followers_url":"https://api.github.com/users/JonAbrams/followers","following_url":"https://api.github.com/users/JonAbrams/following{/other_user}","gists_url":"https://api.github.com/users/JonAbrams/gists{/gist_id}","starred_url":"https://api.github.com/users/JonAbrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonAbrams/subscriptions","organizations_url":"https://api.github.com/users/JonAbrams/orgs","repos_url":"https://api.github.com/users/JonAbrams/repos","events_url":"https://api.github.com/users/JonAbrams/events{/privacy}","received_events_url":"https://api.github.com/users/JonAbrams/received_events","type":"User","site_admin":false},"body":"Fixes #2296","created_at":"2015-09-15T05:16:44Z","updated_at":"2015-09-15T05:41:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66c6f8f9d4f8e8504f589e916798ec0d89083188","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jashkenas/underscore/pulls/2298/commits","review_comments_url":"https://api.github.com/repos/jashkenas/underscore/pulls/2298/comments","review_comment_url":"https://api.github.com/repos/jashkenas/underscore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jashkenas/underscore/issues/2298/comments","statuses_url":"https://api.github.com/repos/jashkenas/underscore/statuses/7234aa34fb803bbfb307d2998be0e72a391c48be","head":{"label":"JonAbrams:master","ref":"master","sha":"7234aa34fb803bbfb307d2998be0e72a391c48be","user":{"login":"JonAbrams","id":1243092,"avatar_url":"https://avatars.githubusercontent.com/u/1243092?v=3","gravatar_id":"","url":"https://api.github.com/users/JonAbrams","html_url":"https://github.com/JonAbrams","followers_url":"https://api.github.com/users/JonAbrams/followers","following_url":"https://api.github.com/users/JonAbrams/following{/other_user}","gists_url":"https://api.github.com/users/JonAbrams/gists{/gist_id}","starred_url":"https://api.github.com/users/JonAbrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonAbrams/subscriptions","organizations_url":"https://api.github.com/users/JonAbrams/orgs","repos_url":"https://api.github.com/users/JonAbrams/repos","events_url":"https://api.github.com/users/JonAbrams/events{/privacy}","received_events_url":"https://api.github.com/users/JonAbrams/received_events","type":"User","site_admin":false},"repo":{"id":9420611,"name":"underscore","full_name":"JonAbrams/underscore","owner":{"login":"JonAbrams","id":1243092,"avatar_url":"https://avatars.githubusercontent.com/u/1243092?v=3","gravatar_id":"","url":"https://api.github.com/users/JonAbrams","html_url":"https://github.com/JonAbrams","followers_url":"https://api.github.com/users/JonAbrams/followers","following_url":"https://api.github.com/users/JonAbrams/following{/other_user}","gists_url":"https://api.github.com/users/JonAbrams/gists{/gist_id}","starred_url":"https://api.github.com/users/JonAbrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonAbrams/subscriptions","organizations_url":"https://api.github.com/users/JonAbrams/orgs","repos_url":"https://api.github.com/users/JonAbrams/repos","events_url":"https://api.github.com/users/JonAbrams/events{/privacy}","received_events_url":"https://api.github.com/users/JonAbrams/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JonAbrams/underscore","description":"JavaScript's utility _ belt","fork":true,"url":"https://api.github.com/repos/JonAbrams/underscore","forks_url":"https://api.github.com/repos/JonAbrams/underscore/forks","keys_url":"https://api.github.com/repos/JonAbrams/underscore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JonAbrams/underscore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JonAbrams/underscore/teams","hooks_url":"https://api.github.com/repos/JonAbrams/underscore/hooks","issue_events_url":"https://api.github.com/repos/JonAbrams/underscore/issues/events{/number}","events_url":"https://api.github.com/repos/JonAbrams/underscore/events","assignees_url":"https://api.github.com/repos/JonAbrams/underscore/assignees{/user}","branches_url":"https://api.github.com/repos/JonAbrams/underscore/branches{/branch}","tags_url":"https://api.github.com/repos/JonAbrams/underscore/tags","blobs_url":"https://api.github.com/repos/JonAbrams/underscore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JonAbrams/underscore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JonAbrams/underscore/git/refs{/sha}","trees_url":"https://api.github.com/repos/JonAbrams/underscore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JonAbrams/underscore/statuses/{sha}","languages_url":"https://api.github.com/repos/JonAbrams/underscore/languages","stargazers_url":"https://api.github.com/repos/JonAbrams/underscore/stargazers","contributors_url":"https://api.github.com/repos/JonAbrams/underscore/contributors","subscribers_url":"https://api.github.com/repos/JonAbrams/underscore/subscribers","subscription_url":"https://api.github.com/repos/JonAbrams/underscore/subscription","commits_url":"https://api.github.com/repos/JonAbrams/underscore/commits{/sha}","git_commits_url":"https://api.github.com/repos/JonAbrams/underscore/git/commits{/sha}","comments_url":"https://api.github.com/repos/JonAbrams/underscore/comments{/number}","issue_comment_url":"https://api.github.com/repos/JonAbrams/underscore/issues/comments{/number}","contents_url":"https://api.github.com/repos/JonAbrams/underscore/contents/{+path}","compare_url":"https://api.github.com/repos/JonAbrams/underscore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JonAbrams/underscore/merges","archive_url":"https://api.github.com/repos/JonAbrams/underscore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JonAbrams/underscore/downloads","issues_url":"https://api.github.com/repos/JonAbrams/underscore/issues{/number}","pulls_url":"https://api.github.com/repos/JonAbrams/underscore/pulls{/number}","milestones_url":"https://api.github.com/repos/JonAbrams/underscore/milestones{/number}","notifications_url":"https://api.github.com/repos/JonAbrams/underscore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JonAbrams/underscore/labels{/name}","releases_url":"https://api.github.com/repos/JonAbrams/underscore/releases{/id}","created_at":"2013-04-13T21:46:14Z","updated_at":"2015-08-04T05:42:23Z","pushed_at":"2015-09-15T05:27:55Z","git_url":"git://github.com/JonAbrams/underscore.git","ssh_url":"git@github.com:JonAbrams/underscore.git","clone_url":"https://github.com/JonAbrams/underscore.git","svn_url":"https://github.com/JonAbrams/underscore","homepage":"http://underscorejs.org","size":5128,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jashkenas:master","ref":"master","sha":"60e0188892e8f9dd410abefa58ffe7788e9ae4fe","user":{"login":"jashkenas","id":4732,"avatar_url":"https://avatars.githubusercontent.com/u/4732?v=3","gravatar_id":"","url":"https://api.github.com/users/jashkenas","html_url":"https://github.com/jashkenas","followers_url":"https://api.github.com/users/jashkenas/followers","following_url":"https://api.github.com/users/jashkenas/following{/other_user}","gists_url":"https://api.github.com/users/jashkenas/gists{/gist_id}","starred_url":"https://api.github.com/users/jashkenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jashkenas/subscriptions","organizations_url":"https://api.github.com/users/jashkenas/orgs","repos_url":"https://api.github.com/users/jashkenas/repos","events_url":"https://api.github.com/users/jashkenas/events{/privacy}","received_events_url":"https://api.github.com/users/jashkenas/received_events","type":"User","site_admin":false},"repo":{"id":349241,"name":"underscore","full_name":"jashkenas/underscore","owner":{"login":"jashkenas","id":4732,"avatar_url":"https://avatars.githubusercontent.com/u/4732?v=3","gravatar_id":"","url":"https://api.github.com/users/jashkenas","html_url":"https://github.com/jashkenas","followers_url":"https://api.github.com/users/jashkenas/followers","following_url":"https://api.github.com/users/jashkenas/following{/other_user}","gists_url":"https://api.github.com/users/jashkenas/gists{/gist_id}","starred_url":"https://api.github.com/users/jashkenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jashkenas/subscriptions","organizations_url":"https://api.github.com/users/jashkenas/orgs","repos_url":"https://api.github.com/users/jashkenas/repos","events_url":"https://api.github.com/users/jashkenas/events{/privacy}","received_events_url":"https://api.github.com/users/jashkenas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jashkenas/underscore","description":"JavaScript's utility _ belt","fork":false,"url":"https://api.github.com/repos/jashkenas/underscore","forks_url":"https://api.github.com/repos/jashkenas/underscore/forks","keys_url":"https://api.github.com/repos/jashkenas/underscore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jashkenas/underscore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jashkenas/underscore/teams","hooks_url":"https://api.github.com/repos/jashkenas/underscore/hooks","issue_events_url":"https://api.github.com/repos/jashkenas/underscore/issues/events{/number}","events_url":"https://api.github.com/repos/jashkenas/underscore/events","assignees_url":"https://api.github.com/repos/jashkenas/underscore/assignees{/user}","branches_url":"https://api.github.com/repos/jashkenas/underscore/branches{/branch}","tags_url":"https://api.github.com/repos/jashkenas/underscore/tags","blobs_url":"https://api.github.com/repos/jashkenas/underscore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jashkenas/underscore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jashkenas/underscore/git/refs{/sha}","trees_url":"https://api.github.com/repos/jashkenas/underscore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jashkenas/underscore/statuses/{sha}","languages_url":"https://api.github.com/repos/jashkenas/underscore/languages","stargazers_url":"https://api.github.com/repos/jashkenas/underscore/stargazers","contributors_url":"https://api.github.com/repos/jashkenas/underscore/contributors","subscribers_url":"https://api.github.com/repos/jashkenas/underscore/subscribers","subscription_url":"https://api.github.com/repos/jashkenas/underscore/subscription","commits_url":"https://api.github.com/repos/jashkenas/underscore/commits{/sha}","git_commits_url":"https://api.github.com/repos/jashkenas/underscore/git/commits{/sha}","comments_url":"https://api.github.com/repos/jashkenas/underscore/comments{/number}","issue_comment_url":"https://api.github.com/repos/jashkenas/underscore/issues/comments{/number}","contents_url":"https://api.github.com/repos/jashkenas/underscore/contents/{+path}","compare_url":"https://api.github.com/repos/jashkenas/underscore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jashkenas/underscore/merges","archive_url":"https://api.github.com/repos/jashkenas/underscore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jashkenas/underscore/downloads","issues_url":"https://api.github.com/repos/jashkenas/underscore/issues{/number}","pulls_url":"https://api.github.com/repos/jashkenas/underscore/pulls{/number}","milestones_url":"https://api.github.com/repos/jashkenas/underscore/milestones{/number}","notifications_url":"https://api.github.com/repos/jashkenas/underscore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jashkenas/underscore/labels{/name}","releases_url":"https://api.github.com/repos/jashkenas/underscore/releases{/id}","created_at":"2009-10-25T18:31:06Z","updated_at":"2015-09-15T04:37:25Z","pushed_at":"2015-09-15T05:27:56Z","git_url":"git://github.com/jashkenas/underscore.git","ssh_url":"git@github.com:jashkenas/underscore.git","clone_url":"https://github.com/jashkenas/underscore.git","svn_url":"https://github.com/jashkenas/underscore","homepage":"http://underscorejs.org","size":14218,"stargazers_count":15775,"watchers_count":15775,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3530,"mirror_url":null,"open_issues_count":57,"forks":3530,"open_issues":57,"watchers":15775,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jashkenas/underscore/pulls/2298"},"html":{"href":"https://github.com/jashkenas/underscore/pull/2298"},"issue":{"href":"https://api.github.com/repos/jashkenas/underscore/issues/2298"},"comments":{"href":"https://api.github.com/repos/jashkenas/underscore/issues/2298/comments"},"review_comments":{"href":"https://api.github.com/repos/jashkenas/underscore/pulls/2298/comments"},"review_comment":{"href":"https://api.github.com/repos/jashkenas/underscore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jashkenas/underscore/pulls/2298/commits"},"statuses":{"href":"https://api.github.com/repos/jashkenas/underscore/statuses/7234aa34fb803bbfb307d2998be0e72a391c48be"}}}}