summaryrefslogtreecommitdiff
path: root/src/support/string.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2024-02-20 13:23:10 -0800
committerGitHub <noreply@github.com>2024-02-20 13:23:10 -0800
commit07b91a81c169091b2464e6d587666ad3f0124a1e (patch)
treecc0df6add42ef4d9f30ea7db6a4171ca8461d18d /src/support/string.h
parentd0fa7102b5be83be6d0670a5662013bf5f8d1b64 (diff)
downloadbinaryen-07b91a81c169091b2464e6d587666ad3f0124a1e.tar.gz
binaryen-07b91a81c169091b2464e6d587666ad3f0124a1e.tar.bz2
binaryen-07b91a81c169091b2464e6d587666ad3f0124a1e.zip
StringLowering: Escape the JSON in the custom section (#6316)
Also add an end-to-end test using node to verify we can parse the escaped content properly using TextDecoder+JSON.parse.
Diffstat (limited to 'src/support/string.h')
-rw-r--r--src/support/string.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/support/string.h b/src/support/string.h
index 8ab0ae1a6..6fb3f693b 100644
--- a/src/support/string.h
+++ b/src/support/string.h
@@ -75,7 +75,9 @@ inline bool isNumber(const std::string& str) {
return !str.empty() && std::all_of(str.begin(), str.end(), ::isdigit);
}
-std::ostream& printEscaped(std::ostream& os, std::string_view str);
+std::ostream& printEscaped(std::ostream& os, const std::string_view str);
+
+std::ostream& printEscapedJSON(std::ostream& os, const std::string_view str);
} // namespace wasm::String