Skip to content

Conversation

@Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Feb 1, 2024

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
Copy link

codecov-commenter commented Feb 1, 2024

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
Copy link
Member

mcollina commented Feb 1, 2024

A test would be nice.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Feb 3, 2024

@mcollina
Added test

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Feb 3, 2024

added for the other three cookie functions tests.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Feb 3, 2024

@KhafraDev

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

@KhafraDev
Copy link
Member

👎

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Feb 4, 2024

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

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

@KhafraDev
Copy link
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants