Skip to content

Commit 3374924

Browse files
authored
Fix sourcemap prefix path substitution on windows (#23936)
Normalize prefixes instead of expecting windows users to do it. See #23741 (comment) The tests now pass on windows.
1 parent 106a27c commit 3374924

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

test/test_other.py

-1
Original file line numberDiff line numberDiff line change
@@ -10476,7 +10476,6 @@ def test_wasm_sourcemap(self, sources, prefix, load_prefix, basepath):
1047610476
'sources': ([], 1)
1047710477
})
1047810478
@crossplatform
10479-
@no_windows('https://github.com/emscripten-core/emscripten/pull/23741#issuecomment-2725574867')
1048010479
def test_emcc_sourcemap_options(self, prefixes, sources):
1048110480
wasm_sourcemap = importlib.import_module('tools.wasm-sourcemap')
1048210481
cwd = os.getcwd()

tools/wasm-sourcemap.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ def __init__(self, args, base_path=None, preserve_deterministic_prefix=True):
5555
for p in args:
5656
if '=' in p:
5757
prefix, replacement = p.split('=')
58-
prefixes.append({'prefix': prefix, 'replacement': replacement})
58+
prefixes.append({'prefix': utils.normalize_path(prefix), 'replacement': replacement})
5959
else:
60-
prefixes.append({'prefix': p, 'replacement': ''})
61-
self.base_path = base_path
60+
prefixes.append({'prefix': utils.normalize_path(p), 'replacement': ''})
61+
self.base_path = utils.normalize_path(base_path) if base_path is not None else None
6262
self.preserve_deterministic_prefix = preserve_deterministic_prefix
6363
self.prefixes = prefixes
6464
self.cache = {}

0 commit comments

Comments
 (0)