Skip to content

Commit 63a9648

Browse files
authored
Fix TypeError when trying to add a sourceMappingURL section to a WASM file (#22214)
This pull request fixes issue #22213.
1 parent 88eabd8 commit 63a9648

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/wasm-sourcemap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def encode_uint_var(n):
140140
def append_source_mapping(wasm, url):
141141
logger.debug('Append sourceMappingURL section')
142142
section_name = "sourceMappingURL"
143-
section_content = encode_uint_var(len(section_name)) + section_name + encode_uint_var(len(url)) + url
143+
section_content = encode_uint_var(len(section_name)) + section_name.encode() + encode_uint_var(len(url)) + url.encode()
144144
return wasm + encode_uint_var(0) + encode_uint_var(len(section_content)) + section_content
145145

146146

0 commit comments

Comments
 (0)