-
-
Save danhedron/c91cc252aa458b8436ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handle<Value> require( const Arguments& args ) { | |
HandleScope handle_scope; | |
String::Utf8Value file(args[i]); | |
TryCatch tryc; | |
Logging::getLog()->log("Executing: " + std::string(*file)); | |
Handle<String> source = String::New(loadSource(*file).c_str()); | |
Handle<Script> script = Script::New(source, args[i]); | |
if( tryc.HasCaught() ) { | |
String::AsciiValue stacktr(tryc.StackTrace()); | |
Logging::getLog()->log(*stacktr); | |
} | |
Handle<Value> r = script->Run(); | |
if( tryc.HasCaught() ) { | |
String::AsciiValue stacktr(tryc.StackTrace()); | |
Logging::getLog()->log(*stacktr); | |
} | |
if( !r.IsEmpty() ) | |
{ | |
return handle_scope.Close(r); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment