summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/datamodel/ecmascript/v8
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8')
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp38
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h3
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp18
3 files changed, 19 insertions, 40 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
index 919f4a1..caf482b 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
@@ -351,25 +351,25 @@ v8::Handle<v8::Value> V8DataModel::getDataAsValue(const Data& data) {
return value;
}
switch (data.type) {
- case Data::VERBATIM:
- return v8::String::New(data.atom.c_str());
- break;
- case Data::INTERPRETED:
- return evalAsValue(data.atom);
- break;
- case Data::BINARY: {
- uscxml::ArrayBuffer* arrBuffer = new uscxml::ArrayBuffer((void*)data.atom.c_str(), data.atom.size());
- v8::Handle<v8::Function> retCtor = V8ArrayBuffer::getTmpl()->GetFunction();
- v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance());
-
- struct V8ArrayBuffer::V8ArrayBufferPrivate* retPrivData = new V8ArrayBuffer::V8ArrayBufferPrivate();
- retPrivData->nativeObj = arrBuffer;
- retObj->SetInternalField(0, V8DOM::toExternal(retPrivData));
-
- retObj.MakeWeak(0, V8ArrayBuffer::jsDestructor);
- return retObj;
- break;
- }
+ case Data::VERBATIM:
+ return v8::String::New(data.atom.c_str());
+ break;
+ case Data::INTERPRETED:
+ return evalAsValue(data.atom);
+ break;
+ case Data::BINARY: {
+ uscxml::ArrayBuffer* arrBuffer = new uscxml::ArrayBuffer((void*)data.atom.c_str(), data.atom.size());
+ v8::Handle<v8::Function> retCtor = V8ArrayBuffer::getTmpl()->GetFunction();
+ v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance());
+
+ struct V8ArrayBuffer::V8ArrayBufferPrivate* retPrivData = new V8ArrayBuffer::V8ArrayBufferPrivate();
+ retPrivData->nativeObj = arrBuffer;
+ retObj->SetInternalField(0, V8DOM::toExternal(retPrivData));
+
+ retObj.MakeWeak(0, V8ArrayBuffer::jsDestructor);
+ return retObj;
+ break;
+ }
}
// this will never be reached
return v8::Undefined();
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h
index d4229eb..767d520 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8ArrayBuffer.h
@@ -45,8 +45,6 @@ public:
static v8::Handle<v8::Value> isViewCallback(const v8::Arguments&);
static v8::Handle<v8::Value> byteLengthAttrGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
- static v8::Handle<v8::Value> indexedPropertyCustomGetter(uint32_t, const v8::AccessorInfo&);
- static v8::Handle<v8::Value> indexedPropertyCustomSetter(uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo&);
static v8::Handle<v8::Value> constructor(const v8::Arguments&);
static v8::Persistent<v8::FunctionTemplate> Constr;
@@ -74,7 +72,6 @@ public:
instance->SetAccessor(v8::String::NewSymbol("byteLength"), V8ArrayBuffer::byteLengthAttrGetter, 0,
v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None));
- instance->SetIndexedPropertyHandler(V8ArrayBuffer::indexedPropertyCustomGetter, V8ArrayBuffer::indexedPropertyCustomSetter);
prototype->Set(v8::String::NewSymbol("slice"),
v8::FunctionTemplate::New(V8ArrayBuffer::sliceCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete));
prototype->Set(v8::String::NewSymbol("isView"),
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp
index 118eb46..95e86de 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8TypedArrayCustom.cpp
@@ -75,16 +75,6 @@ v8::Handle<v8::Value> V8Uint8ClampedArray::indexedPropertyCustomSetter(unsigned
return value;
}
-v8::Handle<v8::Value> V8ArrayBuffer::indexedPropertyCustomSetter(unsigned int index, v8::Local<v8::Value> value, const v8::AccessorInfo &info) {
- v8::Local<v8::Object> self = info.Holder();
- uscxml::ArrayBuffer* array = V8DOM::toClassPtr<V8ArrayBufferPrivate >(self->GetInternalField(0))->nativeObj;
- if (index > array->getByteLength())
- return v8::Undefined();
- array->_buffer->_data[index] = value->ToInt32()->Value() & 0xff;
- return value;
-
-}
-
// ----------------
v8::Handle<v8::Value> V8Int8Array::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) {
@@ -132,13 +122,5 @@ v8::Handle<v8::Value> V8Uint8ClampedArray::indexedPropertyCustomGetter(unsigned
return v8::Uint32::New(array->get(index));
}
-v8::Handle<v8::Value> V8ArrayBuffer::indexedPropertyCustomGetter(unsigned int index, const v8::AccessorInfo &info) {
- v8::Local<v8::Object> self = info.Holder();
- uscxml::ArrayBuffer* array = V8DOM::toClassPtr<V8ArrayBufferPrivate >(self->GetInternalField(0))->nativeObj;
- if (index > array->getByteLength())
- return v8::Undefined();
- return v8::Int32::New(array->_buffer->_data[index]);
-}
-
}
} \ No newline at end of file