|
1 | 1 | #include <node.h>
|
| 2 | +#include <nan.h> |
2 | 3 | #include <v8.h>
|
3 | 4 | #include <vector>
|
4 | 5 | #include "mouse.h"
|
@@ -165,26 +166,28 @@ Handle<Value> getWindows(const Arguments& args)
|
165 | 166 |
|
166 | 167 | void init(Handle<Object> target)
|
167 | 168 | {
|
168 |
| - target->Set(String::NewSymbol("moveMouse"), |
169 |
| - FunctionTemplate::New(moveMouse)->GetFunction()); |
170 | 169 |
|
171 |
| - target->Set(String::NewSymbol("getMousePos"), |
172 |
| - FunctionTemplate::New(getMousePos)->GetFunction()); |
| 170 | + target->Set(NanNew<String>("moveMouse"), |
| 171 | + NanNew<FunctionTemplate>(moveMouse)->GetFunction()); |
173 | 172 |
|
174 |
| - target->Set(String::NewSymbol("mouseClick"), |
175 |
| - FunctionTemplate::New(mouseClick)->GetFunction()); |
| 173 | + target->Set(NanNew<String>("getMousePos"), |
| 174 | + NanNew<FunctionTemplate>(getMousePos)->GetFunction()); |
176 | 175 |
|
177 |
| - target->Set(String::NewSymbol("keyTap"), |
178 |
| - FunctionTemplate::New(keyTap)->GetFunction()); |
| 176 | + target->Set(NanNew<String>("mouseClick"), |
| 177 | + NanNew<FunctionTemplate>(mouseClick)->GetFunction()); |
179 | 178 |
|
180 |
| - target->Set(String::NewSymbol("typeString"), |
181 |
| - FunctionTemplate::New(typeString)->GetFunction()); |
| 179 | + target->Set(NanNew<String>("keyTap"), |
| 180 | + NanNew<FunctionTemplate>(keyTap)->GetFunction()); |
182 | 181 |
|
183 |
| - target->Set(String::NewSymbol("captureScreen"), |
184 |
| - FunctionTemplate::New(captureScreen)->GetFunction()); |
| 182 | + target->Set(NanNew<String>("typeString"), |
| 183 | + NanNew<FunctionTemplate>(typeString)->GetFunction()); |
| 184 | + |
| 185 | + target->Set(NanNew<String>("captureScreen"), |
| 186 | + NanNew<FunctionTemplate>(captureScreen)->GetFunction()); |
| 187 | + |
| 188 | + target->Set(NanNew<String>("getWindows"), |
| 189 | + NanNew<FunctionTemplate>(getWindows)->GetFunction()); |
185 | 190 |
|
186 |
| - target->Set(String::NewSymbol("getWindows"), |
187 |
| - FunctionTemplate::New(getWindows)->GetFunction()); |
188 | 191 | }
|
189 | 192 |
|
190 | 193 | NODE_MODULE(robotjs, init)
|
0 commit comments