Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shim Element in non-DOM environments #1387

Merged
merged 1 commit into from Jan 30, 2019
Merged

Shim Element in non-DOM environments #1387

merged 1 commit into from Jan 30, 2019

Conversation

fabianishere
Copy link
Contributor

  • Bug fix
  • New feature
  • Chore
  • Breaking change
  • There is an open issue which this change addresses
  • I have read the CONTRIBUTING document.
  • My commits follow the Git Commit Guidelines
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Hi,

The function DOMElement in utils.js throws a ReferenceError in non-DOM environments such as Node, due to the fact that it references Element on the right-hand side of an instanceof check, which is (most probably) undefined in non-DOM environments.

This pull request adds a small shim for the Element object in order to prevent DOMElement from throwing an error if Element is not defined.

This change shims the Element object in non-DOM environments to prevent
these environments from throwing errors when using `DOMElement` from
`util.js`, since it uses Element as right hand side in an `instanceof`
check, which fails for undefined values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants