diff options
author | 2023-09-13 01:26:18 -0700 | |
---|---|---|
committer | 2023-09-13 01:26:18 -0700 | |
commit | 32664df254be225dd195fcaf46994f0c550f9d22 (patch) | |
tree | 3636f2c68bf3e8926eae3c83ee5930968023a02e /test/transpiler/transpiler.test.js | |
parent | 15f7bacb8bd57615475e1614f5f93b23810e63b1 (diff) | |
download | bun-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.js | 5 |
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"'); |