From c399d6a5b66fd63f3e7e2e76c65b2d8656428681 Mon Sep 17 00:00:00 2001 From: yossydev Date: Thu, 30 Jan 2025 23:02:00 +0900 Subject: [PATCH] chore: update --- .../text_processing/string_objects/string_constructor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_constructor.rs b/nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_constructor.rs index 9debc39b..2ee1a7d0 100644 --- a/nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_constructor.rs +++ b/nova_vm/src/ecmascript/builtins/text_processing/string_objects/string_constructor.rs @@ -186,7 +186,7 @@ impl StringConstructor { unreachable!(); }; let next_cp = next_cp.into_i64(); - if next_cp < 0 || next_cp > 0x10FFFF { + if !(0..=0x10FFFF).contains(&next_cp) { return Err(agent.throw_exception( ExceptionType::RangeError, format!("{:?} is not a valid code point", next_cp), @@ -210,7 +210,7 @@ impl StringConstructor { unreachable!(); }; let next_cp = next_cp.into_i64(); - if next_cp < 0 || next_cp > 0x10FFFF { + if !(0..=0x10FFFF).contains(&next_cp) { return Err(agent.throw_exception( ExceptionType::RangeError, format!("{:?} is not a valid code point", next_cp),