Skip to content

Commit

Permalink
Cast options value via as_string method
Browse files Browse the repository at this point in the history
  • Loading branch information
NorbertGarfield committed Apr 24, 2022
1 parent 73844a5 commit 7f99dee
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions boa_engine/src/builtins/intl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,11 @@ fn resolve_locale(
// productions.

// 3. If optionsValue is the empty String, then
let options_val_str = options_value
.to_string(context)
.unwrap_or_else(|_| JsString::new(""))
.to_string();
if options_val_str.is_empty() {
// a. Let optionsValue be "true".
options_value = JsValue::String(JsString::new("true"));
if let Some(options_val_str) = options_value.as_string() {
if options_val_str.is_empty() {
// a. Let optionsValue be "true".
options_value = JsValue::String(JsString::new("true"));
}
}
}

Expand Down

0 comments on commit 7f99dee

Please sign in to comment.