Revision: 9244
Author:   [email protected]
Date:     Mon Sep 12 06:36:43 2011
Log:      d8 external array c'tors: fix double-to-uint32 semantics

TEST=mjsunit/external-array

Review URL: http://codereview.chromium.org/7866040
http://code.google.com/p/v8/source/detail?r=9244

Modified:
 /branches/bleeding_edge/src/d8.cc

=======================================
--- /branches/bleeding_edge/src/d8.cc   Mon Sep 12 05:42:05 2011
+++ /branches/bleeding_edge/src/d8.cc   Mon Sep 12 06:36:43 2011
@@ -300,11 +300,11 @@
     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."));
     }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to