summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2014-05-18 09:49:13 (GMT)
committerRemko Tronçon <git@el-tramo.be>2014-05-18 15:49:19 (GMT)
commitfa8fd85f5c451648bb7cfbe275db19efa921d850 (patch)
tree54adc28feceef0f674fb69088effbb975e76cc1a /Sluift/ElementConvertors/CommandConvertor.cpp
parent1165b03c019a2207dc58a2070b1d5ff5833b8093 (diff)
downloadswift-contrib-fa8fd85f5c451648bb7cfbe275db19efa921d850.zip
swift-contrib-fa8fd85f5c451648bb7cfbe275db19efa921d850.tar.bz2
Sluift: Add assertions on conversion
Change-Id: I641380fe7423af7b2c7be992f59244a57fb24b51
Diffstat (limited to 'Sluift/ElementConvertors/CommandConvertor.cpp')
-rw-r--r--Sluift/ElementConvertors/CommandConvertor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Sluift/ElementConvertors/CommandConvertor.cpp b/Sluift/ElementConvertors/CommandConvertor.cpp
index 7fb7b22..9a2aa5f 100644
--- a/Sluift/ElementConvertors/CommandConvertor.cpp
+++ b/Sluift/ElementConvertors/CommandConvertor.cpp
@@ -157,39 +157,40 @@ void CommandConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<Command> p
Lua::Table noteTable;
if (!note.note.empty()) {
noteTable["note"] = Lua::valueRef(note.note);
}
switch (note.type) {
case Command::Note::Info: noteTable["type"] = Lua::valueRef("info"); break;
case Command::Note::Warn: noteTable["type"] = Lua::valueRef("warn"); break;
case Command::Note::Error: noteTable["type"] = Lua::valueRef("error"); break;
}
notes.push_back(noteTable);
}
result["notes"] = Lua::valueRef(notes);
}
if (payload->getAction() != Command::NoAction) {
result["action"] = Lua::valueRef(convertActionToString(payload->getAction()));
}
if (payload->getExecuteAction() != Command::NoAction) {
result["execute_action"] = Lua::valueRef(convertActionToString(payload->getAction()));
}
if (!payload->getAvailableActions().empty()) {
std::vector<Lua::Value> availableActions;
foreach (const Command::Action& action, payload->getAvailableActions()) {
if (action != Command::NoAction) {
availableActions.push_back(convertActionToString(action));
}
}
result["available_actions"] = Lua::valueRef(availableActions);
}
Lua::pushValue(L, result);
if (payload->getForm()) {
- convertors->convertToLuaUntyped(L, payload->getForm());
+ bool result = convertors->convertToLuaUntyped(L, payload->getForm());
+ assert(result);
lua_setfield(L, -2, "form");
}
}