mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibJS: Make more use of Value::is and Value::as_if in JS runtime
This commit is contained in:
committed by
Shannon Booth
parent
cadba4c0e7
commit
d7e828a366
Notes:
github-actions[bot]
2026-02-27 16:20:55 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d7e828a3661 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8208 Reviewed-by: https://github.com/shannonbooth ✅
@@ -57,7 +57,7 @@ ThrowCompletionOr<GC::Ref<Object>> SharedArrayBufferConstructor::construct(Funct
|
||||
|
||||
if (byte_length_or_error.is_error()) {
|
||||
auto error = byte_length_or_error.release_error();
|
||||
if (error.value().is_object() && is<RangeError>(error.value().as_object())) {
|
||||
if (error.value().is<RangeError>()) {
|
||||
// Re-throw more specific RangeError
|
||||
return vm.throw_completion<RangeError>(ErrorType::InvalidLength, "shared array buffer");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user