From c12de34c7d33b3ccf80f117edf78b5346bd00897 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Mon, 10 Jan 2022 12:40:35 -0800 Subject: Escape \t as well as \n when writing JSON output. (#4437) As it happens, this doesn't (normally) break the resulting EM_ASM or EM_JS strings because (IIUC) JS supports the tab literal inside of strings as well as "\t". However, it's better to preserve the original text so that it looks the same in the JS file as it did in the original source. --- test/lld/em_asm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/lld/em_asm.cpp') diff --git a/test/lld/em_asm.cpp b/test/lld/em_asm.cpp index ed89783f8..b8c3db365 100644 --- a/test/lld/em_asm.cpp +++ b/test/lld/em_asm.cpp @@ -1,7 +1,7 @@ #include int main() { - EM_ASM({ Module.print("Hello world"); }); + EM_ASM({ Module.print("Hello \\ world\t\n"); }); int x = EM_ASM_INT({ return $0 + $1; }, 13, 27); EM_ASM_({ Module.print("Got " + $0); }, x); return 0; -- cgit v1.2.3