From fc8d323859fdd3007de4b7ba3e991384c85b67f1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 29 Nov 2019 16:55:26 -0800 Subject: [PATCH] Fix source maps issues on windows; followup to #9882 (#9925) After #9882 we don't always call .resolve, so the path normalization must be pulled into a place that dominates all code paths. --- tools/wasm-sourcemap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/wasm-sourcemap.py b/tools/wasm-sourcemap.py index 6c1c9abfbfc23..8fcb82994a737 100755 --- a/tools/wasm-sourcemap.py +++ b/tools/wasm-sourcemap.py @@ -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: @@ -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():