TEST=mjsunit/external-array
Review URL: http://codereview.chromium.org/7866040
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9244
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
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."));
}