{"action":"closed","issue":{"url":"https://api.github.com/repos/tmpvar/jsdom/issues/1015","labels_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1015/labels{/name}","comments_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1015/comments","events_url":"https://api.github.com/repos/tmpvar/jsdom/issues/1015/events","html_url":"https://github.com/tmpvar/jsdom/issues/1015","id":56541527,"number":1015,"title":"isEqualNode crashes","user":{"login":"jbblanchet","id":2847338,"avatar_url":"https://avatars.githubusercontent.com/u/2847338?v=3","gravatar_id":"","url":"https://api.github.com/users/jbblanchet","html_url":"https://github.com/jbblanchet","followers_url":"https://api.github.com/users/jbblanchet/followers","following_url":"https://api.github.com/users/jbblanchet/following{/other_user}","gists_url":"https://api.github.com/users/jbblanchet/gists{/gist_id}","starred_url":"https://api.github.com/users/jbblanchet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbblanchet/subscriptions","organizations_url":"https://api.github.com/users/jbblanchet/orgs","repos_url":"https://api.github.com/users/jbblanchet/repos","events_url":"https://api.github.com/users/jbblanchet/events{/privacy}","received_events_url":"https://api.github.com/users/jbblanchet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tmpvar/jsdom/labels/bug","name":"bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-04T15:29:17Z","updated_at":"2015-02-09T05:03:21Z","closed_at":"2015-02-09T05:03:21Z","body":"The following code crashes with `TypeError: Object [ undefined ] has no method 'item'` :\r\n\r\n```javascript\r\nvar jsdom = require(\"jsdom\");\r\n\r\njsdom.env({\r\n    html: \"<html><body><div class='test'></div><div class='test'></div></body></html>\",\r\n    scripts: ['http://code.jquery.com/jquery-2.1.3.min.js'],\r\n    done:  function (err, window) {\r\n        var $ = window.jQuery;\r\n        var $elems = $(\".test\");\r\n        console.log($elems[0].isEqualNode($elems[1]));\r\n    }\r\n});\r\n```\r\n\r\nI've tracked down the error to line 246 of jsdom\\level3\\core.js (mainly because my console says that the error happens on line 246 of that file! :bowtie:) where we access the properties of both node lists for comparison (onl and snl) using onl.item(i) instead of onl[i].\r\n\r\nIt seems like a rather simple problem to fix, but since this code has been there for 3 years, I find it surprising that I'm the first one to encounter the error, so I thought I'd ask to check if I was doing something wrong first."}}