Skip to content

Commit

Permalink
Fix source maps issues on windows; followup to #9882 (#9925)
Browse files Browse the repository at this point in the history
After #9882 we don't always call .resolve, so the path
normalization must be pulled into a place that dominates
all code paths.
  • Loading branch information
kripken authored Nov 30, 2019
1 parent 73cfc42 commit afc2573
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/wasm-sourcemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def resolve(self, name):
if name in self.cache:
return self.cache[name]

result = name.replace('\\', '/').replace('//', '/')
for p in self.prefixes:
if name.startswith(p['prefix']):
if p['replacement'] is None:
Expand Down Expand Up @@ -270,6 +269,8 @@ def build_sourcemap(entries, code_section_offset, prefixes, collect_sources, bas
column = 1
address = entry['address'] + code_section_offset
file_name = entry['file']
# normalize between OSes
file_name = file_name.replace('\\', '/').replace('//', '/')
# if prefixes were provided, we use that; otherwise, we emit a relative
# path
if prefixes.provided():
Expand Down

0 comments on commit afc2573

Please sign in to comment.