Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: src/d8.cc

Issue 7866040: d8 external array c'tors: fix double-to-uint32 semantics (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: better error messages Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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."));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698