Skip to content

Update closure-compiler. NFC #24679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 114 additions & 109 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@babel/core": "^7.28.0",
"@babel/preset-env": "^7.28.0",
"acorn": "^8.15.0",
"google-closure-compiler": "20240317.0.0",
"google-closure-compiler": "20250701.0.0",
"html-minifier-terser": "7.2.0"
},
"scripts": {
Expand Down
6 changes: 0 additions & 6 deletions src/closure-externs/closure-externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ Atomics.store = function() {};
* @suppress {duplicate, checkTypes}
*/
var WebAssembly = {};
/**
* @constructor
* @param {Object} globalDescriptor
* @param {*=} value
*/
WebAssembly.Global = function(globalDescriptor, value) {};
/**
* @param {!WebAssembly.Tag} tag
* @param {number} index
Expand Down
84 changes: 42 additions & 42 deletions test/code_size/audio_worklet_wasm.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
var k = globalThis.Module || "undefined" != typeof Module ? Module : {}, p = "em-ww" == globalThis.name, q = "undefined" !== typeof AudioWorkletGlobalScope, r, v, L, M, G, I, C, X, J, E, D, Y, Z;
var k = globalThis.Module || typeof Module != "undefined" ? Module : {}, p = globalThis.name == "em-ww", q = typeof AudioWorkletGlobalScope !== "undefined", r, v, L, M, G, I, C, X, J, E, D, Y, Z;

q && (p = !0);

function u(a) {
r = a;
v = a.I;
v = a.J;
x();
k ||= {};
k.wasm = a.C;
k.wasm = a.D;
y();
a.C = a.J = 0;
a.D = a.K = 0;
}

p && !q && (onmessage = a => {
Expand All @@ -23,38 +23,38 @@ if (q) {
constructor(e) {
super();
e = e.processorOptions;
this.u = C.get(e.u);
this.v = e.v;
this.s = e.s;
this.v = C.get(e.v);
this.A = e.A;
this.u = e.u;
}
static get parameterDescriptors() {
return c;
}
process(e, h, f) {
let m = e.length, w = h.length, F = 0, l, z, n, t = 4 * this.s, g = 12 * (m + w), W = D(), A, H, B;
let m = e.length, w = h.length, F = 0, l, z, n, t = this.u * 4, g = (m + w) * 12, W = D(), A, H, B;
for (l of e) g += l.length * t;
for (l of h) g += l.length * t;
for (l in f) g += f[l].byteLength + 8, ++F;
A = E(g);
g = A >> 2;
n = A + 12 * m;
n = A + m * 12;
for (l of e) {
G[g] = l.length;
G[g + 1] = this.s;
G[g + 1] = this.u;
G[g + 2] = n;
g += 3;
for (z of l) I.set(z, n >> 2), n += t;
}
H = n;
g = H >> 2;
e = (n += 12 * w) >> 2;
for (l of h) G[g] = l.length, G[g + 1] = this.s, G[g + 2] = n, g += 3, n += t * l.length;
e = (n += w * 12) >> 2;
for (l of h) G[g] = l.length, G[g + 1] = this.u, G[g + 2] = n, g += 3, n += t * l.length;
t = n;
g = t >> 2;
n += 8 * F;
n += F * 8;
for (l = 0; B = f[l++]; ) G[g] = B.length, G[g + 1] = n, g += 2, I.set(B, n >> 2),
n += 4 * B.length;
if (f = this.u(m, A, w, H, F, t, this.v)) for (l of h) for (z of l) for (g = 0; g < this.s; ++g) z[g] = I[e++];
n += B.length * 4;
if (f = this.v(m, A, w, H, F, t, this.A)) for (l of h) for (z of l) for (g = 0; g < this.u; ++g) z[g] = I[e++];
J(W);
return !!f;
}
Expand All @@ -69,10 +69,10 @@ if (q) {
K = this.port;
K.onmessage = async d => {
d = d.data;
d._wpn ? (registerProcessor(d._wpn, a(d.D)), K.postMessage({
_wsc: d.u,
A: [ d.F, 1, d.v ]
})) : d._wsc && C.get(d._wsc)(...d.A);
d._wpn ? (registerProcessor(d._wpn, a(d.F)), K.postMessage({
_wsc: d.v,
B: [ d.G, 1, d.A ]
})) : d._wsc && C.get(d._wsc)(...d.B);
};
}
process() {}
Expand Down Expand Up @@ -103,17 +103,17 @@ var N = [], O = a => {
}, Q = a => J(a), R = () => D(), aa = (a, b, c, d) => {
b = S[b];
S[a].connect(b.destination || b, c, d);
}, S = {}, T = 0, U = "undefined" != typeof TextDecoder ? new TextDecoder : void 0, V = (a = 0) => {
}, S = {}, T = 0, U = typeof TextDecoder != "undefined" ? new TextDecoder : void 0, V = (a = 0) => {
for (var b = L, c = a, d = c + void 0; b[c] && !(c >= d); ) ++c;
if (16 < c - a && b.buffer && U) return U.decode(b.slice(a, c));
if (c - a > 16 && b.buffer && U) return U.decode(b.slice(a, c));
for (d = ""; a < c; ) {
var e = b[a++];
if (e & 128) {
var h = b[a++] & 63;
if (192 == (e & 224)) d += String.fromCharCode((e & 31) << 6 | h); else {
if ((e & 224) == 192) d += String.fromCharCode((e & 31) << 6 | h); else {
var f = b[a++] & 63;
e = 224 == (e & 240) ? (e & 15) << 12 | h << 6 | f : (e & 7) << 18 | h << 12 | f << 6 | b[a++] & 63;
65536 > e ? d += String.fromCharCode(e) : (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023));
e = (e & 240) == 224 ? (e & 15) << 12 | h << 6 | f : (e & 7) << 18 | h << 12 | f << 6 | b[a++] & 63;
e < 65536 ? d += String.fromCharCode(e) : (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023));
}
} else d += String.fromCharCode(e);
}
Expand Down Expand Up @@ -144,9 +144,9 @@ var N = [], O = a => {
numberOfOutputs: f,
outputChannelCount: m,
processorOptions: {
u: d,
v: e,
s: 128
v: d,
A: e,
u: 128
}
};
} else d = void 0;
Expand All @@ -163,36 +163,36 @@ var N = [], O = a => {
maxValue: I[f++],
automationRate: [ "a", "k" ][G[f++]] + "-rate"
});
h = S[a].audioWorklet.B.port;
h = S[a].audioWorklet.C.port;
f = h.postMessage;
b = (b = G[b]) ? V(b) : "";
f.call(h, {
_wpn: b,
D: e,
F: a,
u: c,
v: d
F: e,
G: a,
v: c,
A: d
});
}, ea = () => !1, fa = 1, ha = a => {
a = a.data;
let b = a._wsc;
b && C.get(b)(...a.A);
b && C.get(b)(...a.B);
}, ia = a => E(a), ja = (a, b, c, d, e) => {
let h = S[a], f = h.audioWorklet, m = () => {
C.get(d)(a, 0, e);
};
if (!f) return m();
f.addModule(k.js).then((() => {
f.B = new AudioWorkletNode(h, "em-bootstrap", {
f.C = new AudioWorkletNode(h, "em-bootstrap", {
processorOptions: {
K: fa++,
C: k.wasm,
I: v,
G: b,
H: c
L: fa++,
D: k.wasm,
J: v,
H: b,
I: c
}
});
f.B.port.onmessage = ha;
f.C.port.onmessage = ha;
C.get(d)(a, 1, e);
})).catch(m);
};
Expand All @@ -203,7 +203,7 @@ function ka(a) {
document.body.appendChild(b);
a = S[a];
b.onclick = () => {
"running" != a.state ? a.resume() : a.suspend();
a.state != "running" ? a.resume() : a.suspend();
};
}

Expand Down Expand Up @@ -232,7 +232,7 @@ function y() {
k.stackAlloc = ia;
k.stackRestore = Q;
k.wasmTable = C;
p ? (Y(r.G, r.H), "undefined" === typeof AudioWorkletGlobalScope && (removeEventListener("message", P),
p ? (Y(r.H, r.I), typeof AudioWorkletGlobalScope === "undefined" && (removeEventListener("message", P),
N = N.forEach(O), addEventListener("message", O))) : a.i();
p || X();
}));
Expand Down
4 changes: 2 additions & 2 deletions test/code_size/audio_worklet_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"a.html": 519,
"a.html.gz": 357,
"a.js": 3853,
"a.js.gz": 2045,
"a.js.gz": 2048,
"a.wasm": 1288,
"a.wasm.gz": 860,
"total": 5660,
"total_gz": 3262
"total_gz": 3265
}
8 changes: 4 additions & 4 deletions test/code_size/embind_hello_wasm.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.html": 552,
"a.html.gz": 373,
"a.js": 7255,
"a.js.gz": 3313,
"a.js": 7256,
"a.js.gz": 3320,
"a.wasm": 7294,
"a.wasm.gz": 3339,
"total": 15101,
"total_gz": 7025
"total": 15102,
"total_gz": 7032
}
8 changes: 4 additions & 4 deletions test/code_size/embind_val_wasm.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.html": 552,
"a.html.gz": 373,
"a.js": 5356,
"a.js.gz": 2526,
"a.js": 5361,
"a.js.gz": 2523,
"a.wasm": 7468,
"a.wasm.gz": 3461,
"total": 13376,
"total_gz": 6360
"total": 13381,
"total_gz": 6357
}
6 changes: 3 additions & 3 deletions test/code_size/hello_wasm_worker_wasm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var b = Module, c = "em-ww" == globalThis.name, e, f, l, x, y, z;
var b = Module, c = globalThis.name == "em-ww", e, f, l, x, y, z;

c && (onmessage = a => {
onmessage = null;
Expand All @@ -8,7 +8,7 @@ c && (onmessage = a => {
b ||= {};
b.wasm = a.j;
h();
a.j = a.s = 0;
a.j = a.u = 0;
});

function g() {}
Expand All @@ -30,7 +30,7 @@ var k = [], n = a => {
name: "em-ww"
});
m.postMessage({
u: r,
v: r,
j: b.wasm,
o: f,
l: a,
Expand Down
4 changes: 2 additions & 2 deletions test/code_size/hello_wasm_worker_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"a.html": 519,
"a.html.gz": 357,
"a.js": 830,
"a.js.gz": 525,
"a.js.gz": 524,
"a.wasm": 1885,
"a.wasm.gz": 1072,
"total": 3234,
"total_gz": 1954
"total_gz": 1953
}
4 changes: 2 additions & 2 deletions test/code_size/hello_webgl2_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"a.html": 454,
"a.html.gz": 321,
"a.js": 4386,
"a.js.gz": 2247,
"a.js.gz": 2250,
"a.wasm": 8278,
"a.wasm.gz": 5620,
"total": 13118,
"total_gz": 8188
"total_gz": 8191
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl2_wasm2js.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"a.html": 346,
"a.html.gz": 255,
"a.js": 18103,
"a.js.gz": 9766,
"total": 18449,
"total_gz": 10021
"a.js": 18138,
"a.js.gz": 9771,
"total": 18484,
"total_gz": 10026
}
4 changes: 2 additions & 2 deletions test/code_size/hello_webgl_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"a.html": 454,
"a.html.gz": 321,
"a.js": 3924,
"a.js.gz": 2087,
"a.js.gz": 2086,
"a.wasm": 8278,
"a.wasm.gz": 5620,
"total": 12656,
"total_gz": 8028
"total_gz": 8027
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl_wasm2js.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"a.html": 346,
"a.html.gz": 255,
"a.js": 17630,
"a.js.gz": 9598,
"total": 17976,
"total_gz": 9853
"a.js": 17665,
"a.js.gz": 9600,
"total": 18011,
"total_gz": 9855
}
4 changes: 2 additions & 2 deletions test/code_size/hello_world_wasm2js.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ var d = Module, g, h, k = new TextDecoder, l;
function e(a) {
this.exports = function(q) {
function u(r, b, m) {
for (var v, p = 0, t = b, w = m.length, x = b + (3 * w >> 2) - ("=" == m[w - 2]) - ("=" == m[w - 1]); p < w; p += 4) b = c[m.charCodeAt(p + 1)],
for (var v, p = 0, t = b, w = m.length, x = b + (w * 3 >> 2) - (m[w - 2] == "=") - (m[w - 1] == "="); p < w; p += 4) b = c[m.charCodeAt(p + 1)],
v = c[m.charCodeAt(p + 2)], r[t++] = c[m.charCodeAt(p)] << 2 | b >> 4, t < x && (r[t++] = b << 4 | v >> 2),
t < x && (r[t++] = v << 6 | c[m.charCodeAt(p + 3)]);
return r;
}
for (var n, c = new Uint8Array(123), f = 25; 0 <= f; --f) c[48 + f] = 52 + f, c[65 + f] = f,
for (var n, c = new Uint8Array(123), f = 25; f >= 0; --f) c[48 + f] = 52 + f, c[65 + f] = f,
c[97 + f] = 26 + f;
c[43] = 62;
c[47] = 63;
Expand Down
4 changes: 2 additions & 2 deletions test/code_size/random_printf_wasm.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"a.html": 12511,
"a.html.gz": 6848,
"a.html.gz": 6847,
"total": 12511,
"total_gz": 6848
"total_gz": 6847
}
4 changes: 2 additions & 2 deletions test/code_size/random_printf_wasm2js.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"a.html": 17224,
"a.html.gz": 7551,
"a.html.gz": 7552,
"total": 17224,
"total_gz": 7551
"total_gz": 7552
}
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors1.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8162
8192
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors1.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19802
19878
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors2.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8151
8179
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_ctors2.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19780
19856
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9150
9172
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
23463
23540
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except_wasm.gzsize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8110
8129
2 changes: 1 addition & 1 deletion test/other/codesize/test_codesize_cxx_except_wasm.jssize
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19691
19743
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8110
8129
Loading