d8 external array c'tors: fix double-to-uint32 semantics
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
This commit is contained in:
parent
3ec371690c
commit
db2bac3847
@ -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."));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user