This repository has been archived by the owner on Aug 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: nodejs/node#16160 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
- Loading branch information
1 parent
2a0c522
commit 63f38d9
Showing
2 changed files
with
4 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
#include <v8.h> | ||
#include <node.h> | ||
|
||
using namespace v8; | ||
|
||
static int c = 0; | ||
|
||
void Hello(const FunctionCallbackInfo<Value>& args) { | ||
void Hello(const v8::FunctionCallbackInfo<v8::Value>& args) { | ||
args.GetReturnValue().Set(c++); | ||
} | ||
|
||
extern "C" void init (Local<Object> target) { | ||
HandleScope scope(Isolate::GetCurrent()); | ||
void Initialize(v8::Local<v8::Object> target) { | ||
NODE_SET_METHOD(target, "hello", Hello); | ||
} | ||
|
||
NODE_MODULE(NODE_GYP_MODULE_NAME, init) | ||
NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) |