From c55cb7843a134afff2f713fde7072ea4822be697 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 9 Jan 2021 16:32:23 +0100 Subject: [PATCH] LibJS: Use INVALID some more in abstract operations --- Libraries/LibJS/Runtime/Value.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibJS/Runtime/Value.cpp b/Libraries/LibJS/Runtime/Value.cpp index 9731ce80f7..ba6ef48478 100644 --- a/Libraries/LibJS/Runtime/Value.cpp +++ b/Libraries/LibJS/Runtime/Value.cpp @@ -480,7 +480,7 @@ double Value::to_double(GlobalObject& global_object) const { auto number = to_number(global_object); if (global_object.vm().exception()) - return 0; + return INVALID; return number.as_double(); } @@ -488,7 +488,7 @@ i32 Value::to_i32(GlobalObject& global_object) const { auto number = to_number(global_object); if (global_object.vm().exception()) - return 0; + return INVALID; if (number.is_nan() || number.is_infinity()) return 0; return number.as_i32();