diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-06-23 23:38:20 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-06-23 23:38:20 (GMT) |
commit | febde41c4c69d8f38967d5c195328d468834d037 (patch) | |
tree | 4580a433d410e91a6f8df9203c20693e7a21128d /src/uscxml/plugins/datamodel/ecmascript | |
parent | eb6e9807cdb43b408de45ae789916cdf3bebe6f0 (diff) | |
download | uscxml-febde41c4c69d8f38967d5c195328d468834d037.zip uscxml-febde41c4c69d8f38967d5c195328d468834d037.tar.gz uscxml-febde41c4c69d8f38967d5c195328d468834d037.tar.bz2 |
Updated tests for IRP and work on bindings
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp | 8 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp | 17 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index a6909b5..72252e4 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -212,6 +212,12 @@ void JSCDataModel::setEvent(const Event& event) { JSValueRef exception = NULL; + if (event.raw.size() == 0) { + std::stringstream ssRaw; + ssRaw << event; + privData->nativeObj->raw = ssRaw.str(); + } + if (event.dom) { JSStringRef propName = JSStringCreateWithUTF8CString("data"); JSObjectSetProperty(_ctx, eventObj, propName, getNodeAsValue(event.dom), 0, &exception); @@ -555,6 +561,8 @@ void JSCDataModel::assign(const Element<std::string>& assignElem, throw Event("error.execution", Event::PLATFORM); if (key.compare("_invokers") == 0) throw Event("error.execution", Event::PLATFORM); + if (key.compare("_event") == 0) + throw Event("error.execution", Event::PLATFORM); if (HAS_ATTR(assignElem, "expr")) { evalAsValue(key + " = " + ATTR(assignElem, "expr")); diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp index 2bdd796..8b222f7 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp @@ -228,6 +228,12 @@ void V8DataModel::setEvent(const Event& event) { eventObj->SetInternalField(0, V8DOM::toExternal(privData)); eventObj.MakeWeak(0, V8SCXMLEvent::jsDestructor); + if (event.raw.size() == 0) { + std::stringstream ssRaw; + ssRaw << event; + privData->nativeObj->raw = ssRaw.str(); + } + if (event.dom) { eventObj->Set(v8::String::New("data"), getNodeAsValue(event.dom)); } else if (event.content.length() > 0) { @@ -595,6 +601,17 @@ void V8DataModel::assign(const Element<std::string>& assignElem, if (key.length() == 0) throw Event("error.execution", Event::PLATFORM); + if (key.compare("_sessionid") == 0) // test 322 + throw Event("error.execution", Event::PLATFORM); + if (key.compare("_name") == 0) + throw Event("error.execution", Event::PLATFORM); + if (key.compare("_ioprocessors") == 0) // test 326 + throw Event("error.execution", Event::PLATFORM); + if (key.compare("_invokers") == 0) + throw Event("error.execution", Event::PLATFORM); + if (key.compare("_event") == 0) + throw Event("error.execution", Event::PLATFORM); + if (HAS_ATTR(assignElem, "expr")) { evalAsValue(key + " = " + ATTR(assignElem, "expr")); } else if (node) { |