v8::Isolate::GetCurrent() is not exactly deprecated at this point but its use is strongly discouraged. Update the addon tests so they no longer use it. PR-URL: https://github.com/nodejs/node/pull/2427 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
14 lines
403 B
C++
14 lines
403 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
v8::Isolate* isolate = args.GetIsolate();
|
|
v8::HandleScope scope(isolate);
|
|
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
|
|
}
|
|
|
|
void init(v8::Handle<v8::Object> exports, v8::Handle<v8::Object> module) {
|
|
NODE_SET_METHOD(module, "exports", Method);
|
|
}
|
|
|
|
NODE_MODULE(binding, init);
|