mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibJS: Throw RangeError in StringPrototype::repeat if OOM
currently crashes with an assertion failure in `String::repeated` if malloc can't serve a `count * input_size` sized request, so add `String::repeated_with_error` to propagate the error.
This commit is contained in:
@@ -79,7 +79,7 @@ public:
|
||||
static ErrorOr<String> repeated(u32 code_point, size_t count);
|
||||
|
||||
// Creates a new String from another string, repeated N times.
|
||||
static String repeated(String const&, size_t count);
|
||||
static ErrorOr<String> repeated(String const&, size_t count);
|
||||
|
||||
// Creates a new String by case-transforming this String. Using these methods require linking LibUnicode into your application.
|
||||
ErrorOr<String> to_lowercase(Optional<StringView> const& locale = {}) const;
|
||||
|
||||
Reference in New Issue
Block a user