diff --git a/deps/node/src/module_wrap.cc b/deps/node/src/module_wrap.cc index f778b089dc..ec2e1b379b 100644 --- a/deps/node/src/module_wrap.cc +++ b/deps/node/src/module_wrap.cc @@ -558,8 +558,9 @@ static MaybeLocal ImportModuleDynamically( ->Uint32Value(context) .ToChecked(); if (type == ScriptType::kScript) { - contextify::ContextifyScript* wrap = env->id_to_script_map.find(id)->second; - object = wrap->object(); + auto it = env->id_to_function_map.find(id); + CHECK_NE(it, env->id_to_function_map.end()); + object = it->second->object(); } else if (type == ScriptType::kModule) { ModuleWrap* wrap = ModuleWrap::GetFromID(env, id); object = wrap->object(); diff --git a/deps/node/src/node_messaging.cc b/deps/node/src/node_messaging.cc index 17ca38b76c..2bfd489b55 100644 --- a/deps/node/src/node_messaging.cc +++ b/deps/node/src/node_messaging.cc @@ -327,7 +327,7 @@ class SerializerDelegate : public ValueSerializer::Delegate { std::vector> nested_transferables; if (!host_objects_[i]->NestedTransferables().To(&nested_transferables)) return Nothing(); - for (auto nested_transferable : nested_transferables) { + for (auto& nested_transferable : nested_transferables) { if (std::find(host_objects_.begin(), host_objects_.end(), nested_transferable) == host_objects_.end()) { diff --git a/src/api-environment.cc b/src/api-environment.cc index f26ce597be..3d70b801f6 100644 --- a/src/api-environment.cc +++ b/src/api-environment.cc @@ -777,8 +777,8 @@ MaybeLocal v8::RegExp::Exec(Local context, } auto vector = ValueVectorRef::create(); - for (auto tokens : result.m_matchResults) { - for (auto token : tokens) { + for (auto& tokens : result.m_matchResults) { + for (auto& token : tokens) { auto match = subject->substring(token.m_start, token.m_end); vector->pushBack(match); } diff --git a/src/api/utils/logger/flags.cc b/src/api/utils/logger/flags.cc index eb78abf47f..b9005883c0 100644 --- a/src/api/utils/logger/flags.cc +++ b/src/api/utils/logger/flags.cc @@ -96,7 +96,7 @@ void Flags::add(const std::string& userOption) { std::string optionValues = userOption.substr(userOption.find_first_of('=') + 1); // +1 for skipping '=' auto tokens = strSplit(optionValues, ','); - for (auto token : tokens) { + for (auto& token : tokens) { flag->addValue(token); } }