summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/datamodel/ecmascript/v8
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-05-23 10:50:59 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-05-23 10:50:59 (GMT)
commit9f3dfcd9982cff90cf0466413d17fc1061c43f00 (patch)
treee29d0f70ecdfb742e3bbbc522e87281c8bbd58e7 /src/uscxml/plugins/datamodel/ecmascript/v8
parent216e8efb0f1aff9afd3881ab89b49e017e255228 (diff)
downloaduscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.zip
uscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.tar.gz
uscxml-9f3dfcd9982cff90cf0466413d17fc1061c43f00.tar.bz2
Fixed the 100% CPU utilization bug and replaced the bool() cast operator for data by empty()
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8')
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
index ec9557e..2bdd796 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
@@ -233,7 +233,7 @@ void V8DataModel::setEvent(const Event& event) {
} else if (event.content.length() > 0) {
// _event.data is a string or JSON
Data json = Data::fromJSON(event.content);
- if (json) {
+ if (!json.empty()) {
eventObj->Set(v8::String::New("data"), getDataAsValue(json));
} else {
eventObj->Set(v8::String::New("data"), v8::String::New(InterpreterImpl::spaceNormalize(event.content).c_str()));
@@ -255,7 +255,7 @@ void V8DataModel::setEvent(const Event& event) {
nameListIter++;
}
}
- if (eventCopy.data) {
+ if (!eventCopy.data.empty()) {
// std::cout << Data::toJSON(eventCopy.data);
eventObj->Set(v8::String::New("data"), getDataAsValue(eventCopy.data)); // set data part of _event
} else {