Initialize values on nil
This commit is contained in:
parent
3f0793ca22
commit
a98e1c4738
2 changed files with 5 additions and 5 deletions
|
@ -59,9 +59,9 @@ namespace AspectedRouting.IO.LuaSkeleton
|
|||
"Returns values: ",
|
||||
"]]",
|
||||
"function " + meta.Name.AsLuaIdentifier() + "(parameters, tags, result)" + funcNameDeclaration,
|
||||
" local result",
|
||||
" "+Snippets.Convert(this, "result", expression).Indent(),
|
||||
" return result" ,
|
||||
" local r = nil",
|
||||
" "+Snippets.Convert(this, "r", expression).Indent(),
|
||||
" return r" ,
|
||||
"end"
|
||||
);
|
||||
|
||||
|
|
|
@ -45,12 +45,12 @@ namespace AspectedRouting.IO.LuaSnippets
|
|||
}
|
||||
else {
|
||||
tags = lua.FreeVar("tags");
|
||||
result += "local " + tags + "\n";
|
||||
result += "local " + tags + " = nil\n";
|
||||
result += Snippets.Convert(lua, tags, mappingArg);
|
||||
}
|
||||
|
||||
var m = lua.FreeVar("m");
|
||||
result += " local " + m + "\n";
|
||||
result += " local " + m + " = nil\n";
|
||||
|
||||
foreach (var (key, func) in mapping.StringToResultFunctions) {
|
||||
result += "if (" + tags + "[\"" + key + "\"] ~= nil) then\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue