{"action":"created","comment":{"url":"https://api.github.com/repos/erzu/yen/pulls/comments/31216799","id":31216799,"diff_hunk":"@@ -109,7 +109,13 @@ function _findMatchingElements(selector, context, firstMatch) {\n   var selectedElements = []\n \n   if (/^#[a-z]+$/i.test(selector)){  // 优化单独的ID选择器\n-    el = doc.getElementById(selector.slice(1))\n+    if (typeof context.getElementById === \"function\") {\n+      el = context.getElementById(selector.slice(1))\n+    }\n+    else {\n+      el = doc.getElementById(selector.slice(1))\n+    }\n+","path":"index.js","position":11,"original_position":11,"commit_id":"59f71b99d102336633b4738b8ecda0ec86d484e3","original_commit_id":"59f71b99d102336633b4738b8ecda0ec86d484e3","user":{"login":"dotnil","id":252317,"avatar_url":"https://avatars.githubusercontent.com/u/252317?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnil","html_url":"https://github.com/dotnil","followers_url":"https://api.github.com/users/dotnil/followers","following_url":"https://api.github.com/users/dotnil/following{/other_user}","gists_url":"https://api.github.com/users/dotnil/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnil/subscriptions","organizations_url":"https://api.github.com/users/dotnil/orgs","repos_url":"https://api.github.com/users/dotnil/repos","events_url":"https://api.github.com/users/dotnil/events{/privacy}","received_events_url":"https://api.github.com/users/dotnil/received_events","type":"User","site_admin":false},"body":"我明白你的意思了，搞个","created_at":"2015-05-28T09:29:47Z","updated_at":"2015-05-28T09:29:47Z","html_url":"https://github.com/erzu/yen/pull/3#discussion_r31216799","pull_request_url":"https://api.github.com/repos/erzu/yen/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/erzu/yen/pulls/comments/31216799"},"html":{"href":"https://github.com/erzu/yen/pull/3#discussion_r31216799"},"pull_request":{"href":"https://api.github.com/repos/erzu/yen/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/erzu/yen/pulls/3","id":36376435,"html_url":"https://github.com/erzu/yen/pull/3","diff_url":"https://github.com/erzu/yen/pull/3.diff","patch_url":"https://github.com/erzu/yen/pull/3.patch","issue_url":"https://api.github.com/repos/erzu/yen/issues/3","number":3,"state":"open","locked":false,"title":"check getElementById method on context","user":{"login":"kfitfk","id":2555626,"avatar_url":"https://avatars.githubusercontent.com/u/2555626?v=3","gravatar_id":"","url":"https://api.github.com/users/kfitfk","html_url":"https://github.com/kfitfk","followers_url":"https://api.github.com/users/kfitfk/followers","following_url":"https://api.github.com/users/kfitfk/following{/other_user}","gists_url":"https://api.github.com/users/kfitfk/gists{/gist_id}","starred_url":"https://api.github.com/users/kfitfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfitfk/subscriptions","organizations_url":"https://api.github.com/users/kfitfk/orgs","repos_url":"https://api.github.com/users/kfitfk/repos","events_url":"https://api.github.com/users/kfitfk/events{/privacy}","received_events_url":"https://api.github.com/users/kfitfk/received_events","type":"User","site_admin":false},"body":"判断 context 上是否有 `getElementById`，若有，ID 选择器用 context 提供的方法。","created_at":"2015-05-28T06:47:59Z","updated_at":"2015-05-28T09:29:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fdeda1cc2a5ff5a75f5ff25a4281b83e5a67fa86","assignee":{"login":"ziyunfei","id":1276859,"avatar_url":"https://avatars.githubusercontent.com/u/1276859?v=3","gravatar_id":"","url":"https://api.github.com/users/ziyunfei","html_url":"https://github.com/ziyunfei","followers_url":"https://api.github.com/users/ziyunfei/followers","following_url":"https://api.github.com/users/ziyunfei/following{/other_user}","gists_url":"https://api.github.com/users/ziyunfei/gists{/gist_id}","starred_url":"https://api.github.com/users/ziyunfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziyunfei/subscriptions","organizations_url":"https://api.github.com/users/ziyunfei/orgs","repos_url":"https://api.github.com/users/ziyunfei/repos","events_url":"https://api.github.com/users/ziyunfei/events{/privacy}","received_events_url":"https://api.github.com/users/ziyunfei/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/erzu/yen/pulls/3/commits","review_comments_url":"https://api.github.com/repos/erzu/yen/pulls/3/comments","review_comment_url":"https://api.github.com/repos/erzu/yen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/erzu/yen/issues/3/comments","statuses_url":"https://api.github.com/repos/erzu/yen/statuses/59f71b99d102336633b4738b8ecda0ec86d484e3","head":{"label":"erzu:fix-id-selector-context","ref":"fix-id-selector-context","sha":"59f71b99d102336633b4738b8ecda0ec86d484e3","user":{"login":"erzu","id":10845163,"avatar_url":"https://avatars.githubusercontent.com/u/10845163?v=3","gravatar_id":"","url":"https://api.github.com/users/erzu","html_url":"https://github.com/erzu","followers_url":"https://api.github.com/users/erzu/followers","following_url":"https://api.github.com/users/erzu/following{/other_user}","gists_url":"https://api.github.com/users/erzu/gists{/gist_id}","starred_url":"https://api.github.com/users/erzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erzu/subscriptions","organizations_url":"https://api.github.com/users/erzu/orgs","repos_url":"https://api.github.com/users/erzu/repos","events_url":"https://api.github.com/users/erzu/events{/privacy}","received_events_url":"https://api.github.com/users/erzu/received_events","type":"Organization","site_admin":false},"repo":{"id":30289516,"name":"yen","full_name":"erzu/yen","owner":{"login":"erzu","id":10845163,"avatar_url":"https://avatars.githubusercontent.com/u/10845163?v=3","gravatar_id":"","url":"https://api.github.com/users/erzu","html_url":"https://github.com/erzu","followers_url":"https://api.github.com/users/erzu/followers","following_url":"https://api.github.com/users/erzu/following{/other_user}","gists_url":"https://api.github.com/users/erzu/gists{/gist_id}","starred_url":"https://api.github.com/users/erzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erzu/subscriptions","organizations_url":"https://api.github.com/users/erzu/orgs","repos_url":"https://api.github.com/users/erzu/repos","events_url":"https://api.github.com/users/erzu/events{/privacy}","received_events_url":"https://api.github.com/users/erzu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/erzu/yen","description":"jQuery inspired DOM selection and manipulation library","fork":false,"url":"https://api.github.com/repos/erzu/yen","forks_url":"https://api.github.com/repos/erzu/yen/forks","keys_url":"https://api.github.com/repos/erzu/yen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erzu/yen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erzu/yen/teams","hooks_url":"https://api.github.com/repos/erzu/yen/hooks","issue_events_url":"https://api.github.com/repos/erzu/yen/issues/events{/number}","events_url":"https://api.github.com/repos/erzu/yen/events","assignees_url":"https://api.github.com/repos/erzu/yen/assignees{/user}","branches_url":"https://api.github.com/repos/erzu/yen/branches{/branch}","tags_url":"https://api.github.com/repos/erzu/yen/tags","blobs_url":"https://api.github.com/repos/erzu/yen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erzu/yen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erzu/yen/git/refs{/sha}","trees_url":"https://api.github.com/repos/erzu/yen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erzu/yen/statuses/{sha}","languages_url":"https://api.github.com/repos/erzu/yen/languages","stargazers_url":"https://api.github.com/repos/erzu/yen/stargazers","contributors_url":"https://api.github.com/repos/erzu/yen/contributors","subscribers_url":"https://api.github.com/repos/erzu/yen/subscribers","subscription_url":"https://api.github.com/repos/erzu/yen/subscription","commits_url":"https://api.github.com/repos/erzu/yen/commits{/sha}","git_commits_url":"https://api.github.com/repos/erzu/yen/git/commits{/sha}","comments_url":"https://api.github.com/repos/erzu/yen/comments{/number}","issue_comment_url":"https://api.github.com/repos/erzu/yen/issues/comments{/number}","contents_url":"https://api.github.com/repos/erzu/yen/contents/{+path}","compare_url":"https://api.github.com/repos/erzu/yen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erzu/yen/merges","archive_url":"https://api.github.com/repos/erzu/yen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erzu/yen/downloads","issues_url":"https://api.github.com/repos/erzu/yen/issues{/number}","pulls_url":"https://api.github.com/repos/erzu/yen/pulls{/number}","milestones_url":"https://api.github.com/repos/erzu/yen/milestones{/number}","notifications_url":"https://api.github.com/repos/erzu/yen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erzu/yen/labels{/name}","releases_url":"https://api.github.com/repos/erzu/yen/releases{/id}","created_at":"2015-02-04T08:43:08Z","updated_at":"2015-05-27T06:24:00Z","pushed_at":"2015-05-28T06:47:59Z","git_url":"git://github.com/erzu/yen.git","ssh_url":"git@github.com:erzu/yen.git","clone_url":"https://github.com/erzu/yen.git","svn_url":"https://github.com/erzu/yen","homepage":"","size":152,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"erzu:master","ref":"master","sha":"4cf15b1ff2fec4130c08308335a40c92551d1636","user":{"login":"erzu","id":10845163,"avatar_url":"https://avatars.githubusercontent.com/u/10845163?v=3","gravatar_id":"","url":"https://api.github.com/users/erzu","html_url":"https://github.com/erzu","followers_url":"https://api.github.com/users/erzu/followers","following_url":"https://api.github.com/users/erzu/following{/other_user}","gists_url":"https://api.github.com/users/erzu/gists{/gist_id}","starred_url":"https://api.github.com/users/erzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erzu/subscriptions","organizations_url":"https://api.github.com/users/erzu/orgs","repos_url":"https://api.github.com/users/erzu/repos","events_url":"https://api.github.com/users/erzu/events{/privacy}","received_events_url":"https://api.github.com/users/erzu/received_events","type":"Organization","site_admin":false},"repo":{"id":30289516,"name":"yen","full_name":"erzu/yen","owner":{"login":"erzu","id":10845163,"avatar_url":"https://avatars.githubusercontent.com/u/10845163?v=3","gravatar_id":"","url":"https://api.github.com/users/erzu","html_url":"https://github.com/erzu","followers_url":"https://api.github.com/users/erzu/followers","following_url":"https://api.github.com/users/erzu/following{/other_user}","gists_url":"https://api.github.com/users/erzu/gists{/gist_id}","starred_url":"https://api.github.com/users/erzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erzu/subscriptions","organizations_url":"https://api.github.com/users/erzu/orgs","repos_url":"https://api.github.com/users/erzu/repos","events_url":"https://api.github.com/users/erzu/events{/privacy}","received_events_url":"https://api.github.com/users/erzu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/erzu/yen","description":"jQuery inspired DOM selection and manipulation library","fork":false,"url":"https://api.github.com/repos/erzu/yen","forks_url":"https://api.github.com/repos/erzu/yen/forks","keys_url":"https://api.github.com/repos/erzu/yen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erzu/yen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erzu/yen/teams","hooks_url":"https://api.github.com/repos/erzu/yen/hooks","issue_events_url":"https://api.github.com/repos/erzu/yen/issues/events{/number}","events_url":"https://api.github.com/repos/erzu/yen/events","assignees_url":"https://api.github.com/repos/erzu/yen/assignees{/user}","branches_url":"https://api.github.com/repos/erzu/yen/branches{/branch}","tags_url":"https://api.github.com/repos/erzu/yen/tags","blobs_url":"https://api.github.com/repos/erzu/yen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erzu/yen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erzu/yen/git/refs{/sha}","trees_url":"https://api.github.com/repos/erzu/yen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erzu/yen/statuses/{sha}","languages_url":"https://api.github.com/repos/erzu/yen/languages","stargazers_url":"https://api.github.com/repos/erzu/yen/stargazers","contributors_url":"https://api.github.com/repos/erzu/yen/contributors","subscribers_url":"https://api.github.com/repos/erzu/yen/subscribers","subscription_url":"https://api.github.com/repos/erzu/yen/subscription","commits_url":"https://api.github.com/repos/erzu/yen/commits{/sha}","git_commits_url":"https://api.github.com/repos/erzu/yen/git/commits{/sha}","comments_url":"https://api.github.com/repos/erzu/yen/comments{/number}","issue_comment_url":"https://api.github.com/repos/erzu/yen/issues/comments{/number}","contents_url":"https://api.github.com/repos/erzu/yen/contents/{+path}","compare_url":"https://api.github.com/repos/erzu/yen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erzu/yen/merges","archive_url":"https://api.github.com/repos/erzu/yen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erzu/yen/downloads","issues_url":"https://api.github.com/repos/erzu/yen/issues{/number}","pulls_url":"https://api.github.com/repos/erzu/yen/pulls{/number}","milestones_url":"https://api.github.com/repos/erzu/yen/milestones{/number}","notifications_url":"https://api.github.com/repos/erzu/yen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erzu/yen/labels{/name}","releases_url":"https://api.github.com/repos/erzu/yen/releases{/id}","created_at":"2015-02-04T08:43:08Z","updated_at":"2015-05-27T06:24:00Z","pushed_at":"2015-05-28T06:47:59Z","git_url":"git://github.com/erzu/yen.git","ssh_url":"git@github.com:erzu/yen.git","clone_url":"https://github.com/erzu/yen.git","svn_url":"https://github.com/erzu/yen","homepage":"","size":152,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/erzu/yen/pulls/3"},"html":{"href":"https://github.com/erzu/yen/pull/3"},"issue":{"href":"https://api.github.com/repos/erzu/yen/issues/3"},"comments":{"href":"https://api.github.com/repos/erzu/yen/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/erzu/yen/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/erzu/yen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/erzu/yen/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/erzu/yen/statuses/59f71b99d102336633b4738b8ecda0ec86d484e3"}}}}