Skip to content

Commit

Permalink
Change RegExp internal slots to JsStrings
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad committed Jul 28, 2021
1 parent a35aa0b commit a0d9713
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions boa/src/builtins/regexp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub struct RegExp {
/// Flag 'u' - Unicode.
unicode: bool,

pub(crate) original_source: Box<str>,
original_flags: Box<str>,
original_source: JsString,
original_flags: JsString,
}

// Only safe while regress::Regex doesn't implement Trace itself.
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit a0d9713

Please sign in to comment.