Skip to content

Commit ebe6f83

Browse files
authored
TextDecoder defaults to utf-8. NFC (emscripten-core#22078)
1 parent 81cc520 commit ebe6f83

File tree

53 files changed

+82
-81
lines changed

Some content is hidden

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

53 files changed

+82
-81
lines changed

src/library_strings.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
#include "arrayUtils.js"
88

99
addToLibrary({
10+
// TextDecoder constructor defaults to UTF-8
1011
#if TEXTDECODER == 2
11-
$UTF8Decoder: "new TextDecoder('utf8')",
12+
$UTF8Decoder: "new TextDecoder()",
1213
#elif TEXTDECODER == 1
13-
$UTF8Decoder: "typeof TextDecoder != 'undefined' ? new TextDecoder('utf8') : undefined",
14+
$UTF8Decoder: "typeof TextDecoder != 'undefined' ? new TextDecoder() : undefined",
1415
#endif
1516

1617
$UTF8ArrayToString__docs: `
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.html": 552,
33
"a.html.gz": 380,
4-
"a.js": 7080,
5-
"a.js.gz": 2999,
4+
"a.js": 7072,
5+
"a.js.gz": 2997,
66
"a.wasm": 11618,
77
"a.wasm.gz": 5811,
8-
"total": 19250,
9-
"total_gz": 9190
8+
"total": 19242,
9+
"total_gz": 9188
1010
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.html": 454,
33
"a.html.gz": 328,
4-
"a.js": 4539,
5-
"a.js.gz": 2315,
4+
"a.js": 4531,
5+
"a.js.gz": 2309,
66
"a.wasm": 10439,
77
"a.wasm.gz": 6728,
8-
"total": 15432,
9-
"total_gz": 9371
8+
"total": 15424,
9+
"total_gz": 9365
1010
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"a.html": 346,
33
"a.html.gz": 262,
4-
"a.js": 22196,
5-
"a.js.gz": 11586,
6-
"total": 22542,
7-
"total_gz": 11848
4+
"a.js": 22188,
5+
"a.js.gz": 11580,
6+
"total": 22534,
7+
"total_gz": 11842
88
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.html": 454,
33
"a.html.gz": 328,
4-
"a.js": 4056,
5-
"a.js.gz": 2152,
4+
"a.js": 4048,
5+
"a.js.gz": 2147,
66
"a.wasm": 10439,
77
"a.wasm.gz": 6728,
8-
"total": 14949,
9-
"total_gz": 9208
8+
"total": 14941,
9+
"total_gz": 9203
1010
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"a.html": 346,
33
"a.html.gz": 262,
4-
"a.js": 21698,
5-
"a.js.gz": 11410,
6-
"total": 22044,
7-
"total_gz": 11672
4+
"a.js": 21690,
5+
"a.js.gz": 11405,
6+
"total": 22036,
7+
"total_gz": 11667
88
}

test/code_size/hello_world_wasm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var d = Module, e, f, g = new TextDecoder("utf8"), h;
1+
var d = Module, e, f, g = new TextDecoder, h;
22

33
WebAssembly.instantiate(d.wasm, {
44
a: {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.html": 552,
33
"a.html.gz": 380,
4-
"a.js": 291,
5-
"a.js.gz": 249,
4+
"a.js": 283,
5+
"a.js.gz": 244,
66
"a.wasm": 103,
77
"a.wasm.gz": 113,
8-
"total": 946,
9-
"total_gz": 742
8+
"total": 938,
9+
"total_gz": 737
1010
}

test/code_size/hello_world_wasm2js.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var d = Module, g, h, k = new TextDecoder("utf8"), l;
1+
var d = Module, g, h, k = new TextDecoder, l;
22

33
function e(b) {
44
this.exports = function(r) {
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"a.html": 323,
33
"a.html.gz": 253,
4-
"a.js": 1060,
5-
"a.js.gz": 636,
6-
"total": 1383,
7-
"total_gz": 889
4+
"a.js": 1052,
5+
"a.js.gz": 630,
6+
"total": 1375,
7+
"total_gz": 883
88
}

0 commit comments

Comments
 (0)