Permalink
Browse files

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 <info@bnoordhuis.nl>
  • Loading branch information...
targos authored and rvagg committed Jul 18, 2015
1 parent b1a2d95 commit 7ce749d722dcb1b89d171fa98a6b7b2120d4f56c
Showing with 347 additions and 383 deletions.
  1. +1 −1 benchmark/misc/function_call/binding.cc
  2. +6 −6 src/async-wrap-inl.h
  3. +6 −7 src/async-wrap.cc
  4. +7 −7 src/async-wrap.h
  5. +3 −4 src/cares_wrap.cc
  6. +0 −1 src/debug-agent.cc
  7. +8 −9 src/fs_event_wrap.cc
  8. +1 −2 src/handle_wrap.cc
  9. +1 −1 src/handle_wrap.h
  10. +4 −5 src/js_stream.cc
  11. +4 −4 src/js_stream.h
  12. +45 −46 src/node.cc
  13. +27 −27 src/node.h
  14. +13 −14 src/node_buffer.cc
  15. +7 −7 src/node_buffer.h
  16. +9 −9 src/node_constants.cc
  17. +1 −1 src/node_constants.h
  18. +4 −5 src/node_contextify.cc
  19. +2 −3 src/node_counters.cc
  20. +2 −2 src/node_counters.h
  21. +18 −19 src/node_crypto.cc
  22. +13 −13 src/node_crypto.h
  23. +1 −2 src/node_dtrace.cc
  24. +1 −1 src/node_dtrace.h
  25. +3 −4 src/node_file.cc
  26. +1 −1 src/node_file.h
  27. +3 −4 src/node_http_parser.cc
  28. +1 −1 src/node_http_parser.h
  29. +18 −18 src/node_internals.h
  30. +3 −4 src/node_javascript.cc
  31. +2 −2 src/node_javascript.h
  32. +1 −2 src/node_lttng.cc
  33. +1 −1 src/node_lttng.h
  34. +2 −2 src/node_object_wrap.h
  35. +3 −4 src/node_os.cc
  36. +1 −2 src/node_stat_watcher.cc
  37. +1 −1 src/node_stat_watcher.h
  38. +3 −4 src/node_v8.cc
  39. +4 −5 src/node_zlib.cc
  40. +4 −5 src/pipe_wrap.cc
  41. +4 −4 src/pipe_wrap.h
  42. +4 −5 src/process_wrap.cc
  43. +1 −1 src/req-wrap-inl.h
  44. +1 −1 src/req-wrap.h
  45. +4 −5 src/signal_wrap.cc
  46. +3 −4 src/spawn_sync.cc
  47. +3 −4 src/spawn_sync.h
  48. +1 −2 src/stream_base-inl.h
  49. +4 −5 src/stream_base.cc
  50. +1 −1 src/stream_base.h
  51. +4 −5 src/stream_wrap.cc
  52. +4 −4 src/stream_wrap.h
  53. +5 −6 src/string_bytes.cc
  54. +13 −13 src/string_bytes.h
  55. +4 −5 src/tcp_wrap.cc
  56. +4 −4 src/tcp_wrap.h
  57. +4 −5 src/timer_wrap.cc
  58. +3 −4 src/tls_wrap.cc
  59. +3 −3 src/tls_wrap.h
  60. +4 −5 src/tty_wrap.cc
  61. +4 −4 src/tty_wrap.h
  62. +4 −5 src/udp_wrap.cc
  63. +4 −4 src/udp_wrap.h
  64. +1 −1 src/util.cc
  65. +1 −1 src/util.h
  66. +4 −4 src/uv.cc
  67. +2 −2 test/addons/async-hello-world/binding.cc
  68. +1 −2 test/addons/at-exit/binding.cc
  69. +1 −1 test/addons/hello-world-function-export/binding.cc
  70. +1 −1 test/addons/hello-world/binding.cc
  71. +2 −2 test/addons/repl-domain-abort/binding.cc
  72. +13 −14 test/gc/node_modules/weak/src/weakref.cc
@@ -9,7 +9,7 @@ void Hello(const FunctionCallbackInfo<Value>& args) {
args.GetReturnValue().Set(c++);
}
-extern "C" void init (Handle<Object> target) {
+extern "C" void init (Local<Object> target) {
HandleScope scope(Isolate::GetCurrent());
NODE_SET_METHOD(target, "hello", Hello);
}
View
@@ -14,7 +14,7 @@
namespace node {
inline AsyncWrap::AsyncWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
ProviderType provider,
AsyncWrap* parent)
: BaseObject(env, object), bits_(static_cast<uint32_t>(provider) << 1) {
@@ -58,20 +58,20 @@ inline AsyncWrap::ProviderType AsyncWrap::provider_type() const {
}
-inline v8::Handle<v8::Value> AsyncWrap::MakeCallback(
- const v8::Handle<v8::String> symbol,
+inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
+ const v8::Local<v8::String> symbol,
int argc,
- v8::Handle<v8::Value>* argv) {
+ v8::Local<v8::Value>* argv) {
v8::Local<v8::Value> cb_v = object()->Get(symbol);
CHECK(cb_v->IsFunction());
return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
}
-inline v8::Handle<v8::Value> AsyncWrap::MakeCallback(
+inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
uint32_t index,
int argc,
- v8::Handle<v8::Value>* argv) {
+ v8::Local<v8::Value>* argv) {
v8::Local<v8::Value> cb_v = object()->Get(index);
CHECK(cb_v->IsFunction());
return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
View
@@ -12,7 +12,6 @@ using v8::Array;
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HandleScope;
using v8::HeapProfiler;
using v8::Integer;
@@ -83,7 +82,7 @@ intptr_t RetainedAsyncInfo::GetSizeInBytes() {
}
-RetainedObjectInfo* WrapperInfo(uint16_t class_id, Handle<Value> wrapper) {
+RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local<Value> wrapper) {
// No class_id should be the provider type of NONE.
CHECK_NE(NODE_ASYNC_ID_OFFSET, class_id);
CHECK(wrapper->IsObject());
@@ -129,9 +128,9 @@ static void SetupHooks(const FunctionCallbackInfo<Value>& args) {
}
-static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
HandleScope scope(isolate);
@@ -160,9 +159,9 @@ void LoadAsyncWrapperInfo(Environment* env) {
}
-Handle<Value> AsyncWrap::MakeCallback(const Handle<Function> cb,
+Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
int argc,
- Handle<Value>* argv) {
+ Local<Value>* argv) {
CHECK(env()->context() == env()->isolate()->GetCurrentContext());
Local<Object> context = object();
View
@@ -47,7 +47,7 @@ class AsyncWrap : public BaseObject {
};
inline AsyncWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
ProviderType provider,
AsyncWrap* parent = nullptr);
@@ -56,15 +56,15 @@ class AsyncWrap : public BaseObject {
inline ProviderType provider_type() const;
// Only call these within a valid HandleScope.
- v8::Handle<v8::Value> MakeCallback(const v8::Handle<v8::Function> cb,
+ v8::Local<v8::Value> MakeCallback(const v8::Local<v8::Function> cb,
int argc,
- v8::Handle<v8::Value>* argv);
- inline v8::Handle<v8::Value> MakeCallback(const v8::Handle<v8::String> symbol,
+ v8::Local<v8::Value>* argv);
+ inline v8::Local<v8::Value> MakeCallback(const v8::Local<v8::String> symbol,
int argc,
- v8::Handle<v8::Value>* argv);
- inline v8::Handle<v8::Value> MakeCallback(uint32_t index,
+ v8::Local<v8::Value>* argv);
+ inline v8::Local<v8::Value> MakeCallback(uint32_t index,
int argc,
- v8::Handle<v8::Value>* argv);
+ v8::Local<v8::Value>* argv);
virtual size_t self_size() const = 0;
View
@@ -38,7 +38,6 @@ using v8::EscapableHandleScope;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
@@ -1240,9 +1239,9 @@ static void CaresTimerClose(Environment* env,
}
-static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
int r = ares_library_init(ARES_LIB_INIT_ALL);
View
@@ -39,7 +39,6 @@ using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
View
@@ -14,7 +14,6 @@ namespace node {
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
@@ -24,17 +23,17 @@ using v8::Value;
class FSEventWrap: public HandleWrap {
public:
- static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context);
+ static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context);
static void New(const FunctionCallbackInfo<Value>& args);
static void Start(const FunctionCallbackInfo<Value>& args);
static void Close(const FunctionCallbackInfo<Value>& args);
size_t self_size() const override { return sizeof(*this); }
private:
- FSEventWrap(Environment* env, Handle<Object> object);
+ FSEventWrap(Environment* env, Local<Object> object);
virtual ~FSEventWrap() override;
static void OnEvent(uv_fs_event_t* handle, const char* filename, int events,
@@ -45,7 +44,7 @@ class FSEventWrap: public HandleWrap {
};
-FSEventWrap::FSEventWrap(Environment* env, Handle<Object> object)
+FSEventWrap::FSEventWrap(Environment* env, Local<Object> object)
: HandleWrap(env,
object,
reinterpret_cast<uv_handle_t*>(&handle_),
@@ -59,9 +58,9 @@ FSEventWrap::~FSEventWrap() {
}
-void FSEventWrap::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void FSEventWrap::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
View
@@ -11,7 +11,6 @@ namespace node {
using v8::Context;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HandleScope;
using v8::Local;
using v8::Object;
@@ -59,7 +58,7 @@ void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
HandleWrap::HandleWrap(Environment* env,
- Handle<Object> object,
+ Local<Object> object,
uv_handle_t* handle,
AsyncWrap::ProviderType provider,
AsyncWrap* parent)
View
@@ -44,7 +44,7 @@ class HandleWrap : public AsyncWrap {
protected:
HandleWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
uv_handle_t* handle,
AsyncWrap::ProviderType provider,
AsyncWrap* parent = nullptr);
View
@@ -15,14 +15,13 @@ using v8::Context;
using v8::External;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Local;
using v8::Object;
using v8::Value;
-JSStream::JSStream(Environment* env, Handle<Object> obj, AsyncWrap* parent)
+JSStream::JSStream(Environment* env, Local<Object> obj, AsyncWrap* parent)
: StreamBase(env),
AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) {
node::Wrap(obj, this);
@@ -201,9 +200,9 @@ void JSStream::EmitEOF(const FunctionCallbackInfo<Value>& args) {
}
-void JSStream::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void JSStream::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
View
@@ -10,9 +10,9 @@ namespace node {
class JSStream : public StreamBase, public AsyncWrap {
public:
- static void Initialize(v8::Handle<v8::Object> target,
- v8::Handle<v8::Value> unused,
- v8::Handle<v8::Context> context);
+ static void Initialize(v8::Local<v8::Object> target,
+ v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context);
~JSStream();
@@ -31,7 +31,7 @@ class JSStream : public StreamBase, public AsyncWrap {
size_t self_size() const override { return sizeof(*this); }
protected:
- JSStream(Environment* env, v8::Handle<v8::Object> obj, AsyncWrap* parent);
+ JSStream(Environment* env, v8::Local<v8::Object> obj, AsyncWrap* parent);
AsyncWrap* GetAsyncWrap() override;
Oops, something went wrong.

0 comments on commit 7ce749d

Please sign in to comment.