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

Throw TypeError if methods are called using the wrong context object #140

Open
bwrrp opened this issue Feb 8, 2022 · 1 comment
Open

Comments

@bwrrp
Copy link
Owner

bwrrp commented Feb 8, 2022

For example:

const createComment = document.createComment;
createComment('data');

Firefox throws in this case: Uncaught TypeError: 'createComment' called on an object that does not implement interface Document.

@bwrrp
Copy link
Owner Author

bwrrp commented Feb 8, 2022

Implementing this check may be a good idea, because currently this causes very subtle errors - the comment in the example will have an undefined ownerDocument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant