3
3
#include " async_wrap.h"
4
4
#include " env-inl.h"
5
5
#include " node_buffer.h"
6
+ #include " node_errors.h"
6
7
#include " node_internals.h"
7
8
#include " stream_base-inl.h"
8
9
#include " v8.h"
9
10
10
11
namespace node {
11
12
13
+ using errors::TryCatchScope;
14
+
12
15
using v8::Array;
13
16
using v8::Context;
14
17
using v8::FunctionCallbackInfo;
@@ -18,7 +21,6 @@ using v8::Int32;
18
21
using v8::Local;
19
22
using v8::Object;
20
23
using v8::String;
21
- using v8::TryCatch;
22
24
using v8::Value;
23
25
24
26
@@ -42,7 +44,7 @@ bool JSStream::IsAlive() {
42
44
bool JSStream::IsClosing () {
43
45
HandleScope scope (env ()->isolate ());
44
46
Context::Scope context_scope (env ()->context ());
45
- TryCatch try_catch (env ()-> isolate ());
47
+ TryCatchScope try_catch (env ());
46
48
Local<Value> value;
47
49
if (!MakeCallback (env ()->isclosing_string (), 0 , nullptr ).ToLocal (&value)) {
48
50
if (!try_catch.HasTerminated ())
@@ -56,7 +58,7 @@ bool JSStream::IsClosing() {
56
58
int JSStream::ReadStart () {
57
59
HandleScope scope (env ()->isolate ());
58
60
Context::Scope context_scope (env ()->context ());
59
- TryCatch try_catch (env ()-> isolate ());
61
+ TryCatchScope try_catch (env ());
60
62
Local<Value> value;
61
63
int value_int = UV_EPROTO;
62
64
if (!MakeCallback (env ()->onreadstart_string (), 0 , nullptr ).ToLocal (&value) ||
@@ -71,7 +73,7 @@ int JSStream::ReadStart() {
71
73
int JSStream::ReadStop () {
72
74
HandleScope scope (env ()->isolate ());
73
75
Context::Scope context_scope (env ()->context ());
74
- TryCatch try_catch (env ()-> isolate ());
76
+ TryCatchScope try_catch (env ());
75
77
Local<Value> value;
76
78
int value_int = UV_EPROTO;
77
79
if (!MakeCallback (env ()->onreadstop_string (), 0 , nullptr ).ToLocal (&value) ||
@@ -91,7 +93,7 @@ int JSStream::DoShutdown(ShutdownWrap* req_wrap) {
91
93
req_wrap->object ()
92
94
};
93
95
94
- TryCatch try_catch (env ()-> isolate ());
96
+ TryCatchScope try_catch (env ());
95
97
Local<Value> value;
96
98
int value_int = UV_EPROTO;
97
99
if (!MakeCallback (env ()->onshutdown_string (),
@@ -126,7 +128,7 @@ int JSStream::DoWrite(WriteWrap* w,
126
128
bufs_arr
127
129
};
128
130
129
- TryCatch try_catch (env ()-> isolate ());
131
+ TryCatchScope try_catch (env ());
130
132
Local<Value> value;
131
133
int value_int = UV_EPROTO;
132
134
if (!MakeCallback (env ()->onwrite_string (),
0 commit comments