Closed adams85 closed 3 hours ago
Transpiler output:
const s = "\uDBFF\uDFFF";
console.log("length:", 1);
for (let i = 0, ch;!isNaN(ch = "\uDBFF\uDFFF".charCodeAt(i)); i++)
console.log("\\u" + ch.toString(16).padStart(4, "0"));
❯ bun-1.1.34 build --target=bun a.js
// @bun
// a.js
var s = "\uFFFF";
console.log("length:", s.length);
for (let i = 0, ch;!isNaN(ch = s.charCodeAt(i)); i++) {
console.log("\\u" + ch.toString(16).padStart(4, "0"));
}
❯ bun build --target=bun a.js
// @bun
// a.js
var s = "\uDBFF\uDFFF";
console.log("length:", s.length);
for (let i = 0, ch;!isNaN(ch = s.charCodeAt(i)); i++) {
console.log("\\u" + ch.toString(16).padStart(4, "0"));
}
What version of Bun is running?
1.1.36
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
repro.js:
What is the expected behavior?
What do you see instead?
Additional information
According to my tests, 1.1.34 decodes the escape sequence correctly. So this is a regression introduced in 1.1.35 (it's present in 1.1.36 as well).
Both
"\uFFFF"
and"\u{FFFF}"
are decoded incorrectly.