Skip to content

Commit 590aae7

Browse files
committed
src: replace usage of v8::Handle with v8::Local
v8::Handle is deprecated: https://codereview.chromium.org/1224623004 PR-URL: #2202 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 037c9ca commit 590aae7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+347
-383
lines changed

benchmark/misc/function_call/binding.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void Hello(const FunctionCallbackInfo<Value>& args) {
99
args.GetReturnValue().Set(c++);
1010
}
1111

12-
extern "C" void init (Handle<Object> target) {
12+
extern "C" void init (Local<Object> target) {
1313
HandleScope scope(Isolate::GetCurrent());
1414
NODE_SET_METHOD(target, "hello", Hello);
1515
}

src/async-wrap-inl.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace node {
1515

1616
inline AsyncWrap::AsyncWrap(Environment* env,
17-
v8::Handle<v8::Object> object,
17+
v8::Local<v8::Object> object,
1818
ProviderType provider,
1919
AsyncWrap* parent)
2020
: BaseObject(env, object), bits_(static_cast<uint32_t>(provider) << 1) {
@@ -58,20 +58,20 @@ inline AsyncWrap::ProviderType AsyncWrap::provider_type() const {
5858
}
5959

6060

61-
inline v8::Handle<v8::Value> AsyncWrap::MakeCallback(
62-
const v8::Handle<v8::String> symbol,
61+
inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
62+
const v8::Local<v8::String> symbol,
6363
int argc,
64-
v8::Handle<v8::Value>* argv) {
64+
v8::Local<v8::Value>* argv) {
6565
v8::Local<v8::Value> cb_v = object()->Get(symbol);
6666
CHECK(cb_v->IsFunction());
6767
return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
6868
}
6969

7070

71-
inline v8::Handle<v8::Value> AsyncWrap::MakeCallback(
71+
inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
7272
uint32_t index,
7373
int argc,
74-
v8::Handle<v8::Value>* argv) {
74+
v8::Local<v8::Value>* argv) {
7575
v8::Local<v8::Value> cb_v = object()->Get(index);
7676
CHECK(cb_v->IsFunction());
7777
return MakeCallback(cb_v.As<v8::Function>(), argc, argv);

src/async-wrap.cc

+6-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ using v8::Array;
1212
using v8::Context;
1313
using v8::Function;
1414
using v8::FunctionCallbackInfo;
15-
using v8::Handle;
1615
using v8::HandleScope;
1716
using v8::HeapProfiler;
1817
using v8::Integer;
@@ -83,7 +82,7 @@ intptr_t RetainedAsyncInfo::GetSizeInBytes() {
8382
}
8483

8584

86-
RetainedObjectInfo* WrapperInfo(uint16_t class_id, Handle<Value> wrapper) {
85+
RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local<Value> wrapper) {
8786
// No class_id should be the provider type of NONE.
8887
CHECK_NE(NODE_ASYNC_ID_OFFSET, class_id);
8988
CHECK(wrapper->IsObject());
@@ -129,9 +128,9 @@ static void SetupHooks(const FunctionCallbackInfo<Value>& args) {
129128
}
130129

131130

132-
static void Initialize(Handle<Object> target,
133-
Handle<Value> unused,
134-
Handle<Context> context) {
131+
static void Initialize(Local<Object> target,
132+
Local<Value> unused,
133+
Local<Context> context) {
135134
Environment* env = Environment::GetCurrent(context);
136135
Isolate* isolate = env->isolate();
137136
HandleScope scope(isolate);
@@ -160,9 +159,9 @@ void LoadAsyncWrapperInfo(Environment* env) {
160159
}
161160

162161

163-
Handle<Value> AsyncWrap::MakeCallback(const Handle<Function> cb,
162+
Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
164163
int argc,
165-
Handle<Value>* argv) {
164+
Local<Value>* argv) {
166165
CHECK(env()->context() == env()->isolate()->GetCurrentContext());
167166

168167
Local<Object> context = object();

src/async-wrap.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class AsyncWrap : public BaseObject {
4747
};
4848

4949
inline AsyncWrap(Environment* env,
50-
v8::Handle<v8::Object> object,
50+
v8::Local<v8::Object> object,
5151
ProviderType provider,
5252
AsyncWrap* parent = nullptr);
5353

@@ -56,15 +56,15 @@ class AsyncWrap : public BaseObject {
5656
inline ProviderType provider_type() const;
5757

5858
// Only call these within a valid HandleScope.
59-
v8::Handle<v8::Value> MakeCallback(const v8::Handle<v8::Function> cb,
59+
v8::Local<v8::Value> MakeCallback(const v8::Local<v8::Function> cb,
6060
int argc,
61-
v8::Handle<v8::Value>* argv);
62-
inline v8::Handle<v8::Value> MakeCallback(const v8::Handle<v8::String> symbol,
61+
v8::Local<v8::Value>* argv);
62+
inline v8::Local<v8::Value> MakeCallback(const v8::Local<v8::String> symbol,
6363
int argc,
64-
v8::Handle<v8::Value>* argv);
65-
inline v8::Handle<v8::Value> MakeCallback(uint32_t index,
64+
v8::Local<v8::Value>* argv);
65+
inline v8::Local<v8::Value> MakeCallback(uint32_t index,
6666
int argc,
67-
v8::Handle<v8::Value>* argv);
67+
v8::Local<v8::Value>* argv);
6868

6969
virtual size_t self_size() const = 0;
7070

src/cares_wrap.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ using v8::EscapableHandleScope;
3838
using v8::Function;
3939
using v8::FunctionCallbackInfo;
4040
using v8::FunctionTemplate;
41-
using v8::Handle;
4241
using v8::HandleScope;
4342
using v8::Integer;
4443
using v8::Local;
@@ -1240,9 +1239,9 @@ static void CaresTimerClose(Environment* env,
12401239
}
12411240

12421241

1243-
static void Initialize(Handle<Object> target,
1244-
Handle<Value> unused,
1245-
Handle<Context> context) {
1242+
static void Initialize(Local<Object> target,
1243+
Local<Value> unused,
1244+
Local<Context> context) {
12461245
Environment* env = Environment::GetCurrent(context);
12471246

12481247
int r = ares_library_init(ARES_LIB_INIT_ALL);

src/debug-agent.cc

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ using v8::Context;
3939
using v8::Function;
4040
using v8::FunctionCallbackInfo;
4141
using v8::FunctionTemplate;
42-
using v8::Handle;
4342
using v8::HandleScope;
4443
using v8::Integer;
4544
using v8::Isolate;

src/fs_event_wrap.cc

+8-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ namespace node {
1414
using v8::Context;
1515
using v8::FunctionCallbackInfo;
1616
using v8::FunctionTemplate;
17-
using v8::Handle;
1817
using v8::HandleScope;
1918
using v8::Integer;
2019
using v8::Local;
@@ -24,17 +23,17 @@ using v8::Value;
2423

2524
class FSEventWrap: public HandleWrap {
2625
public:
27-
static void Initialize(Handle<Object> target,
28-
Handle<Value> unused,
29-
Handle<Context> context);
26+
static void Initialize(Local<Object> target,
27+
Local<Value> unused,
28+
Local<Context> context);
3029
static void New(const FunctionCallbackInfo<Value>& args);
3130
static void Start(const FunctionCallbackInfo<Value>& args);
3231
static void Close(const FunctionCallbackInfo<Value>& args);
3332

3433
size_t self_size() const override { return sizeof(*this); }
3534

3635
private:
37-
FSEventWrap(Environment* env, Handle<Object> object);
36+
FSEventWrap(Environment* env, Local<Object> object);
3837
virtual ~FSEventWrap() override;
3938

4039
static void OnEvent(uv_fs_event_t* handle, const char* filename, int events,
@@ -45,7 +44,7 @@ class FSEventWrap: public HandleWrap {
4544
};
4645

4746

48-
FSEventWrap::FSEventWrap(Environment* env, Handle<Object> object)
47+
FSEventWrap::FSEventWrap(Environment* env, Local<Object> object)
4948
: HandleWrap(env,
5049
object,
5150
reinterpret_cast<uv_handle_t*>(&handle_),
@@ -59,9 +58,9 @@ FSEventWrap::~FSEventWrap() {
5958
}
6059

6160

62-
void FSEventWrap::Initialize(Handle<Object> target,
63-
Handle<Value> unused,
64-
Handle<Context> context) {
61+
void FSEventWrap::Initialize(Local<Object> target,
62+
Local<Value> unused,
63+
Local<Context> context) {
6564
Environment* env = Environment::GetCurrent(context);
6665

6766
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);

src/handle_wrap.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace node {
1111

1212
using v8::Context;
1313
using v8::FunctionCallbackInfo;
14-
using v8::Handle;
1514
using v8::HandleScope;
1615
using v8::Local;
1716
using v8::Object;
@@ -59,7 +58,7 @@ void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
5958

6059

6160
HandleWrap::HandleWrap(Environment* env,
62-
Handle<Object> object,
61+
Local<Object> object,
6362
uv_handle_t* handle,
6463
AsyncWrap::ProviderType provider,
6564
AsyncWrap* parent)

src/handle_wrap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class HandleWrap : public AsyncWrap {
4444

4545
protected:
4646
HandleWrap(Environment* env,
47-
v8::Handle<v8::Object> object,
47+
v8::Local<v8::Object> object,
4848
uv_handle_t* handle,
4949
AsyncWrap::ProviderType provider,
5050
AsyncWrap* parent = nullptr);

src/js_stream.cc

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ using v8::Context;
1515
using v8::External;
1616
using v8::FunctionCallbackInfo;
1717
using v8::FunctionTemplate;
18-
using v8::Handle;
1918
using v8::HandleScope;
2019
using v8::Local;
2120
using v8::Object;
2221
using v8::Value;
2322

2423

25-
JSStream::JSStream(Environment* env, Handle<Object> obj, AsyncWrap* parent)
24+
JSStream::JSStream(Environment* env, Local<Object> obj, AsyncWrap* parent)
2625
: StreamBase(env),
2726
AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) {
2827
node::Wrap(obj, this);
@@ -201,9 +200,9 @@ void JSStream::EmitEOF(const FunctionCallbackInfo<Value>& args) {
201200
}
202201

203202

204-
void JSStream::Initialize(Handle<Object> target,
205-
Handle<Value> unused,
206-
Handle<Context> context) {
203+
void JSStream::Initialize(Local<Object> target,
204+
Local<Value> unused,
205+
Local<Context> context) {
207206
Environment* env = Environment::GetCurrent(context);
208207

209208
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);

src/js_stream.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace node {
1010

1111
class JSStream : public StreamBase, public AsyncWrap {
1212
public:
13-
static void Initialize(v8::Handle<v8::Object> target,
14-
v8::Handle<v8::Value> unused,
15-
v8::Handle<v8::Context> context);
13+
static void Initialize(v8::Local<v8::Object> target,
14+
v8::Local<v8::Value> unused,
15+
v8::Local<v8::Context> context);
1616

1717
~JSStream();
1818

@@ -31,7 +31,7 @@ class JSStream : public StreamBase, public AsyncWrap {
3131
size_t self_size() const override { return sizeof(*this); }
3232

3333
protected:
34-
JSStream(Environment* env, v8::Handle<v8::Object> obj, AsyncWrap* parent);
34+
JSStream(Environment* env, v8::Local<v8::Object> obj, AsyncWrap* parent);
3535

3636
AsyncWrap* GetAsyncWrap() override;
3737

0 commit comments

Comments
 (0)