mirror of
https://github.com/nodejs/node.git
synced 2025-05-15 03:29:46 +00:00

When using require to load a native addon the path must be converted into a long path, otherwise the addon will fail to be loaded on windows if the path is longer than 260 characters. PR-URL: https://github.com/nodejs/node/pull/2965 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <inglor@gmail.com>
14 lines
334 B
C++
14 lines
334 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
v8::Isolate* isolate = args.GetIsolate();
|
|
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
|
|
}
|
|
|
|
void init(v8::Local<v8::Object> target) {
|
|
NODE_SET_METHOD(target, "hello", Method);
|
|
}
|
|
|
|
NODE_MODULE(binding, init);
|