diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-07 17:08:46 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-04-07 17:08:46 (GMT) |
commit | f13848cab284839c2f6abd39ef38dd18692a50cf (patch) | |
tree | 8de4b167374511cc2f7a9d89c2efb3f77ca3235d /src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp | |
parent | 46d089f8642501cf2ffc4a531add0a3a8eaa268e (diff) | |
download | uscxml-f13848cab284839c2f6abd39ef38dd18692a50cf.zip uscxml-f13848cab284839c2f6abd39ef38dd18692a50cf.tar.gz uscxml-f13848cab284839c2f6abd39ef38dd18692a50cf.tar.bz2 |
Even more conformance fixes
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp index e653607..fff3f9b 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp @@ -143,11 +143,13 @@ void V8DataModel::setEvent(const Event& event) { privData->dom = _dom; eventObj->SetInternalField(0, Arabica::DOM::V8DOM::toExternal(privData)); eventObj.MakeWeak(0, Arabica::DOM::V8SCXMLEvent::jsDestructor); + if (event.dom) { eventObj->Set(v8::String::New("data"), getDocumentAsValue(event.dom)); } else if (event.content.length() > 0) { // _event.data is a string eventObj->Set(v8::String::New("data"), v8::String::New(event.content.c_str())); +// eventObj->Set(v8::String::New("data"), v8::Undefined()); } else { // _event.data is KVP Event eventCopy(event); @@ -168,10 +170,11 @@ void V8DataModel::setEvent(const Event& event) { if (eventCopy.data.compound.size() > 0) { eventObj->Set(v8::String::New("data"), getDataAsValue(eventCopy.data)); // set data part of _event } else { - // test 343 + // test 343 / test 488 eventObj->Set(v8::String::New("data"), v8::Undefined()); // set data part of _event } } + // we cannot make _event v8::ReadOnly as it will ignore subsequent setEvents global->Set(v8::String::New("_event"), eventObj); } |