LibJS: Make more use of Value::is and Value::as_if in JS runtime

This commit is contained in:
Timothy Flynn
2026-02-27 10:05:55 -05:00
committed by Shannon Booth
parent cadba4c0e7
commit d7e828a366
Notes: github-actions[bot] 2026-02-27 16:20:55 +00:00
31 changed files with 109 additions and 145 deletions

View File

@@ -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");
}