diff --git a/common.gypi b/common.gypi index 2a82642e350028..d81bac25e30fb6 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.15', + 'v8_embedder_string': '-node.16', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/torque/utils.cc b/deps/v8/src/torque/utils.cc index 312adcfb24a34b..6118341e1e0d41 100644 --- a/deps/v8/src/torque/utils.cc +++ b/deps/v8/src/torque/utils.cc @@ -317,13 +317,15 @@ void ReplaceFileContentsIfDifferent(const std::string& file_path, const std::string& contents) { std::ifstream old_contents_stream(file_path.c_str()); std::string old_contents; + bool file_exists = false; if (old_contents_stream.good()) { + file_exists = true; std::istreambuf_iterator eos; old_contents = std::string(std::istreambuf_iterator(old_contents_stream), eos); old_contents_stream.close(); } - if (old_contents.length() == 0 || old_contents != contents) { + if (!file_exists || old_contents != contents) { std::ofstream new_contents_stream; new_contents_stream.open(file_path.c_str()); new_contents_stream << contents;