Skip to content
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

Run JS linter on src/*.mjs files. NFC #21510

Merged
merged 1 commit into from
Mar 11, 2024
Merged
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"scripts": {
"lint": "eslint .",
"fmt": "prettier --write tools/*.mjs",
"check": "prettier --check tools/*.mjs"
"fmt": "prettier --write src/*.mjs tools/*.mjs",
"check": "prettier --check src/*.mjs tools/*.mjs"
}
}
14 changes: 10 additions & 4 deletions src/compiler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ globalThis.read = (filename) => {
};

function load(f) {
vm.runInThisContext(read(f), { filename: find(f) });
vm.runInThisContext(read(f), {filename: find(f)});
}

// Basic utilities
Expand Down Expand Up @@ -73,7 +73,7 @@ globalThis.symbolsOnly = symbolsOnlyArg != -1;
// In case compiler.js is run directly (as in gen_sig_info)
// ALL_INCOMING_MODULE_JS_API might not be populated yet.
if (!ALL_INCOMING_MODULE_JS_API.length) {
ALL_INCOMING_MODULE_JS_API = INCOMING_MODULE_JS_API
ALL_INCOMING_MODULE_JS_API = INCOMING_MODULE_JS_API;
}

EXPORTED_FUNCTIONS = new Set(EXPORTED_FUNCTIONS);
Expand All @@ -87,7 +87,10 @@ if (symbolsOnly) {
}

// Side modules are pure wasm and have no JS
assert(!SIDE_MODULE || (ASYNCIFY && globalThis.symbolsOnly), 'JS compiler should only run on side modules if asyncify is used.');
assert(
!SIDE_MODULE || (ASYNCIFY && globalThis.symbolsOnly),
'JS compiler should only run on side modules if asyncify is used.',
);

// Load compiler code

Expand Down Expand Up @@ -116,7 +119,10 @@ try {
// Compiler failed on internal compiler error!
printErr('Internal compiler error in src/compiler.js!');
printErr('Please create a bug report at https://github.com/emscripten-core/emscripten/issues/');
printErr('with a log of the build and the input files used to run. Exception message: "' + (err.stack || err));
printErr(
'with a log of the build and the input files used to run. Exception message: "' +
(err.stack || err),
);
}

// Work around a node.js bug where stdout buffer is not flushed at process exit:
Expand Down
Loading