diff options
| author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-07-03 15:29:32 (GMT) |
|---|---|---|
| committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-07-03 15:29:32 (GMT) |
| commit | 096f7df1137dd62871cacd371bf023e39d6b30e5 (patch) | |
| tree | e1fa0dc079698d700e6323dcc7769169142a236e /src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore | |
| parent | 8941cc07d4df9c112744e58a9108fcf5575fa9d6 (diff) | |
| download | uscxml-096f7df1137dd62871cacd371bf023e39d6b30e5.zip uscxml-096f7df1137dd62871cacd371bf023e39d6b30e5.tar.gz uscxml-096f7df1137dd62871cacd371bf023e39d6b30e5.tar.bz2 | |
Reactiveted miles components and some JSC fixes
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore')
3 files changed, 27 insertions, 23 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index 174c33d..c78cdad 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -84,7 +84,7 @@ void JSCDataModel::setEvent(const Event& event) { JSObjectRef eventObj = JSObjectMake(_ctx, Arabica::DOM::JSCSCXMLEvent::getTmpl(), privData); JSObjectRef globalObject = JSContextGetGlobalObject(_ctx); - + JSValueRef exception = NULL; if (event.dom) { @@ -146,7 +146,9 @@ void JSCDataModel::setEvent(const Event& event) { } } - JSObjectSetProperty(_ctx, globalObject, JSStringCreateWithUTF8CString("_event"), eventObj, kJSPropertyAttributeDontDelete, NULL); + JSObjectSetProperty(_ctx, globalObject, JSStringCreateWithUTF8CString("_event"), eventObj, kJSPropertyAttributeDontDelete, &exception); + if (exception) + handleException(exception); } diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp index ba95603..9b6f34f 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEvent.cpp @@ -7,18 +7,19 @@ namespace DOM { JSClassRef JSCSCXMLEvent::Tmpl; JSStaticValue JSCSCXMLEvent::staticValues[] = { - { "type", typeCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "name", nameAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "origin", originAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "origintype", origintypeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "raw", rawAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, + { "invokeid", invokeidAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "dom", domAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, + { "origintype", origintypeAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, + + { "type", typeCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, { "sendid", sendidCustomAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "invokeid", invokeidAttrGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "INTERNAL", INTERNALConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "EXTERNAL", EXTERNALConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, - { "PLATFORM", PLATFORMConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly }, + { "INTERNAL", INTERNALConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum }, + { "EXTERNAL", EXTERNALConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum }, + { "PLATFORM", PLATFORMConstGetter, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum }, { 0, 0, 0, 0 } }; diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp index f36e544..de81244 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCSCXMLEventCustom.cpp @@ -4,36 +4,37 @@ namespace Arabica { namespace DOM { JSValueRef JSCSCXMLEvent::typeCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { -#if 0 - v8::Local<v8::Object> self = info.Holder(); - V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); + struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(thisObj); + JSStringRef stringRef; switch (privData->nativeObj->type) { case uscxml::Event::INTERNAL: - return v8::String::New("internal"); + stringRef = JSStringCreateWithUTF8CString("internal"); break; case uscxml::Event::EXTERNAL: - return v8::String::New("external"); + stringRef = JSStringCreateWithUTF8CString("external"); break; case uscxml::Event::PLATFORM: - return v8::String::New("platform"); + stringRef = JSStringCreateWithUTF8CString("platform"); break; default: + stringRef = JSStringCreateWithUTF8CString("undefined"); break; } - return v8::String::New("unknown"); -#endif + + return JSValueMakeString(ctx, stringRef); } JSValueRef JSCSCXMLEvent::sendidCustomAttrGetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef propertyName, JSValueRef* exception) { -#if 0 - v8::Local<v8::Object> self = info.Holder(); - V8SCXMLEventPrivate* privData = V8DOM::toClassPtr<V8SCXMLEventPrivate >(self->GetInternalField(0)); + struct JSCSCXMLEventPrivate* privData = (struct JSCSCXMLEventPrivate*)JSObjectGetPrivate(thisObj); + JSStringRef stringRef; - if (privData->nativeObj->sendid.length() == 0 || privData->nativeObj->hideSendId) - return v8::Undefined(); - return v8::String::New(privData->nativeObj->sendid.c_str()); -#endif + if (privData->nativeObj->sendid.length() == 0 || privData->nativeObj->hideSendId) { + return JSValueMakeUndefined(ctx); + } else { + stringRef = JSStringCreateWithUTF8CString(privData->nativeObj->sendid.c_str()); + return JSValueMakeString(ctx, stringRef); + } } } |
