Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 80e67cc87585ce206e5ff200e0ea3a53c1240534..50a29c24f9770d31d8258cda9cf782bf722daada 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -1665,7 +1665,7 @@ static Object* Runtime_StringCharCodeAt(Arguments args) { |
} else { |
ASSERT(index->IsHeapNumber()); |
double value = HeapNumber::cast(index)->value(); |
- i = static_cast<uint32_t>(value); |
+ i = static_cast<uint32_t>(DoubleToInteger(value)); |
} |
// Flatten the string. If someone wants to get a char at an index |