Skip to content

fix: webidl.brandcheck non strict should throw - #2683

Merged
mcollina merged 7 commits into
nodejs:mainfrom
Uzlopak:fix-webidl-brandcheck
Feb 5, 2024
Merged

fix: webidl.brandcheck non strict should throw#2683
mcollina merged 7 commits into
nodejs:mainfrom
Uzlopak:fix-webidl-brandcheck

Conversation

@Uzlopak

@Uzlopak Uzlopak commented Feb 1, 2024

Copy link
Copy Markdown
Contributor

It is very strange, that in case of strict: false brandCheck would not throw, but in strict cases it would throw.

We use the non strict brandCheck e.g.

webidl.brandCheck(headers, Headers, { strict: false })

The non strict check is basically a no op, as nothing happens with the result. I assume this was just an oversight.

I would actually recommend for performance reasons to implement a webidl.brandCheckLax (or something like that) and make webidl.brandCheck only handle strict cases.

This relates to...

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

@ronag
ronag requested a review from KhafraDev February 1, 2024 07:52
@Uzlopak
Uzlopak force-pushed the fix-webidl-brandcheck branch from 0b8d8e3 to 678f0f4 Compare February 1, 2024 08:36
@codecov-commenter

codecov-commenter commented Feb 1, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.29%. Comparing base (e39a632) to head (2fe3a7d).
⚠️ Report is 1374 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2683      +/-   ##
==========================================
- Coverage   85.54%   85.29%   -0.26%     
==========================================
  Files          76       84       +8     
  Lines        6858     7582     +724     
==========================================
+ Hits         5867     6467     +600     
- Misses        991     1115     +124     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina

mcollina commented Feb 1, 2024

Copy link
Copy Markdown
Member

A test would be nice.

@Uzlopak

Uzlopak commented Feb 3, 2024

Copy link
Copy Markdown
Contributor Author

@mcollina
Added test

Comment thread test/cookie/cookies.js Outdated
@Uzlopak

Uzlopak commented Feb 3, 2024

Copy link
Copy Markdown
Contributor Author

added for the other three cookie functions tests.

@Uzlopak

Uzlopak commented Feb 3, 2024

Copy link
Copy Markdown
Contributor Author

@KhafraDev

What do you think about having an additional brandCheckLax webidl method for performance reasons?

@KhafraDev

Copy link
Copy Markdown
Member

👎

@Uzlopak

Uzlopak commented Feb 4, 2024

Copy link
Copy Markdown
Contributor Author

Ok, but this PR is fine so far, right?

I guess we could merge it then after the security release?

@KhafraDev

Copy link
Copy Markdown
Member

yep, waiting on the security release

@mcollina
mcollina merged commit 2cc38ad into nodejs:main Feb 5, 2024
@Uzlopak
Uzlopak deleted the fix-webidl-brandcheck branch February 5, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet