Advertisement
Guest User

Hyperlisk

a guest
Apr 4th, 2010
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1.  
  2. #include <nds.h>
  3. #include <v8.h>
  4. #include <stdio.h>
  5.  
  6. using namespace v8;
  7.  
  8. int main(int argc, char* argv[]) {
  9.   defaultExceptionHandler();
  10.   consoleDemoInit();
  11.   printf("Testing...\n");
  12.   while(1){
  13.     swiWaitForVBlank();
  14.   }
  15.   return 0;
  16. }
  17.  
  18. void test(){
  19.   // Create a stack-allocated handle scope.
  20.   HandleScope handle_scope;
  21.   // Create a new context.
  22.   Handle<Context> context = Context::New();
  23.   // Enter the created context for compiling and
  24.   // running the hello world script.
  25.   Context::Scope context_scope(context);
  26.   // Create a string containing the JavaScript source code.
  27.   Handle<String> source = String::New("'Hello' + ', World!'");
  28.   // Compile the source code.
  29.   Handle<Script> script = Script::Compile(source);
  30.   // Run the script to get the result.
  31.   Handle<Value> result = script->Run();
  32.   // Convert the result to an ASCII string and print it.
  33.   String::AsciiValue ascii(result);
  34.   printf("%s\n", *ascii);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement