Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index f0c1d95f88275bc3b5a6af003d149d27ffa51c12..2a1df1e29d01620c4384e527356cd726fbb2a421 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -7169,10 +7169,10 @@ RUNTIME_FUNCTION(Runtime_StringBuilderConcat) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 3); |
CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); |
- if (!args[1]->IsSmi()) { |
+ int32_t array_length; |
+ if (!args[1]->ToInt32(&array_length)) { |
THROW_NEW_ERROR_RETURN_FAILURE(isolate, NewInvalidStringLengthError()); |
} |
- CONVERT_SMI_ARG_CHECKED(array_length, 1); |
CONVERT_ARG_HANDLE_CHECKED(String, special, 2); |
size_t actual_array_length = 0; |
@@ -7243,10 +7243,10 @@ RUNTIME_FUNCTION(Runtime_StringBuilderJoin) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 3); |
CONVERT_ARG_HANDLE_CHECKED(JSArray, array, 0); |
- if (!args[1]->IsSmi()) { |
+ int32_t array_length; |
+ if (!args[1]->ToInt32(&array_length)) { |
THROW_NEW_ERROR_RETURN_FAILURE(isolate, NewInvalidStringLengthError()); |
} |
- CONVERT_SMI_ARG_CHECKED(array_length, 1); |
CONVERT_ARG_HANDLE_CHECKED(String, separator, 2); |
RUNTIME_ASSERT(array->HasFastObjectElements()); |
RUNTIME_ASSERT(array_length >= 0); |