Created
November 7, 2009 13:46
-
-
Save aq1018/228710 to your computer and use it in GitHub Desktop.
flusspferd dies with this...
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
#include <boost/spirit/home/phoenix/core.hpp> | |
#include <boost/spirit/home/phoenix/bind.hpp> | |
#include <boost/spirit/home/phoenix/operator.hpp> | |
#include <boost/bind.hpp> | |
#include "flusspferd.hpp" | |
using namespace flusspferd; | |
using namespace std; | |
namespace phoenix = boost::phoenix; | |
namespace args = phoenix::arg_names; | |
void callback(function& fn){ | |
fn.call(global()); | |
} | |
int main(int argc, char **argv) | |
{ | |
try { | |
init::initialize(); | |
context co = context::create(); | |
current_context_scope scope(co); | |
object g = global(); | |
security::create(g); | |
load_core(g, argv[0]); | |
create_native_function(g, "gc", &gc); | |
create_native_function(g, "execute", &callback); | |
gc(); | |
execute("test.js"); | |
return 0; | |
} catch (flusspferd::exception &fe) { | |
std::cout << fe.what(); | |
return 0; | |
} catch (std::exception &e) { | |
std::cout << e.what(); | |
return 1; | |
} | |
} |
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
var test2 = require("./test2"); | |
execute(test2.callback); |
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
var sys = require("system"); | |
var print = function(){ | |
sys.stdout.print.apply(sys.stdout, arguments); | |
} | |
exports.callback = function(){print("running callback");}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment