Index: src/api.cc |
=================================================================== |
--- src/api.cc (revision 2544) |
+++ src/api.cc (working copy) |
@@ -2194,6 +2194,25 @@ |
} |
+void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) { |
+ ON_BAILOUT("v8::SetElementsToPixelData()", return); |
+ ENTER_V8; |
+ if (!ApiCheck(i::Smi::IsValid(length), |
+ "v8::Object::SetIndexedPropertiesToPixelData()", |
+ "length exceeds max acceptable value")) { |
+ return; |
+ } |
+ i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
+ if (!ApiCheck(!self->IsJSArray(), |
+ "v8::Object::SetIndexedPropertiesToPixelData()", |
+ "JSArray is not supported")) { |
+ return; |
+ } |
+ i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length, data); |
+ self->set_elements(*pixels); |
+} |
+ |
+ |
Local<v8::Object> Function::NewInstance() const { |
return NewInstance(0, NULL); |
} |
@@ -3057,7 +3076,7 @@ |
if (!self->HasFastElements()) { |
return Local<Object>(); |
} |
- i::FixedArray* elms = self->elements(); |
+ i::FixedArray* elms = i::FixedArray::cast(self->elements()); |
i::Object* paragon = elms->get(index); |
if (!paragon->IsJSObject()) { |
return Local<Object>(); |