| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f2aa305 commit 80d3c11
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | 37 | # Reset this number to 0 on major V8 upgrades. | |
| 38 | 38 | # Increment by one for each non-official patch applied to deps/v8. | |
| 39 | - 'v8_embedder_string': '-node.26', | ||
| 39 | + 'v8_embedder_string': '-node.27', | ||
| 40 | 40 | ||
| 41 | 41 | ##### V8 defaults for Node.js ##### | |
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -317,13 +317,15 @@ void ReplaceFileContentsIfDifferent(const std::string& file_path, | |||
| 317 | 317 | const std::string& contents) { | |
| 318 | 318 | std::ifstream old_contents_stream(file_path.c_str()); | |
| 319 | 319 | std::string old_contents; | |
| 320 | + bool file_exists = false; | ||
| 320 | 321 | if (old_contents_stream.good()) { | |
| 322 | + file_exists = true; | ||
| 321 | 323 | std::istreambuf_iterator<char> eos; | |
| 322 | 324 | old_contents = | |
| 323 | 325 | std::string(std::istreambuf_iterator<char>(old_contents_stream), eos); | |
| 324 | 326 | old_contents_stream.close(); | |
| 325 | 327 | } | |
| 326 | - if (old_contents.length() == 0 || old_contents != contents) { | ||
| 328 | + if (!file_exists || old_contents != contents) { | ||
| 327 | 329 | std::ofstream new_contents_stream; | |
| 328 | 330 | new_contents_stream.open(file_path.c_str()); | |
| 329 | 331 | new_contents_stream << contents; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments