Skip to content

Commit c6be531

Browse files
avoid using public class fields in js
1 parent a6ecc86 commit c6be531

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/library.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,8 +2282,10 @@ addToLibrary({
22822282
},
22832283

22842284
$HandleAllocator: class {
2285-
allocated = [undefined];
2286-
freelist = [];
2285+
constructor() {
2286+
this.allocated = [undefined];
2287+
this.freelist = [];
2288+
}
22872289
get(id) {
22882290
#if ASSERTIONS
22892291
assert(this.allocated[id] !== undefined, `invalid handle: ${id}`);

src/library_bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ addToLibrary({
1616
$callRuntimeCallbacks: () => {},
1717

1818
$ExitStatus: class {
19-
name = 'ExitStatus';
2019
constructor(status) {
20+
this.name = 'ExitStatus';
2121
this.message = `Program terminated with exit(${status})`;
2222
this.status = status;
2323
}

src/library_wasi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
var WasiLibrary = {
88
#if !MINIMAL_RUNTIME
99
$ExitStatus: class {
10-
name = 'ExitStatus';
1110
constructor(status) {
11+
this.name = 'ExitStatus';
1212
this.message = `Program terminated with exit(${status})`;
1313
this.status = status;
1414
}

0 commit comments

Comments
 (0)