We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1b4f67 commit e880bafCopy full SHA for e880baf
crates/cli-support/src/js/mod.rs
@@ -1071,9 +1071,15 @@ impl<'a> Context<'a> {
1071
if !self.should_write_global("text_decoder") {
1072
return Ok(());
1073
}
1074
+
1075
// `ignoreBOM` is needed so that the BOM will be preserved when sending a string from Rust to JS
1076
// `fatal` is needed to catch any weird encoding bugs when sending a string from Rust to JS
1077
self.expose_text_processor("TextDecoder", "('utf-8', { ignoreBOM: true, fatal: true })")?;
1078
1079
+ // This is needed to workaround a bug in Safari
1080
+ // See: https://github.com/rustwasm/wasm-bindgen/issues/1825
1081
+ self.global("cachedTextDecoder.decode();");
1082
1083
Ok(())
1084
1085
0 commit comments