mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
src: refactor Environment::GetCurrent(isolate) usage
Do not require an explicit `HandleScope`, or the ability to create one, when using `Environment::GetCurrent()`. `isolate->InContext()` is used as an indicator that it is probably okay to create a `HandleScope`, see also the short discussion in https://github.com/nodejs/node/pull/25775#pullrequestreview-197371049. PR-URL: https://github.com/nodejs/node/pull/26376 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
5 files changed
+13
-9
No files matched your search
@@ -28,6 +28,7 @@ Local<Value> ErrnoException(Isolate* isolate,
|
||||
const char* msg,
|
||||
const char* path) {
|
||||
Environment* env = Environment::GetCurrent(isolate);
|
||||
CHECK_NOT_NULL(env);
|
||||
|
||||
Local<Value> e;
|
||||
Local<String> estring = OneByteString(isolate, errors::errno_string(errorno));
|
||||
@@ -99,6 +100,7 @@ Local<Value> UVException(Isolate* isolate,
|
||||
const char* path,
|
||||
const char* dest) {
|
||||
Environment* env = Environment::GetCurrent(isolate);
|
||||
CHECK_NOT_NULL(env);
|
||||
|
||||
if (!msg || !msg[0])
|
||||
msg = uv_strerror(errorno);
|
||||
@@ -187,6 +189,7 @@ Local<Value> WinapiErrnoException(Isolate* isolate,
|
||||
const char* msg,
|
||||
const char* path) {
|
||||
Environment* env = Environment::GetCurrent(isolate);
|
||||
CHECK_NOT_NULL(env);
|
||||
Local<Value> e;
|
||||
bool must_free = false;
|
||||
if (!msg || !msg[0]) {
|
||||
|
||||
Reference in new issue
Block a user