diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 92b34f5a8b99c2..bb85e69b5fe3d4 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -128,7 +128,7 @@ v8::Maybe ModuleWrap::CheckUnsettledTopLevelAwait() { } if (env()->options()->warnings) { - for (auto pair : stalled) { + for (auto& pair : stalled) { Local message = std::get<1>(pair); std::string reason = "Warning: Detected unsettled top-level await at "; diff --git a/src/node_file.cc b/src/node_file.cc index 2986ab96a0f392..b4e8a984f76457 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1042,8 +1042,9 @@ static void ExistsSync(const FunctionCallbackInfo& args) { static void InternalModuleStat(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - CHECK(args[0]->IsString()); - node::Utf8Value path(env->isolate(), args[0]); + BufferValue path(env->isolate(), args[0]); + CHECK_NOT_NULL(*path); + ToNamespacedPath(env, &path); THROW_IF_INSUFFICIENT_PERMISSIONS( env, permission::PermissionScope::kFileSystemRead, path.ToStringView());