Skip to content

Commit abc80d4

Browse files
committed
src: replace Environment::GetCurrent with args.GetIsolate
1 parent 4984b15 commit abc80d4

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/node_util.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ CHAR_TEST(16, IsUnicodeSurrogateTrail, (ch & 0x400) != 0)
5353

5454
static void GetOwnNonIndexProperties(
5555
const FunctionCallbackInfo<Value>& args) {
56-
Environment* env = Environment::GetCurrent(args);
57-
Local<Context> context = env->context();
56+
Isolate* isolate = args.GetIsolate();
57+
Local<Context> context = isolate->GetCurrentContext();
5858

5959
CHECK(args[0]->IsObject());
6060
CHECK(args[1]->IsUint32());
@@ -168,7 +168,7 @@ static void PreviewEntries(const FunctionCallbackInfo<Value>& args) {
168168
if (!args[0]->IsObject())
169169
return;
170170

171-
Environment* env = Environment::GetCurrent(args);
171+
Isolate* isolate = args.GetIsolate();
172172
bool is_key_value;
173173
Local<Array> entries;
174174
if (!args[0].As<Object>()->PreviewEntries(&is_key_value).ToLocal(&entries))
@@ -179,10 +179,10 @@ static void PreviewEntries(const FunctionCallbackInfo<Value>& args) {
179179

180180
Local<Value> ret[] = {
181181
entries,
182-
Boolean::New(env->isolate(), is_key_value)
182+
Boolean::New(isolate, is_key_value)
183183
};
184184
return args.GetReturnValue().Set(
185-
Array::New(env->isolate(), ret, arraysize(ret)));
185+
Array::New(isolate, ret, arraysize(ret)));
186186
}
187187

188188
static void Sleep(const FunctionCallbackInfo<Value>& args) {
@@ -222,9 +222,9 @@ static uint32_t GetUVHandleTypeCode(const uv_handle_type type) {
222222
}
223223

224224
static void GuessHandleType(const FunctionCallbackInfo<Value>& args) {
225-
Environment* env = Environment::GetCurrent(args);
226225
int fd;
227-
if (!args[0]->Int32Value(env->context()).To(&fd)) return;
226+
if (!args[0]->Int32Value(args.GetIsolate()->GetCurrentContext()).To(&fd))
227+
return;
228228
CHECK_GE(fd, 0);
229229

230230
uv_handle_type t = uv_guess_handle(fd);

src/uv.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ void ErrName(const FunctionCallbackInfo<Value>& args) {
8686
}
8787

8888
void GetErrMap(const FunctionCallbackInfo<Value>& args) {
89-
Environment* env = Environment::GetCurrent(args);
90-
Isolate* isolate = env->isolate();
91-
Local<Context> context = env->context();
89+
Isolate* isolate = args.GetIsolate();
90+
Local<Context> context = isolate->GetCurrentContext();
9291

9392
// This can't return a SafeMap, because the uv binding can be referenced
9493
// by user code by using `process.binding('uv').getErrorMap()`:

0 commit comments

Comments
 (0)