Skip to content

Commit d2baf6a

Browse files
authored
Revert "fix(es/ast): Fix unicode lone surrogates handling" (#11063)
Reverts #10987
1 parent 0557609 commit d2baf6a

File tree

2,237 files changed

+15079
-30470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,237 files changed

+15079
-30470
lines changed

.changeset/metal-radios-swim.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

bindings/binding_core_node/src/bundle.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ impl swc_core::bundler::Hook for Hook {
281281
span,
282282
raw: None,
283283
value: file_name.into(),
284-
lone_surrogates: false,
285284
}))),
286285
},
287286
KeyValueProp {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
let str="\\uD83D\\uDC68\\u200D\\uD83D\\uDE80";let obj={"\\uD83D\\uDC68\\u200D\\uD83D\\uDE80":"wrong"};
1+
let str="\uD83D\uDC68\\u200D\uD83D\uDE80";let obj={"\uD83D\uDC68\\u200D\uD83D\uDE80":"wrong"};

crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings10_ES5.1.normal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800.
44
// Although we should just get back a single code point value of 0xD800,
55
// this is a useful edge-case test.
6-
var x = "\ud800";
6+
var x = "\u{D800}";

crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings10_ES6.1.normal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800.
44
// Although we should just get back a single code point value of 0xD800,
55
// this is a useful edge-case test.
6-
var x = "\ud800";
6+
var x = "\u{D800}";

crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings11_ES5.1.normal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00.
44
// Although we should just get back a single code point value of 0xDC00,
55
// this is a useful edge-case test.
6-
var x = "\udc00";
6+
var x = "\u{DC00}";

crates/swc/tests/tsc-references/unicodeExtendedEscapesInStrings11_ES6.1.normal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00.
44
// Although we should just get back a single code point value of 0xDC00,
55
// this is a useful edge-case test.
6-
var x = "\udc00";
6+
var x = "\u{DC00}";

crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates10_ES5.1.normal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// 2. Let cu1 be floor((cp – 65536) / 1024) + 0xD800.
44
// Although we should just get back a single code point value of 0xD800,
55
// this is a useful edge-case test.
6-
var x = "\ud800";
6+
var x = "\u{D800}";

crates/swc/tests/tsc-references/unicodeExtendedEscapesInTemplates11_ES5.1.normal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
// 2. Let cu2 be ((cp – 65536) modulo 1024) + 0xDC00.
44
// Although we should just get back a single code point value of 0xDC00,
55
// this is a useful edge-case test.
6-
var x = "\udc00";
6+
var x = "\u{DC00}";

crates/swc/tests/vercel/full/utf8-1/output/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import r from './on-demand-entries-client';
55
import { addMessageListener as n, connectHMR as c } from './error-overlay/websocket';
66
var o = JSON.parse(document.getElementById('__NEXT_DATA__').textContent);
77
window.__NEXT_DATA__ = o;
8-
var s = o.assetPrefix, i = o.page, _ = null, d = __webpack_hash__, u = (s = s || '') + (s.endsWith('/') ? '' : '/') + '_next/static/webpack/';
8+
var s = o.assetPrefix, i = o.page, _ = null, u = __webpack_hash__, d = (s = s || '') + (s.endsWith('/') ? '' : '/') + '_next/static/webpack/';
99
n(function(a) {
1010
if ('\uD83D\uDC93' !== a.data) try {
1111
var r = JSON.parse(a.data);
@@ -28,7 +28,7 @@ n(function(a) {
2828
5
2929
]), [
3030
4,
31-
fetch('undefined' != typeof __webpack_runtime_id__ ? "".concat(u).concat(d, ".").concat(__webpack_runtime_id__, ".hot-update.json") : "".concat(u).concat(d, ".hot-update.json"))
31+
fetch('undefined' != typeof __webpack_runtime_id__ ? "".concat(d).concat(u, ".").concat(__webpack_runtime_id__, ".hot-update.json") : "".concat(d).concat(u, ".hot-update.json"))
3232
];
3333
case 2:
3434
return [
@@ -38,7 +38,7 @@ n(function(a) {
3838
case 3:
3939
return e = t.sent(), a = '/' === i ? 'index' : i, (Array.isArray(e.c) ? e.c : Object.keys(e.c)).some(function(e) {
4040
return -1 !== e.indexOf("pages".concat(a.startsWith('/') ? a : "/".concat(a))) || -1 !== e.indexOf("pages".concat(a.startsWith('/') ? a : "/".concat(a)).replace(/\//g, '\\'));
41-
}) ? document.location.reload(!0) : d = _, [
41+
}) ? document.location.reload(!0) : u = _, [
4242
3,
4343
5
4444
];

0 commit comments

Comments
 (0)