mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
deps: V8: fix filename manipulation for Windows
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>
This commit is contained in:
1 parent
317b712a52
commit
a74c46bf4b
3 files changed
+11
-3
No files matched your search
+1
-1
@@ -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 #####
|
||||
|
||||
|
||||
+5
-1
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Vendored
+5
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user