Index: src/handles.cc |
=================================================================== |
--- src/handles.cc (revision 2544) |
+++ src/handles.cc (working copy) |
@@ -341,6 +341,14 @@ |
Handle<Object> SetElement(Handle<JSObject> object, |
uint32_t index, |
Handle<Object> value) { |
+ if (object->HasPixelElements()) { |
+ if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { |
+ bool has_exception; |
+ Handle<Object> number = Execution::ToNumber(value, &has_exception); |
+ if (has_exception) return Handle<Object>(); |
+ value = number; |
+ } |
+ } |
CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object); |
} |