diff options
author | 2023-08-04 19:34:09 -0700 | |
---|---|---|
committer | 2023-08-04 19:34:09 -0700 | |
commit | 6bdee80cfce0205ea1b59679fda93f816a66eed0 (patch) | |
tree | 72bfaa306054017d58186343e7bfa56086307d91 /test/transpiler/macro.ts | |
parent | 637a38f394704eaea29b503a69d554b5726d6214 (diff) | |
download | bun-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.ts | 12 |
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" + "😊"; +} |