Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: V8: fix filename manipulation for Windows
PR-URL: #28016
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Refael Ackermann (רפאל פלחי) <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
  • Loading branch information
refack authored and targos committed Aug 9, 2019
commit bb4bc12dc858f1ae3ae61d6d534a412df7ba44fa
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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.0',
'v8_embedder_string': '-node.1',

##### V8 defaults for Node.js #####

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
6 changes: 5 additions & 1 deletion deps/v8/src/torque/csa-generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down