From a0d97139b9fe890f15b67ceedcd33b80110f6386 Mon Sep 17 00:00:00 2001 From: raskad <32105367+raskad@users.noreply.github.com> Date: Wed, 28 Jul 2021 02:40:23 +0200 Subject: [PATCH] Change RegExp internal slots to JsStrings --- boa/src/builtins/regexp/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/boa/src/builtins/regexp/mod.rs b/boa/src/builtins/regexp/mod.rs index af3bf927f66..2ba1c18156b 100644 --- a/boa/src/builtins/regexp/mod.rs +++ b/boa/src/builtins/regexp/mod.rs @@ -53,8 +53,8 @@ pub struct RegExp { /// Flag 'u' - Unicode. unicode: bool, - pub(crate) original_source: Box, - original_flags: Box, + original_source: JsString, + original_flags: JsString, } // Only safe while regress::Regex doesn't implement Trace itself. @@ -287,17 +287,17 @@ impl RegExp { // 1. If pattern is undefined, let P be the empty String. // 2. Else, let P be ? ToString(pattern). let p = if pattern.is_undefined() { - String::new().into_boxed_str() + JsString::new("") } else { - pattern.to_string(context)?.as_str().into() + pattern.to_string(context)? }; // 3. If flags is undefined, let F be the empty String. // 4. Else, let F be ? ToString(flags). let f = if flags.is_undefined() { - String::new().into_boxed_str() + JsString::new("") } else { - flags.to_string(context)?.as_str().into() + flags.to_string(context)? }; // 5. If F contains any code unit other than "g", "i", "m", "s", "u", or "y"