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

Refactor: remove function type check #1036

Open
TomBinford opened this issue May 3, 2023 · 0 comments
Open

Refactor: remove function type check #1036

TomBinford opened this issue May 3, 2023 · 0 comments
Labels
refactor Refactoring & cleanup

Comments

@TomBinford
Copy link
Contributor

This commit introduced the following check:

// check if getsrcdoc is a function
if (!getSrcDoc && {}.toString.call(getSrcDoc) === '[object Function]') {
return null;
}

This was meant to verify that getSrcDoc() is safe to run, but

  1. It should be !(getSrcDoc && ... ); as written the condition is never true.
  2. We supply getSrcDoc so we'd get an exception and find the problem ourselves if getSrcDoc is not a function. The check isn't any more useful than an exception being thrown.
@TomBinford TomBinford added the refactor Refactoring & cleanup label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactoring & cleanup
Projects
None yet
Development

No branches or pull requests

1 participant