diff options
author | Refael Ackermann <refack@gmail.com> | 2019-03-31 11:53:24 -0400 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-08-19 09:25:45 +0200 |
commit | a28348867b8b83e719872a5612a16a9612090483 (patch) | |
tree | 20d8befa3de8553e70035ad349abd18dc137c61c /deps/v8 | |
parent | 4b7be335b9b6576c8a819e3a9f04a34a9474d3ad (diff) | |
download | android-node-v8-a28348867b8b83e719872a5612a16a9612090483.tar.gz android-node-v8-a28348867b8b83e719872a5612a16a9612090483.tar.bz2 android-node-v8-a28348867b8b83e719872a5612a16a9612090483.zip |
deps: V8: fix filename manipulation for Windows
PR-URL: https://github.com/nodejs/node/pull/28016
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Diffstat (limited to 'deps/v8')
-rw-r--r-- | deps/v8/src/snapshot/embedded/platform-embedded-file-writer-win.cc | 6 | ||||
-rw-r--r-- | deps/v8/src/torque/csa-generator.cc | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-win.cc b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-win.cc index 69457e11a5..b336e34339 100644 --- a/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-win.cc +++ b/deps/v8/src/snapshot/embedded/platform-embedded-file-writer-win.cc @@ -569,7 +569,11 @@ void PlatformEmbeddedFileWriterWin::DeclareExternalFilename( // Replace any Windows style paths (backslashes) with forward // slashes. std::string fixed_filename(filename); - std::replace(fixed_filename.begin(), fixed_filename.end(), '\\', '/'); + for (auto& c : fixed_filename) { + if (c == '\\') { + c = '/'; + } + } fprintf(fp_, ".file %d \"%s\"\n", fileid, fixed_filename.c_str()); } diff --git a/deps/v8/src/torque/csa-generator.cc b/deps/v8/src/torque/csa-generator.cc index 6a798a2707..cd7ff22c48 100644 --- a/deps/v8/src/torque/csa-generator.cc +++ b/deps/v8/src/torque/csa-generator.cc @@ -56,10 +56,14 @@ Stack<std::string> CSAGenerator::EmitBlock(const Block* block) { } void CSAGenerator::EmitSourcePosition(SourcePosition pos, bool always_emit) { - const std::string& file = SourceFileMap::AbsolutePath(pos.source); + std::string file = SourceFileMap::AbsolutePath(pos.source); if (always_emit || !previous_position_.CompareStartIgnoreColumn(pos)) { // Lines in Torque SourcePositions are zero-based, while the // CodeStubAssembler and downwind systems are one-based. + for (auto& c : file) { + if (c == '\\') + c = '/'; + } out_ << " ca_.SetSourcePosition(\"" << file << "\", " << (pos.start.line + 1) << ");\n"; previous_position_ = pos; |