jquery/sizzle — pull request #256 by jure (2014-04-09 23:15:33+00:00)
Title: Fix 'TypeError: undefined is not a function' for attributes on comments.

I came across this when jQuery events, fired on removal of elements from DOM, were further filtered with a selector which looked at attribute names, e.g.:

```
$(document).on('DOMNodeRemoved', '[data-tooltip]:not(a)', function (e) {});
```

If the element being removed from DOM was a comment node, nodeType == 8, a `TypeError: undefined is not a function` was raised on line 873 of sizzle.js: https://github.com/jquery/sizzle/blob/a64d52ae4432385464206e2777f418dc892e7218/dist/sizzle.js#L873

That happens because comment nodes don't have the getAttribute() method, for example:

```
document.getElementsByTagName('body')[0].getAttribute('test')
null
```
but:
```
document.createComment('hello').getAttribute('test')
TypeError: undefined is not a function
```

Here's the minimal test case in a plunker: http://plnkr.co/edit/ABY0BMXO2DXa2NCYy1cJ?p=preview

I've added a minimal test case to utilties.js unit tests and a fix to sizzle.js.

I'd be more than happy to work on this a bit more, if you think this is not a viable fix. But all specs pass and it works for me :)

P.S.: I saw that Zepto had to implement something similar: https://github.com/buddydvd/zepto/commit/6508ed1f6d81e9dc039e2c85a879c61aa5b2fc80