diff --git a/boa/src/builtins/string/mod.rs b/boa/src/builtins/string/mod.rs index aa757d225a..b2ee8972e0 100644 --- a/boa/src/builtins/string/mod.rs +++ b/boa/src/builtins/string/mod.rs @@ -918,13 +918,17 @@ impl String { return Value::from(primitive); } - let filter = fill_string.as_deref().unwrap_or(" "); + let filler = fill_string.as_deref().unwrap_or(" "); + + if filler.is_empty() { + return Value::from(primitive); + } let fill_len = max_length.wrapping_sub(primitive_length); let mut fill_str = StdString::new(); while fill_str.len() < fill_len as usize { - fill_str.push_str(filter); + fill_str.push_str(filler); } // Cut to size max_length let concat_fill_str: StdString = fill_str.chars().take(fill_len as usize).collect(); diff --git a/test_ignore.txt b/test_ignore.txt index 25b45c8e45..c3a20814ff 100644 --- a/test_ignore.txt +++ b/test_ignore.txt @@ -12,7 +12,6 @@ feature:json-modules // These seem to run forever: arg-length-exceeding-integer-limit 15.4.4.19-8-c-ii-1 -fill-string-empty length-boundaries throws-if-integer-limit-exceeded