Skip to content

Commit 26d3f92

Browse files
Fix multiple jscompiler errors
1 parent 49f63ca commit 26d3f92

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/lib/libembind.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ var LibraryEmbind = {
375375
}
376376
#if ASSERTIONS
377377
else if (typeof value != "bigint") {
378-
throw new TypeError(`Cannot convert "${embindRepr(value)}" to ${this.name}`);
378+
throw new TypeError(`Cannot convert "${embindRepr(value)}" to ${name}`);
379379
}
380380
assertIntegerRange(name, value, minRange, maxRange);
381381
#endif
@@ -404,7 +404,7 @@ var LibraryEmbind = {
404404
toWireType: (destructors, value) => {
405405
#if ASSERTIONS
406406
if (typeof value != "number" && typeof value != "boolean") {
407-
throw new TypeError(`Cannot convert ${embindRepr(value)} to ${this.name}`);
407+
throw new TypeError(`Cannot convert ${embindRepr(value)} to ${name}`);
408408
}
409409
#endif
410410
// The VM will perform JS to Wasm value conversion, according to the spec:

src/lib/libwasi.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ var WasiLibrary = {
1717
#endif
1818

1919
proc_exit__nothrow: true,
20-
proc_exit__docs: '/** @noreturn */',
2120
proc_exit: (code) => {
2221
#if MINIMAL_RUNTIME
2322
throw `exit(${code})`;

src/preamble.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function postRun() {
237237

238238
/**
239239
* @param {string|number=} what
240-
* @noreturn
240+
* @return {void}
241241
*/
242242
function abort(what) {
243243
#if expectToReceiveOnModule('onAbort')
@@ -302,17 +302,18 @@ function abort(what) {
302302
#if ASSERTIONS && !('$FS' in addedLibraryItems)
303303
// show errors on likely calls to FS when it was not included
304304
var FS = {
305+
/** @return {*} */
305306
error() {
306307
abort('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM');
307308
},
308309
init() { FS.error() },
309310
createDataFile() { FS.error() },
310311
createPreloadedFile() { FS.error() },
311-
createLazyFile() { FS.error() },
312-
open() { FS.error() },
313-
mkdev() { FS.error() },
312+
createLazyFile() { return (/** @type {?} */ (FS.error())); },
313+
open() { return (/** @type {?} */ (FS.error())); },
314+
mkdev() { return (/** @type {?} */ (FS.error())); },
314315
registerDevice() { FS.error() },
315-
analyzePath() { FS.error() },
316+
analyzePath() { return (/** @type {?} */ (FS.error())); },
316317

317318
ErrnoError() { FS.error() },
318319
};

0 commit comments

Comments
 (0)