summaryrefslogtreecommitdiffstats
path: root/Sencha-lang/ContextManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Sencha-lang/ContextManager.cpp')
-rw-r--r--Sencha-lang/ContextManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Sencha-lang/ContextManager.cpp b/Sencha-lang/ContextManager.cpp
index 4378b12..51993de 100644
--- a/Sencha-lang/ContextManager.cpp
+++ b/Sencha-lang/ContextManager.cpp
@@ -37,6 +37,12 @@ SenchaObject ContextManager::execute_function(std::string name, std::vector<ASTE
{
SenchaFunction * function = contexts["global"]->registered_sfunctions[name];
std::string name_of_context = create_new_context()->name;
+ if( arguments.size() != function->names_of_arguments.size())
+ {
+ result.type = SenchaObject::invalid;
+ return result;
+ }
+
for(unsigned int i = 0; i < function->names_of_arguments.size(); i++)
get_top()->add(function->names_of_arguments[i], arguments[i]->evaluate());
result = (*function)();