Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 9390c846d60055aef88431c04c70761dcfb00aac..544e824870d03a51a9229b05f754430f991f1c5a 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -300,11 +300,11 @@ Handle<Value> Shell::CreateExternalArray(const Arguments& args, |
if (number.IsEmpty() || !number->IsNumber()) { |
return ThrowException(String::New("Array length must be a number.")); |
} |
- double raw_length = number->NumberValue(); |
+ int32_t raw_length = number->ToInt32()->Int32Value(); |
if (raw_length < 0) { |
return ThrowException(String::New("Array length must not be negative.")); |
} |
- if (raw_length > kMaxLength) { |
+ if (raw_length > static_cast<int32_t>(kMaxLength)) { |
return ThrowException( |
String::New("Array length exceeds maximum length.")); |
} |