Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

fromEvent is broken in IE8 when used with querySelectorAll #725

@apiv

Description

@apiv

I've been using RxJS with great success so far in a project that needs to support IE8. I've recently found an issue with Rx.Observable.fromEvent in IE8. This issue prevents using fromEvent with querySelectorAll. I've also found a fix for that problem, which I've included in this pull request.

To explain what's wrong with IE8:

  • document.querySelectorAll returns a StaticNodeList instead of NodeList
  • Object.prototype.toString.call() works differently in IE8:
// In IE8
// Assume `obj` is an instanceof NodeList
console.log(Object.prototype.toString.call(obj)) // => '[object Object]'
console.log(Object.prototype.toString.call(obj.constructor) // => '[object NodeList]'
console.log(Object.prototype.toString.call(MyClass)) // => '[object NodeList]'

// In an actual web browser
// Assume `obj` is an instanceof NodeList
console.log(Object.prototype.toString.call(obj)) // => '[object NodeList]'
console.log(Object.prototype.toString.call(obj.constructor)) // => '[object Function]'
console.log(Object.prototype.toString.call(MyClass)) // => '[object Function]'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions