Skip to content

Commit df64a3d

Browse files
authored
[libdylink.js] Avoid string key for private field. NFC (#24915)
1 parent a105a6a commit df64a3d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/lib/libdylink.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ var LibraryDylink = {
1414
#if FILESYSTEM
1515
$registerWasmPlugin__deps: ['$preloadPlugins'],
1616
$registerWasmPlugin: () => {
17-
// Use string keys here to avoid minification since the plugin consumer
18-
// also uses string keys.
17+
// Use string keys here for public methods to avoid minification since the
18+
// plugin consumer also uses string keys.
1919
var wasmPlugin = {
20-
'promiseChainEnd': Promise.resolve(),
20+
promiseChainEnd: Promise.resolve(),
2121
'canHandle': (name) => {
2222
return !Module['noWasmDecoding'] && name.endsWith('.so')
2323
},
2424
'handle': (byteArray, name, onload, onerror) => {
2525
// loadWebAssemblyModule can not load modules out-of-order, so rather
2626
// than just running the promises in parallel, this makes a chain of
2727
// promises to run in series.
28-
wasmPlugin['promiseChainEnd'] = wasmPlugin['promiseChainEnd'].then(
28+
wasmPlugin.promiseChainEnd = wasmPlugin.promiseChainEnd.then(
2929
() => loadWebAssemblyModule(byteArray, {loadAsync: true, nodelete: true}, name, {})).then(
3030
(exports) => {
3131
#if DYLINK_DEBUG

test/code_size/test_codesize_hello_dylink.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"a.out.js": 27021,
3-
"a.out.js.gz": 11470,
2+
"a.out.js": 26982,
3+
"a.out.js.gz": 11461,
44
"a.out.nodebug.wasm": 18561,
55
"a.out.nodebug.wasm.gz": 9167,
6-
"total": 45582,
7-
"total_gz": 20637,
6+
"total": 45543,
7+
"total_gz": 20628,
88
"sent": [
99
"__heap_base",
1010
"__indirect_function_table",

test/code_size/test_codesize_hello_dylink_all.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"a.out.js": 246838,
2+
"a.out.js": 246799,
33
"a.out.nodebug.wasm": 597826,
4-
"total": 844664,
4+
"total": 844625,
55
"sent": [
66
"IMG_Init",
77
"IMG_Load",

0 commit comments

Comments
 (0)