diff options
author | Stefan Radomski <github@mintwerk.de> | 2017-01-18 17:15:46 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2017-01-18 17:15:46 (GMT) |
commit | fc78cfdc4d1f5bba8dbd6a412f23651e185cb191 (patch) | |
tree | dd32929c07e6c19250f2e8fde1e73712bab0c6fb /src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore | |
parent | 01ee860a88b5c8cf25fb7dcc145662d2c27f3ebe (diff) | |
download | uscxml-fc78cfdc4d1f5bba8dbd6a412f23651e185cb191.zip uscxml-fc78cfdc4d1f5bba8dbd6a412f23651e185cb191.tar.gz uscxml-fc78cfdc4d1f5bba8dbd6a412f23651e185cb191.tar.bz2 |
Worked on passing even more IRP tests
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp | 31 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h | 10 |
2 files changed, 14 insertions, 27 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp index 22e8ccc..bcde9c9 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.cpp @@ -420,7 +420,12 @@ Data JSCDataModel::getAsData(const std::string& content) { (trimmed[0] == '\'' && trimmed[trimmed.length() - 1] == '\''))) { d = Data(trimmed.substr(1, trimmed.length() - 2), Data::VERBATIM); } else { - d = Data(trimmed, Data::INTERPRETED); + // test558, test562 + ERROR_EXECUTION(e, "Given content cannot be interpreted as data"); + e.data.compound["literal"] = Data(trimmed, Data::VERBATIM); + throw e; + +// d = Data(trimmed, Data::INTERPRETED); } } return d; @@ -684,7 +689,7 @@ JSValueRef JSCDataModel::getNodeAsValue(const DOMNode* node) { // } } -void JSCDataModel::assign(const std::string& location, const Data& data) { +void JSCDataModel::assign(const std::string& location, const Data& data, const std::map<std::string, std::string>& attr) { // flags on attribute are ignored? if (location.compare("_sessionid") == 0) // test 322 @@ -714,7 +719,7 @@ void JSCDataModel::assign(const std::string& location, const Data& data) { handleException(exception); } -void JSCDataModel::init(const std::string& location, const Data& data) { +void JSCDataModel::init(const std::string& location, const Data& data, const std::map<std::string, std::string>& attr) { try { if (data.empty()) { assign(location, Data("null", Data::INTERPRETED)); @@ -728,26 +733,6 @@ void JSCDataModel::init(const std::string& location, const Data& data) { } } -std::string JSCDataModel::andExpressions(std::list<std::string> expressions) { - if (expressions.size() == 0) - return ""; - - if (expressions.size() == 1) - return *(expressions.begin()); - - std::ostringstream exprSS; - exprSS << "("; - std::string conjunction = ""; - for (std::list<std::string>::const_iterator exprIter = expressions.begin(); - exprIter != expressions.end(); - exprIter++) { - exprSS << conjunction << "(" << *exprIter << ")"; - conjunction = " && "; - } - exprSS << ")"; - return exprSS.str(); -} - void JSCDataModel::handleException(JSValueRef exception) { JSStringRef exceptionStringRef = JSValueToStringCopy(_ctx, exception, NULL); size_t maxSize = JSStringGetMaximumUTF8CStringSize(exceptionStringRef); diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h index c5129a4..3a53da2 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/JSCDataModel.h @@ -80,10 +80,12 @@ public: virtual bool isDeclared(const std::string& expr); - virtual void assign(const std::string& location, const Data& data); - virtual void init(const std::string& location, const Data& data); - - virtual std::string andExpressions(std::list<std::string>); + virtual void assign(const std::string& location, + const Data& data, + const std::map<std::string, std::string>& attr = std::map<std::string, std::string>()); + virtual void init(const std::string& location, + const Data& data, + const std::map<std::string, std::string>& attr = std::map<std::string, std::string>()); protected: |