diff options
author | Linus Groh <mail@linusgroh.de> | 2021-01-09 16:32:23 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-09 19:09:02 +0100 |
commit | c55cb7843a134afff2f713fde7072ea4822be697 (patch) | |
tree | db4e56b207ba0bcba60f0a656bf0b2403428a417 | |
parent | 8ff0afd829a54f067ce63cf6e443aae95124ac6b (diff) | |
download | serenity-c55cb7843a134afff2f713fde7072ea4822be697.zip |
LibJS: Use INVALID some more in abstract operations
-rw-r--r-- | Libraries/LibJS/Runtime/Value.cpp | 4 |
1 files 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(); |