view nodejs/mbfly_njs.cc @ 553:0a77b88500bf Android_Skia

rename _X_njs_MB_get_runtime to _X_njs_MB_get_X_runtime
author Thinker K.F. Li <thinker@branda.to>
date Sun, 06 Jun 2010 14:11:13 +0800
parents f69b0814ef3c
children c9d23f7279a4
line wrap: on
line source

#include <stdio.h>
#include <v8.h>

using namespace v8;

Handle<Value>
hello_func(const Arguments &args) {
    HandleScope scope;

    return String::Concat(String::New("World"), args[0]->ToString());
}

extern "C" void
init(Handle<Object> target) {
    HandleScope scope;
    Handle<FunctionTemplate> func;

    func = FunctionTemplate::New(hello_func);
    target->Set(String::New("Hello"), func->GetFunction());
}