Use Application::Exit to implement the exit() script function

This commit is contained in:
Gunnar Beutner 2014-11-13 15:56:47 +01:00
parent f85be08480
commit 8e4148d33c
2 changed files with 2 additions and 7 deletions

View File

@ -25,6 +25,7 @@
#include "base/logger.hpp" #include "base/logger.hpp"
#include "base/objectlock.hpp" #include "base/objectlock.hpp"
#include "base/dynamictype.hpp" #include "base/dynamictype.hpp"
#include "base/application.hpp"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <algorithm> #include <algorithm>
@ -39,7 +40,7 @@ REGISTER_SCRIPTFUNCTION(union, &ScriptUtils::Union);
REGISTER_SCRIPTFUNCTION(intersection, &ScriptUtils::Intersection); REGISTER_SCRIPTFUNCTION(intersection, &ScriptUtils::Intersection);
REGISTER_SCRIPTFUNCTION(log, &ScriptUtils::Log); REGISTER_SCRIPTFUNCTION(log, &ScriptUtils::Log);
REGISTER_SCRIPTFUNCTION(range, &ScriptUtils::Range); REGISTER_SCRIPTFUNCTION(range, &ScriptUtils::Range);
REGISTER_SCRIPTFUNCTION(exit, &ScriptUtils::Exit); REGISTER_SCRIPTFUNCTION(exit, &Application::Exit);
REGISTER_SCRIPTFUNCTION(typeof, &ScriptUtils::TypeOf); REGISTER_SCRIPTFUNCTION(typeof, &ScriptUtils::TypeOf);
REGISTER_SCRIPTFUNCTION(keys, &ScriptUtils::Keys); REGISTER_SCRIPTFUNCTION(keys, &ScriptUtils::Keys);
REGISTER_SCRIPTFUNCTION(random, &Utility::Random); REGISTER_SCRIPTFUNCTION(random, &Utility::Random);
@ -179,11 +180,6 @@ Array::Ptr ScriptUtils::Range(const std::vector<Value>& arguments)
return result; return result;
} }
void ScriptUtils::Exit(int code)
{
exit(code);
}
Type::Ptr ScriptUtils::TypeOf(const Value& value) Type::Ptr ScriptUtils::TypeOf(const Value& value)
{ {
switch (value.GetType()) { switch (value.GetType()) {

View File

@ -42,7 +42,6 @@ public:
static Array::Ptr Intersection(const std::vector<Value>& arguments); static Array::Ptr Intersection(const std::vector<Value>& arguments);
static void Log(const std::vector<Value>& arguments); static void Log(const std::vector<Value>& arguments);
static Array::Ptr Range(const std::vector<Value>& arguments); static Array::Ptr Range(const std::vector<Value>& arguments);
static void Exit(int code);
static Type::Ptr TypeOf(const Value& value); static Type::Ptr TypeOf(const Value& value);
static Array::Ptr Keys(const Dictionary::Ptr& dict); static Array::Ptr Keys(const Dictionary::Ptr& dict);
static DynamicObject::Ptr GetObject(const String& type, const String& name); static DynamicObject::Ptr GetObject(const String& type, const String& name);