diff --git a/doc/api/addons.markdown b/doc/api/addons.markdown index 6b54069f2d..f4009cb8db 100644 --- a/doc/api/addons.markdown +++ b/doc/api/addons.markdown @@ -33,13 +33,13 @@ To get started we create a file `hello.cc`: using namespace v8; - Handle Method(const Arguments &args) { + Handle Method(const Arguments& args) { HandleScope scope; - return String::New("world"); + return scope.Close(String::New("world")); } - void init (Handle target) { - NODE_SET_METHOD(target, Method); + void init(Handle target) { + NODE_SET_METHOD(target, "method", Method); } NODE_MODULE(hello, init)