Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
LibWeb: Make ShadowRealm importValue work #2556
LibWeb: Make ShadowRealm importValue work #2556
Changes from all commits
9c04a4b
e962237
075fbc6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 makes me wonder why we use
Optional<T&>
at allThere 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.
🤔 Perhaps we should try to make it harder to assign an xvalue or rvalue to an optional T&? @alimpfard any thoughts on how to check for that in AK?
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.
?
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.
const rvalue is a nonsense qualifier, but otherwise yeah, that looks like it would do the trick. + some test coverage, that would make a nice PR
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.
You have to go out of your way to make a
const&&
, but if you manage to, it would pick theU const&
overU&&
. Anyway, that code doesn't compile right now, an "incompatible operand types" error in LibWeb.I also notice there is already existing code to try and prevent these kinds of assignments, but I guess it isn't working correctly:
https://github.com/LadybirdBrowser/ladybird/blob/master/AK/Optional.h#L449-L457