{"action":"created","comment":{"url":"https://api.github.com/repos/jadejs/jade-runtime/pulls/comments/36586247","id":36586247,"diff_hunk":"@@ -96,12 +96,21 @@ function jade_classes(val, escaping) {\n \n exports.style = jade_style;\n function jade_style(val) {\n-  if (val && typeof val === 'object') {\n-    return Object.keys(val).map(function (style) {\n-      return style + ':' + val[style];\n-    }).join(';');\n+  if (!val) return '';\n+  if (typeof val === 'object') {\n+    var out = '', delim = '';\n+    for (var style in val) {\n+      /* istanbul ignore else */\n+      if (val.hasOwnProperty(style)) {\n+        out = out + delim + style + ':' + val[style];\n+        delim = ';';\n+      }\n+    }\n+    return out;\n   } else {\n-    return ('' + (val || '')).replace(/\\;$/, '');\n+    val = '' + val;","path":"index.js","position":21,"original_position":21,"commit_id":"c10183c8513dcd89626940f0827e8b97fd974b1c","original_commit_id":"c10183c8513dcd89626940f0827e8b97fd974b1c","user":{"login":"alubbe","id":2028065,"avatar_url":"https://avatars.githubusercontent.com/u/2028065?v=3","gravatar_id":"","url":"https://api.github.com/users/alubbe","html_url":"https://github.com/alubbe","followers_url":"https://api.github.com/users/alubbe/followers","following_url":"https://api.github.com/users/alubbe/following{/other_user}","gists_url":"https://api.github.com/users/alubbe/gists{/gist_id}","starred_url":"https://api.github.com/users/alubbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alubbe/subscriptions","organizations_url":"https://api.github.com/users/alubbe/orgs","repos_url":"https://api.github.com/users/alubbe/repos","events_url":"https://api.github.com/users/alubbe/events{/privacy}","received_events_url":"https://api.github.com/users/alubbe/received_events","type":"User","site_admin":false},"body":"Do we really need this? AFAIK, jade_style wants to take strings or objects, right? Weird cases like undefined or null (or even `''`) are already filtered out by line 99.","created_at":"2015-08-09T10:17:26Z","updated_at":"2015-08-09T10:17:26Z","html_url":"https://github.com/jadejs/jade-runtime/pull/6#discussion_r36586247","pull_request_url":"https://api.github.com/repos/jadejs/jade-runtime/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/jadejs/jade-runtime/pulls/comments/36586247"},"html":{"href":"https://github.com/jadejs/jade-runtime/pull/6#discussion_r36586247"},"pull_request":{"href":"https://api.github.com/repos/jadejs/jade-runtime/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/jadejs/jade-runtime/pulls/6","id":41953540,"html_url":"https://github.com/jadejs/jade-runtime/pull/6","diff_url":"https://github.com/jadejs/jade-runtime/pull/6.diff","patch_url":"https://github.com/jadejs/jade-runtime/pull/6.patch","issue_url":"https://api.github.com/repos/jadejs/jade-runtime/issues/6","number":6,"state":"open","locked":false,"title":"Optimize jade_style","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"body":"```\r\nInput                             | Time per 10^7 run (ms)\r\n----------------------------------|------------------------\r\n'padding: 8px; margin: 9px'       |  500 =>   55\r\n'padding: 8px; margin: 9px;'      |  705 =>  206\r\n{ padding: '8px', margin: '9px' } | 6930 => 2119\r\n{}                                | 3614 =>  205\r\n```","created_at":"2015-08-08T12:37:02Z","updated_at":"2015-08-09T10:17:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4576a8747f5785b1faf3dbe88708e25f7aa370c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jadejs/jade-runtime/pulls/6/commits","review_comments_url":"https://api.github.com/repos/jadejs/jade-runtime/pulls/6/comments","review_comment_url":"https://api.github.com/repos/jadejs/jade-runtime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jadejs/jade-runtime/issues/6/comments","statuses_url":"https://api.github.com/repos/jadejs/jade-runtime/statuses/c10183c8513dcd89626940f0827e8b97fd974b1c","head":{"label":"jadejs:optimizeStyle","ref":"optimizeStyle","sha":"c10183c8513dcd89626940f0827e8b97fd974b1c","user":{"login":"jadejs","id":9338635,"avatar_url":"https://avatars.githubusercontent.com/u/9338635?v=3","gravatar_id":"","url":"https://api.github.com/users/jadejs","html_url":"https://github.com/jadejs","followers_url":"https://api.github.com/users/jadejs/followers","following_url":"https://api.github.com/users/jadejs/following{/other_user}","gists_url":"https://api.github.com/users/jadejs/gists{/gist_id}","starred_url":"https://api.github.com/users/jadejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadejs/subscriptions","organizations_url":"https://api.github.com/users/jadejs/orgs","repos_url":"https://api.github.com/users/jadejs/repos","events_url":"https://api.github.com/users/jadejs/events{/privacy}","received_events_url":"https://api.github.com/users/jadejs/received_events","type":"Organization","site_admin":false},"repo":{"id":28568087,"name":"jade-runtime","full_name":"jadejs/jade-runtime","owner":{"login":"jadejs","id":9338635,"avatar_url":"https://avatars.githubusercontent.com/u/9338635?v=3","gravatar_id":"","url":"https://api.github.com/users/jadejs","html_url":"https://github.com/jadejs","followers_url":"https://api.github.com/users/jadejs/followers","following_url":"https://api.github.com/users/jadejs/following{/other_user}","gists_url":"https://api.github.com/users/jadejs/gists{/gist_id}","starred_url":"https://api.github.com/users/jadejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadejs/subscriptions","organizations_url":"https://api.github.com/users/jadejs/orgs","repos_url":"https://api.github.com/users/jadejs/repos","events_url":"https://api.github.com/users/jadejs/events{/privacy}","received_events_url":"https://api.github.com/users/jadejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jadejs/jade-runtime","description":"The runtime for the jade compiler","fork":false,"url":"https://api.github.com/repos/jadejs/jade-runtime","forks_url":"https://api.github.com/repos/jadejs/jade-runtime/forks","keys_url":"https://api.github.com/repos/jadejs/jade-runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jadejs/jade-runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jadejs/jade-runtime/teams","hooks_url":"https://api.github.com/repos/jadejs/jade-runtime/hooks","issue_events_url":"https://api.github.com/repos/jadejs/jade-runtime/issues/events{/number}","events_url":"https://api.github.com/repos/jadejs/jade-runtime/events","assignees_url":"https://api.github.com/repos/jadejs/jade-runtime/assignees{/user}","branches_url":"https://api.github.com/repos/jadejs/jade-runtime/branches{/branch}","tags_url":"https://api.github.com/repos/jadejs/jade-runtime/tags","blobs_url":"https://api.github.com/repos/jadejs/jade-runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jadejs/jade-runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jadejs/jade-runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/jadejs/jade-runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jadejs/jade-runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/jadejs/jade-runtime/languages","stargazers_url":"https://api.github.com/repos/jadejs/jade-runtime/stargazers","contributors_url":"https://api.github.com/repos/jadejs/jade-runtime/contributors","subscribers_url":"https://api.github.com/repos/jadejs/jade-runtime/subscribers","subscription_url":"https://api.github.com/repos/jadejs/jade-runtime/subscription","commits_url":"https://api.github.com/repos/jadejs/jade-runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/jadejs/jade-runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/jadejs/jade-runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/jadejs/jade-runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/jadejs/jade-runtime/contents/{+path}","compare_url":"https://api.github.com/repos/jadejs/jade-runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jadejs/jade-runtime/merges","archive_url":"https://api.github.com/repos/jadejs/jade-runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jadejs/jade-runtime/downloads","issues_url":"https://api.github.com/repos/jadejs/jade-runtime/issues{/number}","pulls_url":"https://api.github.com/repos/jadejs/jade-runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/jadejs/jade-runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/jadejs/jade-runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jadejs/jade-runtime/labels{/name}","releases_url":"https://api.github.com/repos/jadejs/jade-runtime/releases{/id}","created_at":"2014-12-28T18:06:35Z","updated_at":"2014-12-28T18:07:06Z","pushed_at":"2015-08-09T00:33:39Z","git_url":"git://github.com/jadejs/jade-runtime.git","ssh_url":"git@github.com:jadejs/jade-runtime.git","clone_url":"https://github.com/jadejs/jade-runtime.git","svn_url":"https://github.com/jadejs/jade-runtime","homepage":null,"size":136,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"jadejs:master","ref":"master","sha":"25824b738b84c13a36d9a05e3c30be82991e41ef","user":{"login":"jadejs","id":9338635,"avatar_url":"https://avatars.githubusercontent.com/u/9338635?v=3","gravatar_id":"","url":"https://api.github.com/users/jadejs","html_url":"https://github.com/jadejs","followers_url":"https://api.github.com/users/jadejs/followers","following_url":"https://api.github.com/users/jadejs/following{/other_user}","gists_url":"https://api.github.com/users/jadejs/gists{/gist_id}","starred_url":"https://api.github.com/users/jadejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadejs/subscriptions","organizations_url":"https://api.github.com/users/jadejs/orgs","repos_url":"https://api.github.com/users/jadejs/repos","events_url":"https://api.github.com/users/jadejs/events{/privacy}","received_events_url":"https://api.github.com/users/jadejs/received_events","type":"Organization","site_admin":false},"repo":{"id":28568087,"name":"jade-runtime","full_name":"jadejs/jade-runtime","owner":{"login":"jadejs","id":9338635,"avatar_url":"https://avatars.githubusercontent.com/u/9338635?v=3","gravatar_id":"","url":"https://api.github.com/users/jadejs","html_url":"https://github.com/jadejs","followers_url":"https://api.github.com/users/jadejs/followers","following_url":"https://api.github.com/users/jadejs/following{/other_user}","gists_url":"https://api.github.com/users/jadejs/gists{/gist_id}","starred_url":"https://api.github.com/users/jadejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadejs/subscriptions","organizations_url":"https://api.github.com/users/jadejs/orgs","repos_url":"https://api.github.com/users/jadejs/repos","events_url":"https://api.github.com/users/jadejs/events{/privacy}","received_events_url":"https://api.github.com/users/jadejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jadejs/jade-runtime","description":"The runtime for the jade compiler","fork":false,"url":"https://api.github.com/repos/jadejs/jade-runtime","forks_url":"https://api.github.com/repos/jadejs/jade-runtime/forks","keys_url":"https://api.github.com/repos/jadejs/jade-runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jadejs/jade-runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jadejs/jade-runtime/teams","hooks_url":"https://api.github.com/repos/jadejs/jade-runtime/hooks","issue_events_url":"https://api.github.com/repos/jadejs/jade-runtime/issues/events{/number}","events_url":"https://api.github.com/repos/jadejs/jade-runtime/events","assignees_url":"https://api.github.com/repos/jadejs/jade-runtime/assignees{/user}","branches_url":"https://api.github.com/repos/jadejs/jade-runtime/branches{/branch}","tags_url":"https://api.github.com/repos/jadejs/jade-runtime/tags","blobs_url":"https://api.github.com/repos/jadejs/jade-runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jadejs/jade-runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jadejs/jade-runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/jadejs/jade-runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jadejs/jade-runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/jadejs/jade-runtime/languages","stargazers_url":"https://api.github.com/repos/jadejs/jade-runtime/stargazers","contributors_url":"https://api.github.com/repos/jadejs/jade-runtime/contributors","subscribers_url":"https://api.github.com/repos/jadejs/jade-runtime/subscribers","subscription_url":"https://api.github.com/repos/jadejs/jade-runtime/subscription","commits_url":"https://api.github.com/repos/jadejs/jade-runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/jadejs/jade-runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/jadejs/jade-runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/jadejs/jade-runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/jadejs/jade-runtime/contents/{+path}","compare_url":"https://api.github.com/repos/jadejs/jade-runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jadejs/jade-runtime/merges","archive_url":"https://api.github.com/repos/jadejs/jade-runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jadejs/jade-runtime/downloads","issues_url":"https://api.github.com/repos/jadejs/jade-runtime/issues{/number}","pulls_url":"https://api.github.com/repos/jadejs/jade-runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/jadejs/jade-runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/jadejs/jade-runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jadejs/jade-runtime/labels{/name}","releases_url":"https://api.github.com/repos/jadejs/jade-runtime/releases{/id}","created_at":"2014-12-28T18:06:35Z","updated_at":"2014-12-28T18:07:06Z","pushed_at":"2015-08-09T00:33:39Z","git_url":"git://github.com/jadejs/jade-runtime.git","ssh_url":"git@github.com:jadejs/jade-runtime.git","clone_url":"https://github.com/jadejs/jade-runtime.git","svn_url":"https://github.com/jadejs/jade-runtime","homepage":null,"size":136,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jadejs/jade-runtime/pulls/6"},"html":{"href":"https://github.com/jadejs/jade-runtime/pull/6"},"issue":{"href":"https://api.github.com/repos/jadejs/jade-runtime/issues/6"},"comments":{"href":"https://api.github.com/repos/jadejs/jade-runtime/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/jadejs/jade-runtime/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/jadejs/jade-runtime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jadejs/jade-runtime/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/jadejs/jade-runtime/statuses/c10183c8513dcd89626940f0827e8b97fd974b1c"}}}}