Browse Source

docs: addons: fix NODE_SET_METHOD example

v0.7.4-release
Ben Noordhuis 14 years ago
parent
commit
004e6fbe1f
  1. 8
      doc/api/addons.markdown

8
doc/api/addons.markdown

@ -33,13 +33,13 @@ To get started we create a file `hello.cc`:
using namespace v8;
Handle<Value> Method(const Arguments &args) {
Handle<Value> Method(const Arguments& args) {
HandleScope scope;
return String::New("world");
return scope.Close(String::New("world"));
}
void init (Handle<Object> target) {
NODE_SET_METHOD(target, Method);
void init(Handle<Object> target) {
NODE_SET_METHOD(target, "method", Method);
}
NODE_MODULE(hello, init)

Loading…
Cancel
Save