aboutsummaryrefslogtreecommitdiff
path: root/test/transpiler/transpiler.test.js
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-09-13 01:26:18 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-13 01:26:18 -0700
commit32664df254be225dd195fcaf46994f0c550f9d22 (patch)
tree3636f2c68bf3e8926eae3c83ee5930968023a02e /test/transpiler/transpiler.test.js
parent15f7bacb8bd57615475e1614f5f93b23810e63b1 (diff)
downloadbun-32664df254be225dd195fcaf46994f0c550f9d22.tar.gz
bun-32664df254be225dd195fcaf46994f0c550f9d22.tar.zst
bun-32664df254be225dd195fcaf46994f0c550f9d22.zip
decode regex if needed (#5167)
* decode regex if non-ascii * make it comptime * add test * use `bun.BabyList(u16)`
Diffstat (limited to '')
-rw-r--r--test/transpiler/transpiler.test.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/transpiler/transpiler.test.js b/test/transpiler/transpiler.test.js
index a6c2dcf73..c80a0670a 100644
--- a/test/transpiler/transpiler.test.js
+++ b/test/transpiler/transpiler.test.js
@@ -1973,6 +1973,11 @@ console.log(resolve.length)
expectParseError("/x/msuygig", 'Duplicate flag "g" in regular expression');
});
+ it("non-ascii regexp literals", () => {
+ var str = "🔴11 54 / 10,000";
+ expect(str.replace(/[🔵🔴,]+/g, "")).toBe("11 54 / 10000");
+ });
+
it("identifier escapes", () => {
expectPrinted_("var _\u0076\u0061\u0072", "var _var");
expectParseError("var \u0076\u0061\u0072", 'Expected identifier but found "\u0076\u0061\u0072"');