rudimentary parallel parse

This commit is contained in:
Ron Buckton
2023-09-12 16:42:49 -04:00
parent fd390e78fe
commit 7fa1fd0f36
68 changed files with 11288 additions and 387 deletions

View File

@@ -4,7 +4,7 @@ import os from "os";
const ci = ["1", "true"].includes(process.env.CI ?? "");
const parsed = minimist(process.argv.slice(2), {
boolean: ["dirty", "light", "colors", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built", "ci", "bundle", "typecheck", "lint", "coverage"],
boolean: ["dirty", "light", "colors", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built", "ci", "bundle", "typecheck", "lint", "coverage", "structs"],
string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
alias: {
/* eslint-disable quote-props */
@@ -43,6 +43,7 @@ const parsed = minimist(process.argv.slice(2), {
typecheck: true,
lint: true,
coverage: false,
structs: false,
}
});
@@ -57,6 +58,12 @@ if (!options.bundle && !options.typecheck) {
throw new Error("--no-typecheck cannot be passed when bundling is disabled");
}
// TODO(rbuckton): remove this when esbuild supports `using` and decorators.
if (options.structs) {
options.bundle = false;
options.lkg = true;
}
export default options;
@@ -90,5 +97,6 @@ export default options;
* @property {boolean} typecheck
* @property {boolean} lint
* @property {boolean} coverage
* @property {boolean} structs
*/
void 0;

View File

@@ -35,6 +35,7 @@ export async function runConsoleTests(runJs, defaultReporter, runInParallel, opt
const shards = +cmdLineOptions.shards || undefined;
const shardId = +cmdLineOptions.shardId || undefined;
const coverage = cmdLineOptions.coverage;
const structs = cmdLineOptions.structs;
if (!cmdLineOptions.dirty) {
if (options.watching) {
console.log(chalk.yellowBright(`[watch] cleaning test directories...`));
@@ -119,6 +120,12 @@ export async function runConsoleTests(runJs, defaultReporter, runInParallel, opt
args.push(runJs);
}
if (structs) {
args.unshift("--harmony-struct");
args.unshift("--shared-string-table");
args.unshift("--enable-source-map");
}
/** @type {number | undefined} */
let errorStatus;

View File

@@ -331,7 +331,7 @@ function verifyMatchingSymbols(decl) {
* @param {ts.Symbol} moduleSymbol
*/
function emitAsNamespace(name, moduleSymbol) {
assert(moduleSymbol.flags & ts.SymbolFlags.ValueModule, "moduleSymbol is not a module");
assert(moduleSymbol.flags & ts.SymbolFlags.ValueModule, `moduleSymbol '${moduleSymbol.name}' is not a module, was a ${ts.Debug.formatSymbolFlags(moduleSymbol.flags)} instead`);
scopeStack.push(new Map());
const currentScope = scopeStack[scopeStack.length - 1];