summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h')
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h
index 892b666..d3c5b71 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/dom/V8Int32Array.h
@@ -24,6 +24,7 @@
#include <string>
#include "../../TypedArray.h"
#include "DOM/Node.hpp"
+#include "V8ArrayBufferView.h"
#include "string"
#include "uscxml/plugins/datamodel/ecmascript/v8/V8DOM.h"
#include <v8.h>
@@ -46,6 +47,18 @@ public:
static v8::Handle<v8::Value> subarrayCallback(const v8::Arguments&);
static v8::Handle<v8::Value> lengthAttrGetter(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;
+ static v8::Handle<v8::FunctionTemplate> getConstructor() {
+ if (Constr.IsEmpty()) {
+ v8::Handle<v8::FunctionTemplate> constr = v8::FunctionTemplate::New(constructor);
+ Constr = v8::Persistent<v8::FunctionTemplate>::New(constr);
+ }
+ return Constr;
+ }
static v8::Persistent<v8::FunctionTemplate> Tmpl;
static v8::Handle<v8::FunctionTemplate> getTmpl() {
@@ -63,20 +76,18 @@ public:
instance->SetAccessor(v8::String::NewSymbol("length"), V8Int32Array::lengthAttrGetter, 0,
v8::External::New(0), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None));
+ instance->SetIndexedPropertyHandler(V8Int32Array::indexedPropertyCustomGetter, V8Int32Array::indexedPropertyCustomSetter);
prototype->Set(v8::String::NewSymbol("get"),
v8::FunctionTemplate::New(V8Int32Array::getCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete));
prototype->Set(v8::String::NewSymbol("set"),
v8::FunctionTemplate::New(V8Int32Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete));
- prototype->Set(v8::String::NewSymbol("set"),
- v8::FunctionTemplate::New(V8Int32Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete));
- prototype->Set(v8::String::NewSymbol("set"),
- v8::FunctionTemplate::New(V8Int32Array::setCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete));
prototype->Set(v8::String::NewSymbol("subarray"),
v8::FunctionTemplate::New(V8Int32Array::subarrayCallback, v8::Undefined()), static_cast<v8::PropertyAttribute>(v8::DontDelete));
tmpl->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum));
prototype->Set(v8::String::NewSymbol("BYTES_PER_ELEMENT"), v8::Integer::New(4), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontEnum));
+ tmpl->Inherit(V8ArrayBufferView::getTmpl());
Tmpl = v8::Persistent<v8::FunctionTemplate>::New(tmpl);
}
return Tmpl;