diff options
author | Refael Ackermann <refack@gmail.com> | 2019-03-31 11:53:24 -0400 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-06-04 18:45:05 +0200 |
commit | 4a61bdbc1fbf92c47b96205561f5a8c800d18c05 (patch) | |
tree | 29b4ab69c502ac1d2159e26228dae3ce61d3238b /deps | |
parent | 018159d734edc4132c0ff6660cd509997ca366e5 (diff) | |
download | android-node-v8-4a61bdbc1fbf92c47b96205561f5a8c800d18c05.tar.gz android-node-v8-4a61bdbc1fbf92c47b96205561f5a8c800d18c05.tar.bz2 android-node-v8-4a61bdbc1fbf92c47b96205561f5a8c800d18c05.zip |
deps: V8: fix filename manipulation for Windows
Backport-PR-URL: https://github.com/nodejs/node/pull/28005
PR-URL: https://github.com/nodejs/node/pull/27375
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/v8/src/snapshot/embedded-file-writer.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-file-writer.cc b/deps/v8/src/snapshot/embedded-file-writer.cc index 191ebf7b7c..3ead35bd9a 100644 --- a/deps/v8/src/snapshot/embedded-file-writer.cc +++ b/deps/v8/src/snapshot/embedded-file-writer.cc @@ -819,7 +819,11 @@ void PlatformDependentEmbeddedFileWriter::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 dae517f401..cdbcc64b01 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::GetSource(pos.source); + std::string file = SourceFileMap::GetSource(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; |