From 5f757957ccd4db1b0cf8a4937aedff9f2a6cd3d8 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Sat, 11 Jul 2026 11:32:40 -0700 Subject: [PATCH] Use normal class declarations in libembind_shared.js. NFC --- src/lib/libembind_shared.js | 14 ++++++++++++-- ...est_minimal_runtime_code_size_hello_embind.json | 8 ++++---- ...minimal_runtime_code_size_hello_embind_val.json | 8 ++++---- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/lib/libembind_shared.js b/src/lib/libembind_shared.js index e75caea394069..238e38606dc18 100644 --- a/src/lib/libembind_shared.js +++ b/src/lib/libembind_shared.js @@ -3,8 +3,18 @@ // University of Illinois/NCSA Open Source License. Both these licenses can be // found in the LICENSE file. var LibraryEmbindShared = { - $InternalError: "= class InternalError extends Error { constructor(message) { super(message); this.name = 'InternalError'; }}", - $BindingError: "= class BindingError extends Error { constructor(message) { super(message); this.name = 'BindingError'; }}", + $InternalError: class extends Error { + constructor(message) { + super(message); + this.name = 'InternalError'; + } + }, + $BindingError: class extends Error { + constructor(message) { + super(message); + this.name = 'BindingError'; + } + }, $throwInternalError__deps: ['$InternalError'], $throwInternalError: (message) => { throw new InternalError(message); }, diff --git a/test/codesize/test_minimal_runtime_code_size_hello_embind.json b/test/codesize/test_minimal_runtime_code_size_hello_embind.json index d3f128deb07a6..4da97056e22bd 100644 --- a/test/codesize/test_minimal_runtime_code_size_hello_embind.json +++ b/test/codesize/test_minimal_runtime_code_size_hello_embind.json @@ -1,10 +1,10 @@ { "a.html": 548, "a.html.gz": 371, - "a.js": 7249, - "a.js.gz": 3325, + "a.js": 7255, + "a.js.gz": 3331, "a.wasm": 7099, "a.wasm.gz": 3246, - "total": 14896, - "total_gz": 6942 + "total": 14902, + "total_gz": 6948 } diff --git a/test/codesize/test_minimal_runtime_code_size_hello_embind_val.json b/test/codesize/test_minimal_runtime_code_size_hello_embind_val.json index f729802cdd1eb..cf60299af7164 100644 --- a/test/codesize/test_minimal_runtime_code_size_hello_embind_val.json +++ b/test/codesize/test_minimal_runtime_code_size_hello_embind_val.json @@ -1,10 +1,10 @@ { "a.html": 548, "a.html.gz": 371, - "a.js": 5346, - "a.js.gz": 2515, + "a.js": 5349, + "a.js.gz": 2514, "a.wasm": 5741, "a.wasm.gz": 2690, - "total": 11635, - "total_gz": 5576 + "total": 11638, + "total_gz": 5575 }