Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
lib: add brand checks to AbortController and AbortSignal#37720
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
lib: add brand checks to AbortController and AbortSignal #37720
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Ethan-Arrowood left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM!
aduh95 commented Mar 13, 2021
Can you add tests? |
MattiasBuelens commented Mar 14, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@aduh95 Ah, I see, there's a
|
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Antoine du Hamel <[email protected]>
Co-authored-by: James M Snell <[email protected]>
aduh95 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
IDL tests do not test against "bad"
thiscontexts in method calls
It may be worth opening a PR to add those tests upstream to make sure the behaviour stays consistent.
MattiasBuelens commented Mar 16, 2021
Okay, so my correction on my initial assumption was wrong. 😅 As Domenic pointed out, the IDL harness does try to call getters and methods with a "bad" receiver to check if they throw a Once Node can run the IDL tests, we can remove these newly added tests. But for now, they are necessary, so I'll leave them in. |
nodejs-github-bot commented Mar 18, 2021
nodejs-github-bot commented Mar 19, 2021
PR-URL: #37720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
jasnell commented Mar 19, 2021
Landed in feaeb76 |
PR-URL: #37720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: nodejs#37720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: nodejs#37720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: nodejs#37720 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #37720 Backport-PR-URL: #38386 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
Web IDL specifies that both attributes and operations of IDL interfaces should throw a
TypeErrorifthisdoes not implement the interface. These brand checks were missing forAbortControllerandAbortSignal(as noticed here), so I added them.Unfortunately, this is not straightforward to test. WPT has an IDL test for this, but it's bunched up together with other IDL tests for
EventTarget,EventandCustomEvent. Node supports the first two but not the last one, so the test would still fail. 😕 Suggestions are welcome!