diff --git a/src/builtins/array-join.tq b/src/builtins/array-join.tq index 4923b8ba25..c61dd6c830 100644 --- a/src/builtins/array-join.tq +++ b/src/builtins/array-join.tq @@ -106,7 +106,7 @@ module array { return length; } label IfOverflow deferred { - ThrowRangeError(context, kInvalidStringLength); + ThrowInvalidStringLength(context); } } @@ -203,7 +203,7 @@ module array { // Detect integer overflow // TODO(tebbi): Replace with overflow-checked multiplication. if (sepsLen / separatorLength != nofSeparatorsInt) deferred { - ThrowRangeError(context, kInvalidStringLength); + ThrowInvalidStringLength(context); } const totalStringLength: intptr = @@ -348,7 +348,7 @@ module array { return StringRepeat(context, sep, nofSeparators); } label IfNotSmi { - ThrowRangeError(context, kInvalidStringLength); + ThrowInvalidStringLength(context); } } else { loadJoinElements = LoadJoinElement; diff --git a/src/builtins/base.tq b/src/builtins/base.tq index 3ccec87b6b..b6322c23c8 100644 --- a/src/builtins/base.tq +++ b/src/builtins/base.tq @@ -168,8 +168,6 @@ const kCalledNonCallable: constexpr MessageTemplate generates 'MessageTemplate::kCalledNonCallable'; const kCalledOnNullOrUndefined: constexpr MessageTemplate generates 'MessageTemplate::kCalledOnNullOrUndefined'; -const kInvalidStringLength: constexpr MessageTemplate - generates 'MessageTemplate::kInvalidStringLength'; const kMaxSafeInteger: constexpr float64 generates 'kMaxSafeInteger'; const kStringMaxLength: constexpr int31 generates 'String::kMaxLength'; @@ -303,6 +301,7 @@ extern builtin StringLessThan(Context, String, String): Boolean; extern macro StrictEqual(Object, Object): Boolean; extern macro SmiLexicographicCompare(Smi, Smi): Smi; extern runtime ReThrow(Context, Object): never; +extern runtime ThrowInvalidStringLength(Context): never; extern operator '<' macro Int32LessThan(int32, int32): bool; extern operator '>' macro Int32GreaterThan(int32, int32): bool;