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

Fix a false JSError reported by Phantomas #1296

Merged
merged 2 commits into from
Jul 31, 2023

Conversation

gmetais
Copy link
Contributor

@gmetais gmetais commented Jul 18, 2023

Hi there!

I noticed that Phantomas was (rarely) reporting a JS error that doesn't exist in real browsers.

If the document.getElementsByTagName() function is called with an incorrect value (such as undefined or null), browsers fail silently while Phantomas adds the following error to the JSErrors metric: Cannot read properties of undefined (reading 'toLowerCase').

Here is a fix. No urgency in publishing that fix in a new version.

@macbre macbre added the bug label Jul 31, 2023
Comment on lines +13 to +18
// thoses ones should not fail (as in a real browser)
document.getElementsByTagName(undefined);
document.getElementById(undefined);
document.getElementsByClassName(undefined);
document.querySelector(undefined);
</script>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@macbre macbre merged commit c4b4bb2 into macbre:devel Jul 31, 2023
@gmetais gmetais deleted the fix-false-js-errors branch July 31, 2023 11:35
gmetais added a commit to gmetais/phantomas that referenced this pull request Aug 13, 2023
macbre added a commit that referenced this pull request Sep 18, 2023
* Build(deps): bump coverallsapp/github-action from 2.2.0 to 2.2.1 (#171)

Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](coverallsapp/github-action@v2.2.0...v2.2.1)

---
updated-dependencies:
- dependency-name: coverallsapp/github-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Build(deps): bump puppeteer from 20.8.1 to 20.8.3 (#172)

Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 20.8.1 to 20.8.3.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](puppeteer/puppeteer@puppeteer-v20.8.1...puppeteer-v20.8.3)

---
updated-dependencies:
- dependency-name: puppeteer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Build(deps): bump puppeteer from 20.8.3 to 20.9.0 (#173)

Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 20.8.3 to 20.9.0.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](puppeteer/puppeteer@puppeteer-v20.8.3...puppeteer-v20.9.0)

---
updated-dependencies:
- dependency-name: puppeteer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add AVIF as an image type (#1299)

Co-authored-by: Maciej Brencz <[email protected]>

* Fix a false JSError reported by Phantomas (#1296)

Co-authored-by: Maciej Brencz <[email protected]>

* v2.9.0

* (deps) bump puppeteer to v21.0.2

* Update from upstream
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update from upstream

* Introduce a new analyze-images module with a few rules

* Linter / prettifier / make-docs

* Update package.json + package-lock.json

* Fix package-lock.json

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maciej Brencz <[email protected]>
Co-authored-by: macbre <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants