Commit 08d84f6d authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[string] Fix error message in String.prototype.repeat.

R=yangguo@chromium.org
TEST=message/regress/regress-crbug-691194
BUG=chromium:691194

Change-Id: I72198e087f88abf89cdd38b99c19e10cbebda08d
Reviewed-on: https://chromium-review.googlesource.com/445942Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43480}
parent 09a07038
......@@ -220,7 +220,7 @@ function StringRepeat(count) {
// The maximum string length is stored in a smi, so a longer repeat
// must result in a range error.
if (n > %_MaxSmi()) throw %make_range_error(kInvalidCountValue);
if (n > %_MaxSmi()) throw %make_range_error(kInvalidStringLength);
var r = "";
while (true) {
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
"foo".repeat(1 << 30)
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
*%(basename)s:5: RangeError: Invalid string length
"foo".repeat(1 << 30)
^
RangeError: Invalid string length
at String.repeat (native)
at *%(basename)s:5:7
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment