File tree Expand file tree Collapse file tree 9 files changed +26
-32
lines changed
Expand file tree Collapse file tree 9 files changed +26
-32
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,9 @@ Handle<Value> Method(const Arguments& args) {
88 return scope.Close (String::New (" world" ));
99}
1010
11- void init (Handle<Object> target) {
12- target->Get (String::NewSymbol (" exports" )).As <Object>()->Set (
13- String::NewSymbol (" hello" ),
11+ void init (Handle<Object> exports) {
12+ exports->Set (String::NewSymbol (" hello" ),
1413 FunctionTemplate::New (Method)->GetFunction ());
1514}
1615
17- NODE_MODULE_M (hello, init)
16+ NODE_MODULE (hello, init)
Original file line number Diff line number Diff line change @@ -21,10 +21,9 @@ Handle<Value> Add(const Arguments& args) {
2121 return scope.Close (num);
2222}
2323
24- void Init (Handle<Object> target) {
25- target->Get (String::NewSymbol (" exports" )).As <Object>()->Set (
26- String::NewSymbol (" add" ),
24+ void Init (Handle<Object> exports) {
25+ exports->Set (String::NewSymbol (" add" ),
2726 FunctionTemplate::New (Add)->GetFunction ());
2827}
2928
30- NODE_MODULE_M (addon, Init)
29+ NODE_MODULE (addon, Init)
Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ Handle<Value> RunCallback(const Arguments& args) {
1414 return scope.Close (Undefined ());
1515}
1616
17- void Init (Handle<Object> target ) {
18- target ->Set (String::NewSymbol (" exports" ),
17+ void Init (Handle<Object> exports, Handle<Object> module ) {
18+ module ->Set (String::NewSymbol (" exports" ),
1919 FunctionTemplate::New (RunCallback)->GetFunction ());
2020}
2121
22- NODE_MODULE_M (addon, Init)
22+ NODE_MODULE (addon, Init)
Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ Handle<Value> CreateObject(const Arguments& args) {
1212 return scope.Close (obj);
1313}
1414
15- void Init (Handle<Object> target ) {
16- target ->Set (String::NewSymbol (" exports" ),
15+ void Init (Handle<Object> exports, Handle<Object> module ) {
16+ module ->Set (String::NewSymbol (" exports" ),
1717 FunctionTemplate::New (CreateObject)->GetFunction ());
1818}
1919
20- NODE_MODULE_M (addon, Init)
20+ NODE_MODULE (addon, Init)
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ Handle<Value> CreateFunction(const Arguments& args) {
1818 return scope.Close (fn);
1919}
2020
21- void Init (Handle<Object> target ) {
22- target ->Set (String::NewSymbol (" exports" ),
21+ void Init (Handle<Object> exports, Handle<Object> module ) {
22+ module ->Set (String::NewSymbol (" exports" ),
2323 FunctionTemplate::New (CreateFunction)->GetFunction ());
2424}
2525
26- NODE_MODULE_M (addon, Init)
26+ NODE_MODULE (addon, Init)
Original file line number Diff line number Diff line change 44
55using namespace v8 ;
66
7- void InitAll (Handle<Object> target ) {
8- MyObject::Init (target );
7+ void InitAll (Handle<Object> exports ) {
8+ MyObject::Init (exports );
99}
1010
11- NODE_MODULE_M (addon, InitAll)
11+ NODE_MODULE (addon, InitAll)
Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ void MyObject::Init(Handle<Object> target) {
1717 FunctionTemplate::New (PlusOne)->GetFunction ());
1818
1919 Persistent<Function> constructor = Persistent<Function>::New (tpl->GetFunction ());
20- target->Get (String::NewSymbol (" exports" )).As <Object>()->Set (
21- String::NewSymbol (" MyObject" ),
22- constructor);
20+ target->Set (String::NewSymbol (" MyObject" ), constructor);
2321}
2422
2523Handle<Value> MyObject::New (const Arguments& args) {
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ Handle<Value> CreateObject(const Arguments& args) {
99 return scope.Close (MyObject::NewInstance (args));
1010}
1111
12- void InitAll (Handle<Object> target ) {
12+ void InitAll (Handle<Object> exports, Handle<Object> module ) {
1313 MyObject::Init ();
1414
15- target ->Set (String::NewSymbol (" exports" ),
15+ module ->Set (String::NewSymbol (" exports" ),
1616 FunctionTemplate::New (CreateObject)->GetFunction ());
1717}
1818
19- NODE_MODULE_M (addon, InitAll)
19+ NODE_MODULE (addon, InitAll)
Original file line number Diff line number Diff line change @@ -21,16 +21,14 @@ Handle<Value> Add(const Arguments& args) {
2121 return scope.Close (Number::New (sum));
2222}
2323
24- void InitAll (Handle<Object> target ) {
24+ void InitAll (Handle<Object> exports ) {
2525 MyObject::Init ();
2626
27- target->Get (String::NewSymbol (" exports" )).As <Object>()->Set (
28- String::NewSymbol (" createObject" ),
27+ exports->Set (String::NewSymbol (" createObject" ),
2928 FunctionTemplate::New (CreateObject)->GetFunction ());
3029
31- target->Get (String::NewSymbol (" exports" )).As <Object>()->Set (
32- String::NewSymbol (" add" ),
30+ exports->Set (String::NewSymbol (" add" ),
3331 FunctionTemplate::New (Add)->GetFunction ());
3432}
3533
36- NODE_MODULE_M (addon, InitAll)
34+ NODE_MODULE (addon, InitAll)
You can’t perform that action at this time.
0 commit comments