GeezerVison is showing github.com — src: replace usage of v8::Handle with v8::Local · littledan/node@4abc896
File treeExpand file treeCollapse file tree Open diff view settings benchmark/misc/function_call hello-world-function-export
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: benchmark/misc/function_call/binding.cc +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,7 +9,7 @@ void Hello(const FunctionCallbackInfo<Value>& args) { | 9 | 9 | args.GetReturnValue().Set(c++); | 10 | 10 | } | 11 | 11 |
| 12 | | -extern "C" void init (Handle<Object> target) { | | 12 | +extern "C" void init (Local<Object> target) { | 13 | 13 | HandleScope scope(Isolate::GetCurrent()); | 14 | 14 | NODE_SET_METHOD(target, "hello", Hello); | 15 | 15 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/async-wrap-inl.h +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 14 | 14 | namespace node { | 15 | 15 |
| 16 | 16 | inline AsyncWrap::AsyncWrap(Environment* env, | 17 | | - v8::Handle<v8::Object> object, | | 17 | + v8::Local<v8::Object> object, | 18 | 18 | ProviderType provider, | 19 | 19 | AsyncWrap* parent) | 20 | 20 | : BaseObject(env, object), bits_(static_cast<uint32_t>(provider) << 1) { | @@ -58,20 +58,20 @@ inline AsyncWrap::ProviderType AsyncWrap::provider_type() const { | 58 | 58 | } | 59 | 59 |
| 60 | 60 |
| 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, | 63 | 63 | int argc, | 64 | | - v8::Handle<v8::Value>* argv) { | | 64 | + v8::Local<v8::Value>* argv) { | 65 | 65 | v8::Local<v8::Value> cb_v = object()->Get(symbol); | 66 | 66 | CHECK(cb_v->IsFunction()); | 67 | 67 | return MakeCallback(cb_v.As<v8::Function>(), argc, argv); | 68 | 68 | } | 69 | 69 |
| 70 | 70 |
| 71 | | -inline v8::Handle<v8::Value> AsyncWrap::MakeCallback( | | 71 | +inline v8::Local<v8::Value> AsyncWrap::MakeCallback( | 72 | 72 | uint32_t index, | 73 | 73 | int argc, | 74 | | - v8::Handle<v8::Value>* argv) { | | 74 | + v8::Local<v8::Value>* argv) { | 75 | 75 | v8::Local<v8::Value> cb_v = object()->Get(index); | 76 | 76 | CHECK(cb_v->IsFunction()); | 77 | 77 | return MakeCallback(cb_v.As<v8::Function>(), argc, argv); | |
Collapse file Copy file name to clipboardExpand all lines: src/async-wrap.cc +6-7Lines changed: 6 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -12,7 +12,6 @@ using v8::Array; | 12 | 12 | using v8::Context; | 13 | 13 | using v8::Function; | 14 | 14 | using v8::FunctionCallbackInfo; | 15 | | -using v8::Handle; | 16 | 15 | using v8::HandleScope; | 17 | 16 | using v8::HeapProfiler; | 18 | 17 | using v8::Integer; | @@ -83,7 +82,7 @@ intptr_t RetainedAsyncInfo::GetSizeInBytes() { | 83 | 82 | } | 84 | 83 |
| 85 | 84 |
| 86 | | -RetainedObjectInfo* WrapperInfo(uint16_t class_id, Handle<Value> wrapper) { | | 85 | +RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local<Value> wrapper) { | 87 | 86 | // No class_id should be the provider type of NONE. | 88 | 87 | CHECK_NE(NODE_ASYNC_ID_OFFSET, class_id); | 89 | 88 | CHECK(wrapper->IsObject()); | @@ -129,9 +128,9 @@ static void SetupHooks(const FunctionCallbackInfo<Value>& args) { | 129 | 128 | } | 130 | 129 |
| 131 | 130 |
| 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) { | 135 | 134 | Environment* env = Environment::GetCurrent(context); | 136 | 135 | Isolate* isolate = env->isolate(); | 137 | 136 | HandleScope scope(isolate); | @@ -160,9 +159,9 @@ void LoadAsyncWrapperInfo(Environment* env) { | 160 | 159 | } | 161 | 160 |
| 162 | 161 |
| 163 | | -Handle<Value> AsyncWrap::MakeCallback(const Handle<Function> cb, | | 162 | +Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb, | 164 | 163 | int argc, | 165 | | - Handle<Value>* argv) { | | 164 | + Local<Value>* argv) { | 166 | 165 | CHECK(env()->context() == env()->isolate()->GetCurrentContext()); | 167 | 166 |
| 168 | 167 | Local<Object> context = object(); | |
Collapse file Copy file name to clipboardExpand all lines: src/async-wrap.h +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -47,7 +47,7 @@ class AsyncWrap : public BaseObject { | 47 | 47 | }; | 48 | 48 |
| 49 | 49 | inline AsyncWrap(Environment* env, | 50 | | - v8::Handle<v8::Object> object, | | 50 | + v8::Local<v8::Object> object, | 51 | 51 | ProviderType provider, | 52 | 52 | AsyncWrap* parent = nullptr); | 53 | 53 |
| @@ -56,15 +56,15 @@ class AsyncWrap : public BaseObject { | 56 | 56 | inline ProviderType provider_type() const; | 57 | 57 |
| 58 | 58 | // 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, | 60 | 60 | 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, | 63 | 63 | 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, | 66 | 66 | int argc, | 67 | | - v8::Handle<v8::Value>* argv); | | 67 | + v8::Local<v8::Value>* argv); | 68 | 68 |
| 69 | 69 | virtual size_t self_size() const = 0; | 70 | 70 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/cares_wrap.cc +3-4Lines changed: 3 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -38,7 +38,6 @@ using v8::EscapableHandleScope; | 38 | 38 | using v8::Function; | 39 | 39 | using v8::FunctionCallbackInfo; | 40 | 40 | using v8::FunctionTemplate; | 41 | | -using v8::Handle; | 42 | 41 | using v8::HandleScope; | 43 | 42 | using v8::Integer; | 44 | 43 | using v8::Local; | @@ -1240,9 +1239,9 @@ static void CaresTimerClose(Environment* env, | 1240 | 1239 | } | 1241 | 1240 |
| 1242 | 1241 |
| 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) { | 1246 | 1245 | Environment* env = Environment::GetCurrent(context); | 1247 | 1246 |
| 1248 | 1247 | int r = ares_library_init(ARES_LIB_INIT_ALL); | |
Collapse file Copy file name to clipboardExpand all lines: src/debug-agent.cc -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,6 @@ using v8::Context; | 39 | 39 | using v8::Function; | 40 | 40 | using v8::FunctionCallbackInfo; | 41 | 41 | using v8::FunctionTemplate; | 42 | | -using v8::Handle; | 43 | 42 | using v8::HandleScope; | 44 | 43 | using v8::Integer; | 45 | 44 | using v8::Isolate; | |
Collapse file Copy file name to clipboardExpand all lines: src/fs_event_wrap.cc +8-9Lines changed: 8 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,6 @@ namespace node { | 14 | 14 | using v8::Context; | 15 | 15 | using v8::FunctionCallbackInfo; | 16 | 16 | using v8::FunctionTemplate; | 17 | | -using v8::Handle; | 18 | 17 | using v8::HandleScope; | 19 | 18 | using v8::Integer; | 20 | 19 | using v8::Local; | @@ -24,17 +23,17 @@ using v8::Value; | 24 | 23 |
| 25 | 24 | class FSEventWrap: public HandleWrap { | 26 | 25 | 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); | 30 | 29 | static void New(const FunctionCallbackInfo<Value>& args); | 31 | 30 | static void Start(const FunctionCallbackInfo<Value>& args); | 32 | 31 | static void Close(const FunctionCallbackInfo<Value>& args); | 33 | 32 |
| 34 | 33 | size_t self_size() const override { return sizeof(*this); } | 35 | 34 |
| 36 | 35 | private: | 37 | | - FSEventWrap(Environment* env, Handle<Object> object); | | 36 | + FSEventWrap(Environment* env, Local<Object> object); | 38 | 37 | virtual ~FSEventWrap() override; | 39 | 38 |
| 40 | 39 | static void OnEvent(uv_fs_event_t* handle, const char* filename, int events, | @@ -45,7 +44,7 @@ class FSEventWrap: public HandleWrap { | 45 | 44 | }; | 46 | 45 |
| 47 | 46 |
| 48 | | -FSEventWrap::FSEventWrap(Environment* env, Handle<Object> object) | | 47 | +FSEventWrap::FSEventWrap(Environment* env, Local<Object> object) | 49 | 48 | : HandleWrap(env, | 50 | 49 | object, | 51 | 50 | reinterpret_cast<uv_handle_t*>(&handle_), | @@ -59,9 +58,9 @@ FSEventWrap::~FSEventWrap() { | 59 | 58 | } | 60 | 59 |
| 61 | 60 |
| 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) { | 65 | 64 | Environment* env = Environment::GetCurrent(context); | 66 | 65 |
| 67 | 66 | Local<FunctionTemplate> t = env->NewFunctionTemplate(New); | |
Collapse file Copy file name to clipboardExpand all lines: src/handle_wrap.cc +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,6 @@ namespace node { | 11 | 11 |
| 12 | 12 | using v8::Context; | 13 | 13 | using v8::FunctionCallbackInfo; | 14 | | -using v8::Handle; | 15 | 14 | using v8::HandleScope; | 16 | 15 | using v8::Local; | 17 | 16 | using v8::Object; | @@ -59,7 +58,7 @@ void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) { | 59 | 58 |
| 60 | 59 |
| 61 | 60 | HandleWrap::HandleWrap(Environment* env, | 62 | | - Handle<Object> object, | | 61 | + Local<Object> object, | 63 | 62 | uv_handle_t* handle, | 64 | 63 | AsyncWrap::ProviderType provider, | 65 | 64 | AsyncWrap* parent) | |
Collapse file Copy file name to clipboardExpand all lines: src/handle_wrap.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -44,7 +44,7 @@ class HandleWrap : public AsyncWrap { | 44 | 44 |
| 45 | 45 | protected: | 46 | 46 | HandleWrap(Environment* env, | 47 | | - v8::Handle<v8::Object> object, | | 47 | + v8::Local<v8::Object> object, | 48 | 48 | uv_handle_t* handle, | 49 | 49 | AsyncWrap::ProviderType provider, | 50 | 50 | AsyncWrap* parent = nullptr); | |
Collapse file Copy file name to clipboardExpand all lines: src/js_stream.cc +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,14 +15,13 @@ using v8::Context; | 15 | 15 | using v8::External; | 16 | 16 | using v8::FunctionCallbackInfo; | 17 | 17 | using v8::FunctionTemplate; | 18 | | -using v8::Handle; | 19 | 18 | using v8::HandleScope; | 20 | 19 | using v8::Local; | 21 | 20 | using v8::Object; | 22 | 21 | using v8::Value; | 23 | 22 |
| 24 | 23 |
| 25 | | -JSStream::JSStream(Environment* env, Handle<Object> obj, AsyncWrap* parent) | | 24 | +JSStream::JSStream(Environment* env, Local<Object> obj, AsyncWrap* parent) | 26 | 25 | : StreamBase(env), | 27 | 26 | AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) { | 28 | 27 | node::Wrap(obj, this); | @@ -201,9 +200,9 @@ void JSStream::EmitEOF(const FunctionCallbackInfo<Value>& args) { | 201 | 200 | } | 202 | 201 |
| 203 | 202 |
| 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) { | 207 | 206 | Environment* env = Environment::GetCurrent(context); | 208 | 207 |
| 209 | 208 | Local<FunctionTemplate> t = env->NewFunctionTemplate(New); | |
|