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

LibWeb: Include code point in error message for ByteString conversion #2775

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Libraries/LibWeb/WebIDL/AbstractOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ JS::ThrowCompletionOr<String> to_byte_string(JS::VM& vm, JS::Value value)
// 2. If the value of any element of x is greater than 255, then throw a TypeError.
for (auto character : x.code_points()) {
if (character > 0xFF)
return vm.throw_completion<JS::TypeError>(JS::ErrorType::InvalidCodePoint);
return vm.throw_completion<JS::TypeError>(MUST(String::formatted("Invalid code point {}, must be integers in the range 0-255 (U+0000-U+00FF).", String::from_code_point(character))));
}

// 3. Return an IDL ByteString value whose length is the length of x, and where the value of each element is the value of the corresponding element of x.
Expand Down
Loading