aboutsummaryrefslogtreecommitdiff
path: root/test/transpiler/macro.ts
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-08-04 19:34:09 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-04 19:34:09 -0700
commit6bdee80cfce0205ea1b59679fda93f816a66eed0 (patch)
tree72bfaa306054017d58186343e7bfa56086307d91 /test/transpiler/macro.ts
parent637a38f394704eaea29b503a69d554b5726d6214 (diff)
downloadbun-6bdee80cfce0205ea1b59679fda93f816a66eed0.tar.gz
bun-6bdee80cfce0205ea1b59679fda93f816a66eed0.tar.zst
bun-6bdee80cfce0205ea1b59679fda93f816a66eed0.zip
fix macro string escaping (#3967)
* handle macro escaping * remove printer * use `js_lexer.decodeEscapeSequences`
Diffstat (limited to 'test/transpiler/macro.ts')
-rw-r--r--test/transpiler/macro.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/transpiler/macro.ts b/test/transpiler/macro.ts
index 8516d7d0d..fc747333c 100644
--- a/test/transpiler/macro.ts
+++ b/test/transpiler/macro.ts
@@ -1,3 +1,15 @@
export function identity(arg: any) {
return arg;
}
+
+export function escape() {
+ return "\\\f\n\r\t\v\0'\"`$\x00\x0B\x0C";
+}
+
+export function addStrings(arg: string) {
+ return arg + "\\\f\n\r\t\v\0'\"`$\x00\x0B\x0C" + "©";
+}
+
+export function addStringsUTF16(arg: string) {
+ return arg + "\\\f\n\r\t\v\0'\"`$\x00\x0B\x0C" + "😊";
+}