diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
new file mode 100644
index 0000000000..ac9170348d
--- /dev/null
+++ b/.github/workflows/pr.yml
@@ -0,0 +1,19 @@
+name: PR
+
+on:
+ pull_request:
+ types: [opened, edited, synchronize]
+
+jobs:
+ check-title:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check PR Title Prefix
+ id: title-check
+ uses: actions/github-script@v7
+ with:
+ script: |
+ const titlePrefixes = ["feat", "fix", "breaking", "chore"];
+ const title = context.payload.pull_request.title.toLowerCase();
+ const titleHasValidPrefix = titlePrefixes.some((prefix) => title.startsWith(`${prefix}:`));
+ if (!titleHasValidPrefix) { process.exit(-1); }
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index f6f7666034..269112457d 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -1,5 +1,8 @@
name: Publish
on:
+ # Note that the main branch will be used regardless of the branch chosen
+ # in the web interface.
+ workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
@@ -7,19 +10,19 @@ jobs:
name: Packages
if: github.repository == 'AssemblyScript/assemblyscript'
runs-on: ubuntu-latest
+ permissions:
+ id-token: write
+ contents: write
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0
- - uses: dcodeIO/setup-node-nvm@master
+ - uses: actions/setup-node@v6
with:
node-version: current
- name: Install dependencies
- run: | # npm>=7 is currently broken: https://github.com/npm/cli/issues/1973
- npm -g install npm@6
- npm -v
- npm ci
+ run: npm ci
- name: Build packages
run: |
VERSION=$(npx aspublish --version)
@@ -46,7 +49,6 @@ jobs:
- name: Publish packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
node ./scripts/prepublish
if [ $(node -pe "require('./package.json').version") != "0.0.0" ]; then
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 057e4b69d0..b170c52285 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -6,14 +6,17 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- - uses: actions/stale@v6
+ - uses: actions/stale@v9
with:
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions!'
stale-issue-label: 'stale'
+ stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions!'
+ close-pr-message: 'This PR has been automatically closed due to lack of recent activity, but feel free to reopen it as long as you merge in the main branch afterwards.'
exempt-issue-labels: 'bug,enhancement,compatibility'
+ exempt-pr-labels: 'breaking change'
+ exempt-draft-pr: true
exempt-all-milestones: true
exempt-all-assignees: true
- days-before-stale: 30
+ days-before-issue-stale: 30
+ days-before-pr-stale: 60
days-before-close: 7
- days-before-pr-stale: -1
- days-before-pr-close: -1
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 5e46805377..550ee0d7ab 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -9,7 +9,7 @@ jobs:
name: "Check"
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: "Check that distribution files are unmodified"
if: github.event_name == 'pull_request'
run: |
@@ -27,10 +27,10 @@ jobs:
strategy:
matrix:
os: ["ubuntu", "macos", "windows"]
- node_version: ["current", "lts_latest"]
+ node_version: ["current", "lts/*"]
steps:
- - uses: actions/checkout@v3
- - uses: dcodeIO/setup-node-nvm@master
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
@@ -49,8 +49,8 @@ jobs:
matrix:
target: ["debug", "release"]
steps:
- - uses: actions/checkout@v3
- - uses: dcodeIO/setup-node-nvm@master
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: current
- name: Install dependencies
@@ -70,11 +70,8 @@ jobs:
runs-on: ubuntu-latest
needs: check
steps:
- - uses: actions/checkout@v3
- - uses: dcodeIO/setup-node-nvm@master
- with:
- node-mirror: https://nodejs.org/download/v8-canary/
- node-version: 19.0.0-v8-canary202209029fc5a9347b
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci --no-audit
- name: Build
@@ -83,14 +80,14 @@ jobs:
env:
ASC_FEATURES: threads,reference-types,gc,exception-handling
run: |
- npm run test:compiler features/threads features/reference-types features/gc features/exception-handling
+ npm run test:compiler features/threads features/reference-types features/gc features/exception-handling bindings/esm bindings/raw
runtimes:
name: "Runtimes"
runs-on: ubuntu-latest
needs: check
steps:
- - uses: actions/checkout@v3
- - uses: dcodeIO/setup-node-nvm@master
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: current
- name: Install dependencies
@@ -114,8 +111,8 @@ jobs:
runs-on: ubuntu-latest
needs: check
steps:
- - uses: actions/checkout@v3
- - uses: dcodeIO/setup-node-nvm@master
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: current
- name: Install dependencies
@@ -127,3 +124,20 @@ jobs:
cd lib/loader
npm run asbuild
npm run test
+ coverage:
+ name: "Coverage"
+ runs-on: ubuntu-latest
+ needs: check
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install dependencies
+ run: npm ci --no-audit
+ - name: Build
+ run: npm run build
+ - name: Collect coverage
+ run: npx c8 -r none -- npm test
+ - name: Output coverage summary
+ run: npx c8 report -r text-summary
diff --git a/.gitignore b/.gitignore
index 3166d113d2..79bb9e71d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
node_modules/
*debug.log
-dist/
build/
raw/
.history
@@ -10,3 +9,10 @@ raw/
cli/index.generated.js
src/diagnosticMessages.generated.ts
coverage/
+
+dist/*.generated.d.ts
+dist/*.map
+dist/asc.js
+dist/assemblyscript.js
+dist/importmap.json
+dist/web.js
diff --git a/NOTICE b/NOTICE
index a9ddc72e21..14d821345c 100644
--- a/NOTICE
+++ b/NOTICE
@@ -55,6 +55,13 @@ under the licensing terms detailed in LICENSE:
* CountBleck
* Abdul Rauf
* Bach Le
+* Xinquan Xu
+* Matt Johnson-Pint
+* Fabián Heredia Montiel
+* Jonas Minnberg
+* Kam Chehresa
+* Mopsgamer <79159094+Mopsgamer@users.noreply.github.com>
+* EDM115
Portions of this software are derived from third-party works licensed under
the following terms:
diff --git a/bin/asinit.js b/bin/asinit.js
old mode 100644
new mode 100755
index 5023e5c09a..cb52aad48c
--- a/bin/asinit.js
+++ b/bin/asinit.js
@@ -55,11 +55,20 @@ const asinitOptions = {
],
"type": "b",
"alias": "y"
- }
+ },
+ "noColors": {
+ "description": "Disables terminal colors.",
+ "type": "b",
+ "default": false
+ },
};
const cliOptions = optionsUtil.parse(process.argv.slice(2), asinitOptions);
+if (cliOptions.options.noColors) {
+ stdoutColors.enabled = false;
+}
+
if (cliOptions.options.help || cliOptions.arguments.length === 0) printHelp();
function printHelp() {
@@ -91,7 +100,7 @@ if (/^(\.\.[/\\])*node_modules[/\\]assemblyscript[/\\]/.test(tsconfigBase)) {
}
const entryFile = path.join(assemblyDir, "index.ts");
const buildDir = path.join(projectDir, "build");
-const testsDir = path.join(projectDir, "tests");
+const testsDir = path.join(projectDir, "test");
const gitignoreFile = path.join(buildDir, ".gitignore");
const packageFile = path.join(projectDir, "package.json");
@@ -106,12 +115,23 @@ const paths = [
[gitignoreFile, "Git configuration that excludes compiled binaries from source control."],
[asconfigFile, "Configuration file defining both a 'debug' and a 'release' target."],
[packageFile, "Package info containing the necessary commands to compile to WebAssembly."],
- [testsIndexFile, "Stater test to check that the module is functioning."],
+ [testsIndexFile, "Starter test to check that the module is functioning."],
[indexHtmlFile, "Starter HTML file that loads the module in a browser."]
];
const formatPath = filePath => "./" + path.relative(projectDir, filePath).replace(/\\/g, "/");
+if (fs.existsSync(packageFile)) {
+ const pkg = JSON.parse(fs.readFileSync(packageFile));
+ if ("type" in pkg && pkg["type"] !== "module") {
+ console.error(stdoutColors.red([
+ `Error: The "type" field in ${formatPath(packageFile)} is set to "${pkg["type"]}".`,
+ ` asinit requires the "type" field to be set to "module" (ES modules).`
+ ].join("\n")));
+ process.exit(1);
+ }
+}
+
console.log([
"Version: " + version,
"",
@@ -338,7 +358,7 @@ function ensurePackageJson() {
"asbuild:debug": buildDebug,
"asbuild:release": buildRelease,
"asbuild": buildAll,
- "test": "node tests",
+ "test": "node --test",
"start": "npx serve ."
},
"devDependencies": {
@@ -370,7 +390,7 @@ function ensurePackageJson() {
updated = true;
}
if (!scripts["test"] || scripts["test"] == npmDefaultTest) {
- scripts["test"] = "node tests";
+ scripts["test"] = "node --test";
pkg["scripts"] = scripts;
updated = true;
}
@@ -396,7 +416,7 @@ function ensurePackageJson() {
}
function ensureTestsDirectory() {
- console.log("- Making sure that the 'tests' directory exists...");
+ console.log("- Making sure that the 'test' directory exists...");
if (!fs.existsSync(testsDir)) {
fs.mkdirSync(testsDir);
console.log(stdoutColors.green(" Created: ") + testsDir);
@@ -407,13 +427,16 @@ function ensureTestsDirectory() {
}
function ensureTestsIndexJs() {
- console.log("- Making sure that 'tests/index.js' exists...");
+ console.log("- Making sure that 'test/index.js' exists...");
if (!fs.existsSync(testsIndexFile)) {
fs.writeFileSync(testsIndexFile, [
- "import assert from \"assert\";",
+ "import assert from \"node:assert/strict\";",
+ "import { it } from \"node:test\";",
"import { add } from \"../build/debug.js\";",
- "assert.strictEqual(add(1, 2), 3);",
- "console.log(\"ok\");"
+ "",
+ "it(\"add\", () => {",
+ " assert.equal(add(1, 2), 3);",
+ "});"
].join("\n") + "\n");
console.log(stdoutColors.green(" Created: ") + testsIndexFile);
} else {
diff --git a/cli/index.d.ts b/cli/index.d.ts
index c2666db31f..58c7fb4ef6 100644
--- a/cli/index.d.ts
+++ b/cli/index.d.ts
@@ -165,7 +165,7 @@ export interface APIOptions {
/** Reads a file from disk (or memory). */
readFile?: (filename: string, baseDir: string) => (string | null) | Promise;
/** Writes a file to disk (or memory). */
- writeFile?: (filename: string, contents: Uint8Array, baseDir: string) => void | Promise;
+ writeFile?: (filename: string, contents: Uint8Array | string, baseDir: string) => void | Promise;
/** Lists all files within a directory. */
listFiles?: (dirname: string, baseDir: string) => (string[] | null) | Promise;
/** Handler for diagnostic messages. */
@@ -240,7 +240,8 @@ export function createMemoryStream(fn?: (chunk: Uint8Array | string) => void): M
/** Compatible TypeScript compiler options for syntax highlighting etc. */
export const tscOptions: Record;
-import { Program, Parser, Module } from "../src";
+import binaryen from "../lib/binaryen";
+import { Program, Parser } from "../src";
/** Compiler transform base class. */
export abstract class Transform {
@@ -248,6 +249,9 @@ export abstract class Transform {
/** Program reference. */
readonly program: Program;
+ /** Binaryen reference. */
+ readonly binaryen: typeof binaryen;
+
/** Base directory. */
readonly baseDir: string;
@@ -276,5 +280,5 @@ export abstract class Transform {
afterInitialize?(program: Program): void | Promise;
/** Called when compilation is complete, before the module is being validated. */
- afterCompile?(module: Module): void | Promise;
+ afterCompile?(module: binaryen.Module): void | Promise;
}
diff --git a/cli/index.js b/cli/index.js
index 5d92e648e8..d6808957f4 100644
--- a/cli/index.js
+++ b/cli/index.js
@@ -372,7 +372,7 @@ export async function main(argv, options) {
let name = features[i].trim();
let flag = assemblyscript[`FEATURE_${toUpperSnakeCase(name)}`];
if (!flag) return prepareResult(Error(`Feature '${name}' is unknown.`));
- assemblyscript.disableFeature(compilerOptions, flag);
+ assemblyscript.setFeature(compilerOptions, flag, false);
}
}
@@ -383,7 +383,7 @@ export async function main(argv, options) {
let name = features[i].trim();
let flag = assemblyscript[`FEATURE_${toUpperSnakeCase(name)}`];
if (!flag) return prepareResult(Error(`Feature '${name}' is unknown.`));
- assemblyscript.enableFeature(compilerOptions, flag);
+ assemblyscript.setFeature(compilerOptions, flag, true);
}
}
@@ -450,6 +450,7 @@ export async function main(argv, options) {
if (typeof transform === "function") {
Object.assign(transform.prototype, {
program,
+ binaryen,
baseDir,
stdout,
stderr,
@@ -597,7 +598,7 @@ export async function main(argv, options) {
return { sourceText, sourcePath };
}
- // Gets all pending imported files from the the backlog
+ // Gets all pending imported files from the backlog
function getBacklog(paths = []) {
do {
let internalPath = assemblyscript.nextFile(program);
@@ -944,9 +945,10 @@ export async function main(argv, options) {
try {
// use superset text format when extension is `.wast`.
// Otherwise use official stack IR format (wat).
+ binaryen.setOptimizeStackIR(true);
out = opts.textFile?.endsWith(".wast")
? binaryenModule.emitText()
- : binaryenModule.emitStackIR(true);
+ : binaryenModule.emitStackIR();
} catch (e) {
crash("emitText", e);
}
diff --git a/cli/options.json b/cli/options.json
index 6590a92138..f6776dbe26 100644
--- a/cli/options.json
+++ b/cli/options.json
@@ -221,6 +221,7 @@
" reference-types Reference types and operations.",
" gc Garbage collection (WIP).",
" stringref String reference types.",
+ " relaxed-simd Relaxed SIMD operations.",
""
],
"TODO_doesNothingYet": [
@@ -228,7 +229,6 @@
" tail-calls Tail call operations.",
" multi-value Multi value types.",
" memory64 Memory64 operations.",
- " relaxed-simd Relaxed SIMD operations.",
" extended-const Extended const expressions."
],
"type": "S",
diff --git a/dist/asc.d.ts b/dist/asc.d.ts
new file mode 100644
index 0000000000..17fcb31434
--- /dev/null
+++ b/dist/asc.d.ts
@@ -0,0 +1,4 @@
+///
+export * from "types:assemblyscript/cli/index";
+import * as asc from "types:assemblyscript/cli/index";
+export default asc;
diff --git a/dist/assemblyscript.d.ts b/dist/assemblyscript.d.ts
new file mode 100644
index 0000000000..2b2e4a4403
--- /dev/null
+++ b/dist/assemblyscript.d.ts
@@ -0,0 +1,4 @@
+///
+export * from "types:assemblyscript/src/index";
+import * as assemblyscript from "types:assemblyscript/src/index";
+export default assemblyscript;
diff --git a/dist/transform.cjs b/dist/transform.cjs
new file mode 100644
index 0000000000..a245e852c8
--- /dev/null
+++ b/dist/transform.cjs
@@ -0,0 +1 @@
+module.exports = class Transform { /* stub */ };
diff --git a/dist/transform.d.ts b/dist/transform.d.ts
new file mode 100644
index 0000000000..14efe05e8f
--- /dev/null
+++ b/dist/transform.d.ts
@@ -0,0 +1 @@
+export { Transform } from "./asc";
diff --git a/dist/transform.js b/dist/transform.js
new file mode 100644
index 0000000000..f6c0877686
--- /dev/null
+++ b/dist/transform.js
@@ -0,0 +1 @@
+export class Transform { /* stub */ };
diff --git a/lib/loader/package-lock.json b/lib/loader/package-lock.json
index 5e7995069d..a6d2d6962f 100644
--- a/lib/loader/package-lock.json
+++ b/lib/loader/package-lock.json
@@ -26,12 +26,13 @@
}
},
"node_modules/@babel/code-frame": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
- "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
+ "version": "7.22.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
+ "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
"dev": true,
"dependencies": {
- "@babel/highlight": "^7.16.7"
+ "@babel/highlight": "^7.22.13",
+ "chalk": "^2.4.2"
},
"engines": {
"node": ">=6.9.0"
@@ -77,13 +78,14 @@
}
},
"node_modules/@babel/generator": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz",
- "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
+ "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.18.2",
- "@jridgewell/gen-mapping": "^0.3.0",
+ "@babel/types": "^7.23.0",
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1"
},
"engines": {
@@ -91,12 +93,12 @@
}
},
"node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz",
- "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==",
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
+ "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
"dev": true,
"dependencies": {
- "@jridgewell/set-array": "^1.0.0",
+ "@jridgewell/set-array": "^1.0.1",
"@jridgewell/sourcemap-codec": "^1.4.10",
"@jridgewell/trace-mapping": "^0.3.9"
},
@@ -123,34 +125,34 @@
}
},
"node_modules/@babel/helper-environment-visitor": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz",
- "integrity": "sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
+ "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-function-name": {
- "version": "7.17.9",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz",
- "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
+ "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dev": true,
"dependencies": {
- "@babel/template": "^7.16.7",
- "@babel/types": "^7.17.0"
+ "@babel/template": "^7.22.15",
+ "@babel/types": "^7.23.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-hoist-variables": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz",
- "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==",
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
+ "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.16.7"
+ "@babel/types": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
@@ -209,21 +211,30 @@
}
},
"node_modules/@babel/helper-split-export-declaration": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz",
- "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==",
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
+ "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
"dev": true,
"dependencies": {
- "@babel/types": "^7.16.7"
+ "@babel/types": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
}
},
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
+ "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
+ "dev": true,
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@babel/helper-validator-identifier": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
- "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
+ "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
"dev": true,
"engines": {
"node": ">=6.9.0"
@@ -253,13 +264,13 @@
}
},
"node_modules/@babel/highlight": {
- "version": "7.17.12",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz",
- "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
+ "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
"dev": true,
"dependencies": {
- "@babel/helper-validator-identifier": "^7.16.7",
- "chalk": "^2.0.0",
+ "@babel/helper-validator-identifier": "^7.22.20",
+ "chalk": "^2.4.2",
"js-tokens": "^4.0.0"
},
"engines": {
@@ -267,9 +278,9 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.18.3",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.3.tgz",
- "integrity": "sha512-rL50YcEuHbbauAFAysNsJA4/f89fGTOBRNs9P81sniKnKAr4xULe5AecolcsKbi88xu0ByWYDj/S1AJ3FSFuSQ==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
+ "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@@ -297,33 +308,33 @@
}
},
"node_modules/@babel/template": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz",
- "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==",
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
+ "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
"dev": true,
"dependencies": {
- "@babel/code-frame": "^7.16.7",
- "@babel/parser": "^7.16.7",
- "@babel/types": "^7.16.7"
+ "@babel/code-frame": "^7.22.13",
+ "@babel/parser": "^7.22.15",
+ "@babel/types": "^7.22.15"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.2.tgz",
- "integrity": "sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA==",
+ "version": "7.23.2",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
+ "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
"dev": true,
"dependencies": {
- "@babel/code-frame": "^7.16.7",
- "@babel/generator": "^7.18.2",
- "@babel/helper-environment-visitor": "^7.18.2",
- "@babel/helper-function-name": "^7.17.9",
- "@babel/helper-hoist-variables": "^7.16.7",
- "@babel/helper-split-export-declaration": "^7.16.7",
- "@babel/parser": "^7.18.0",
- "@babel/types": "^7.18.2",
+ "@babel/code-frame": "^7.22.13",
+ "@babel/generator": "^7.23.0",
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-function-name": "^7.23.0",
+ "@babel/helper-hoist-variables": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/parser": "^7.23.0",
+ "@babel/types": "^7.23.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
@@ -332,12 +343,13 @@
}
},
"node_modules/@babel/types": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.2.tgz",
- "integrity": "sha512-0On6B8A4/+mFUto5WERt3EEuG1NznDirvwca1O8UwXQHVY8g3R7OzYgxXdOfMwLO08UrpUD/2+3Bclyq+/C94Q==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
+ "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
"dev": true,
"dependencies": {
- "@babel/helper-validator-identifier": "^7.16.7",
+ "@babel/helper-string-parser": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -358,9 +370,9 @@
}
},
"node_modules/@jridgewell/resolve-uri": {
- "version": "3.0.7",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz",
- "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
+ "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
"dev": true,
"engines": {
"node": ">=6.0.0"
@@ -376,19 +388,19 @@
}
},
"node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.4.13",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz",
- "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==",
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.13",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz",
- "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==",
+ "version": "0.3.19",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz",
+ "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==",
"dev": true,
"dependencies": {
- "@jridgewell/resolve-uri": "^3.0.3",
- "@jridgewell/sourcemap-codec": "^1.4.10"
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/ansi-styles": {
@@ -631,7 +643,7 @@
"node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true,
"engines": {
"node": ">=4"
@@ -680,9 +692,9 @@
}
},
"node_modules/json5": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
- "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true,
"bin": {
"json5": "lib/cli.js"
@@ -785,12 +797,13 @@
}
},
"@babel/code-frame": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
- "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
+ "version": "7.22.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
+ "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
"dev": true,
"requires": {
- "@babel/highlight": "^7.16.7"
+ "@babel/highlight": "^7.22.13",
+ "chalk": "^2.4.2"
}
},
"@babel/compat-data": {
@@ -823,23 +836,24 @@
}
},
"@babel/generator": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.2.tgz",
- "integrity": "sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
+ "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
"dev": true,
"requires": {
- "@babel/types": "^7.18.2",
- "@jridgewell/gen-mapping": "^0.3.0",
+ "@babel/types": "^7.23.0",
+ "@jridgewell/gen-mapping": "^0.3.2",
+ "@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1"
},
"dependencies": {
"@jridgewell/gen-mapping": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz",
- "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==",
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
+ "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
"dev": true,
"requires": {
- "@jridgewell/set-array": "^1.0.0",
+ "@jridgewell/set-array": "^1.0.1",
"@jridgewell/sourcemap-codec": "^1.4.10",
"@jridgewell/trace-mapping": "^0.3.9"
}
@@ -859,28 +873,28 @@
}
},
"@babel/helper-environment-visitor": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz",
- "integrity": "sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
+ "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"dev": true
},
"@babel/helper-function-name": {
- "version": "7.17.9",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz",
- "integrity": "sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
+ "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dev": true,
"requires": {
- "@babel/template": "^7.16.7",
- "@babel/types": "^7.17.0"
+ "@babel/template": "^7.22.15",
+ "@babel/types": "^7.23.0"
}
},
"@babel/helper-hoist-variables": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz",
- "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==",
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
+ "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
"dev": true,
"requires": {
- "@babel/types": "^7.16.7"
+ "@babel/types": "^7.22.5"
}
},
"@babel/helper-module-imports": {
@@ -924,18 +938,24 @@
}
},
"@babel/helper-split-export-declaration": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz",
- "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==",
+ "version": "7.22.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
+ "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
"dev": true,
"requires": {
- "@babel/types": "^7.16.7"
+ "@babel/types": "^7.22.5"
}
},
+ "@babel/helper-string-parser": {
+ "version": "7.22.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
+ "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
+ "dev": true
+ },
"@babel/helper-validator-identifier": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
- "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
+ "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
"dev": true
},
"@babel/helper-validator-option": {
@@ -956,20 +976,20 @@
}
},
"@babel/highlight": {
- "version": "7.17.12",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.17.12.tgz",
- "integrity": "sha512-7yykMVF3hfZY2jsHZEEgLc+3x4o1O+fYyULu11GynEUQNwB6lua+IIQn1FiJxNucd5UlyJryrwsOh8PL9Sn8Qg==",
+ "version": "7.22.20",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
+ "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
"dev": true,
"requires": {
- "@babel/helper-validator-identifier": "^7.16.7",
- "chalk": "^2.0.0",
+ "@babel/helper-validator-identifier": "^7.22.20",
+ "chalk": "^2.4.2",
"js-tokens": "^4.0.0"
}
},
"@babel/parser": {
- "version": "7.18.3",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.3.tgz",
- "integrity": "sha512-rL50YcEuHbbauAFAysNsJA4/f89fGTOBRNs9P81sniKnKAr4xULe5AecolcsKbi88xu0ByWYDj/S1AJ3FSFuSQ==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
+ "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"dev": true
},
"@babel/plugin-transform-modules-commonjs": {
@@ -985,41 +1005,42 @@
}
},
"@babel/template": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz",
- "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==",
+ "version": "7.22.15",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
+ "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
"dev": true,
"requires": {
- "@babel/code-frame": "^7.16.7",
- "@babel/parser": "^7.16.7",
- "@babel/types": "^7.16.7"
+ "@babel/code-frame": "^7.22.13",
+ "@babel/parser": "^7.22.15",
+ "@babel/types": "^7.22.15"
}
},
"@babel/traverse": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.2.tgz",
- "integrity": "sha512-9eNwoeovJ6KH9zcCNnENY7DMFwTU9JdGCFtqNLfUAqtUHRCOsTOqWoffosP8vKmNYeSBUv3yVJXjfd8ucwOjUA==",
+ "version": "7.23.2",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
+ "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
"dev": true,
"requires": {
- "@babel/code-frame": "^7.16.7",
- "@babel/generator": "^7.18.2",
- "@babel/helper-environment-visitor": "^7.18.2",
- "@babel/helper-function-name": "^7.17.9",
- "@babel/helper-hoist-variables": "^7.16.7",
- "@babel/helper-split-export-declaration": "^7.16.7",
- "@babel/parser": "^7.18.0",
- "@babel/types": "^7.18.2",
+ "@babel/code-frame": "^7.22.13",
+ "@babel/generator": "^7.23.0",
+ "@babel/helper-environment-visitor": "^7.22.20",
+ "@babel/helper-function-name": "^7.23.0",
+ "@babel/helper-hoist-variables": "^7.22.5",
+ "@babel/helper-split-export-declaration": "^7.22.6",
+ "@babel/parser": "^7.23.0",
+ "@babel/types": "^7.23.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
}
},
"@babel/types": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.2.tgz",
- "integrity": "sha512-0On6B8A4/+mFUto5WERt3EEuG1NznDirvwca1O8UwXQHVY8g3R7OzYgxXdOfMwLO08UrpUD/2+3Bclyq+/C94Q==",
+ "version": "7.23.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
+ "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
"dev": true,
"requires": {
- "@babel/helper-validator-identifier": "^7.16.7",
+ "@babel/helper-string-parser": "^7.22.5",
+ "@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0"
}
},
@@ -1034,9 +1055,9 @@
}
},
"@jridgewell/resolve-uri": {
- "version": "3.0.7",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz",
- "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
+ "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
"dev": true
},
"@jridgewell/set-array": {
@@ -1046,19 +1067,19 @@
"dev": true
},
"@jridgewell/sourcemap-codec": {
- "version": "1.4.13",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz",
- "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==",
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
"dev": true
},
"@jridgewell/trace-mapping": {
- "version": "0.3.13",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz",
- "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==",
+ "version": "0.3.19",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz",
+ "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==",
"dev": true,
"requires": {
- "@jridgewell/resolve-uri": "^3.0.3",
- "@jridgewell/sourcemap-codec": "^1.4.10"
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"ansi-styles": {
@@ -1231,7 +1252,7 @@
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
- "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true
},
"has-property-descriptors": {
@@ -1262,9 +1283,9 @@
"dev": true
},
"json5": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
- "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true
},
"ms": {
diff --git a/lib/rtrace/tlsfvis.html b/lib/rtrace/tlsfvis.html
index ab3f6548a6..16c022b270 100644
--- a/lib/rtrace/tlsfvis.html
+++ b/lib/rtrace/tlsfvis.html
@@ -169,8 +169,8 @@
TLSF visualizer
-
- Notes:
+
+
Notes:
It is expected that there is exactly one block on initialization. This is the remaining space (< 64K) within the last page after static data.
It is expected that if two adjacent blocks of size K are freed, the merged block doesn't go into the first level list for K*2 because its size is actually larger than that (K + OVERHEAD + K).
@@ -178,7 +178,7 @@ TLSF visualizer
It is expected that after other operations have already been performed, being able to allocate 1GB can't be guaranteed anymore, even if there should be enough space left in absolute terms, if prior subdivision prevents it.
It is expected that the second level 0 in first level 0 isn't ever used due to alignment guarantees. Smallest block is 32 bytes (16 bytes overhead + 16 bytes payload if used, respectively linking information if free) in this implementation.
-
+
Implementation constants: ? bits alignment, ? bits first level, ? bits second level, ? B overhead
First level bitmap
@@ -229,7 +229,6 @@ Allocator
512 MB - δ fl=MSB-1 sl=MSB
1 GB - δ fl=MSB sl=MSB
-
Segments
Allocations performed above are tracked here so you can free them again. Note that TLSF alone does not keep track of used blocks (unless free'd and put in a free list again). It is expected that adjacent free blocks become merged automatically.
diff --git a/package-lock.json b/package-lock.json
index b7bed0db4a..a988bec980 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,393 +9,501 @@
"version": "0.0.0",
"license": "Apache-2.0",
"dependencies": {
- "binaryen": "111.0.0-nightly.20230202",
- "long": "^5.2.1"
+ "binaryen": "123.0.0-nightly.20250530",
+ "long": "^5.2.4"
},
"bin": {
"asc": "bin/asc.js",
"asinit": "bin/asinit.js"
},
"devDependencies": {
- "@types/node": "^18.13.0",
- "@typescript-eslint/eslint-plugin": "^5.51.0",
- "@typescript-eslint/parser": "^5.51.0",
- "diff": "^5.1.0",
- "esbuild": "^0.16.17",
- "eslint": "^8.33.0",
- "glob": "^7.2.0",
- "typescript": "~4.7.4"
+ "@types/node": "^18.19.75",
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
+ "@typescript-eslint/parser": "^5.62.0",
+ "as-float": "^1.0.1",
+ "diff": "^7.0.0",
+ "esbuild": "^0.25.0",
+ "eslint": "^8.57.1",
+ "glob": "^10.4.5",
+ "typescript": "^5.7.3"
},
"engines": {
- "node": ">=16.0.0",
- "npm": ">=7.0.0"
+ "node": ">=20",
+ "npm": ">=10"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/assemblyscript"
}
},
+ "node_modules/@aashutoshrathi/word-wrap": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
+ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz",
+ "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
"node_modules/@esbuild/android-arm": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz",
- "integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz",
+ "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==",
"cpu": [
"arm"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/android-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz",
- "integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz",
+ "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==",
"cpu": [
"arm64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/android-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz",
- "integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz",
+ "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==",
"cpu": [
"x64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/darwin-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz",
- "integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz",
+ "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==",
"cpu": [
"arm64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/darwin-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz",
- "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz",
+ "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==",
"cpu": [
"x64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/freebsd-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz",
- "integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==",
"cpu": [
"arm64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/freebsd-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz",
- "integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz",
+ "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==",
"cpu": [
"x64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-arm": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz",
- "integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz",
+ "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==",
"cpu": [
"arm"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz",
- "integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz",
+ "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==",
"cpu": [
"arm64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-ia32": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz",
- "integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz",
+ "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==",
"cpu": [
"ia32"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-loong64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz",
- "integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz",
+ "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==",
"cpu": [
"loong64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-mips64el": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz",
- "integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz",
+ "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==",
"cpu": [
"mips64el"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-ppc64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz",
- "integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz",
+ "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==",
"cpu": [
"ppc64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-riscv64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz",
- "integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz",
+ "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==",
"cpu": [
"riscv64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-s390x": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz",
- "integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz",
+ "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==",
"cpu": [
"s390x"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/linux-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz",
- "integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz",
+ "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==",
"cpu": [
"x64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
"node_modules/@esbuild/netbsd-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz",
- "integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz",
+ "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==",
"cpu": [
"x64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"netbsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
}
},
"node_modules/@esbuild/openbsd-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz",
- "integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz",
+ "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==",
"cpu": [
"x64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"openbsd"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/sunos-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz",
- "integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz",
+ "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==",
"cpu": [
"x64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"sunos"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/win32-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz",
- "integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz",
+ "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==",
"cpu": [
"arm64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/win32-ia32": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz",
- "integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz",
+ "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==",
"cpu": [
"ia32"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
}
},
"node_modules/@esbuild/win32-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz",
- "integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz",
+ "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==",
"cpu": [
"x64"
],
"dev": true,
+ "license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
- "node": ">=12"
+ "node": ">=18"
+ }
+ },
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
+ "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
+ "dev": true,
+ "dependencies": {
+ "eslint-visitor-keys": "^3.3.0"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ }
+ },
+ "node_modules/@eslint-community/regexpp": {
+ "version": "4.10.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz",
+ "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==",
+ "dev": true,
+ "engines": {
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
}
},
"node_modules/@eslint/eslintrc": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
- "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==",
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
+ "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
- "espree": "^9.4.0",
+ "espree": "^9.6.0",
"globals": "^13.19.0",
"ignore": "^5.2.0",
"import-fresh": "^3.2.1",
@@ -410,14 +518,26 @@
"url": "https://opencollective.com/eslint"
}
},
+ "node_modules/@eslint/js": {
+ "version": "8.57.1",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz",
+ "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ }
+ },
"node_modules/@humanwhocodes/config-array": {
- "version": "0.11.8",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
- "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==",
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz",
+ "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==",
+ "deprecated": "Use @eslint/config-array instead",
"dev": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@humanwhocodes/object-schema": "^1.2.1",
- "debug": "^4.1.1",
+ "@humanwhocodes/object-schema": "^2.0.3",
+ "debug": "^4.3.1",
"minimatch": "^3.0.5"
},
"engines": {
@@ -438,10 +558,59 @@
}
},
"node_modules/@humanwhocodes/object-schema": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
- "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
- "dev": true
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
+ "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
+ "deprecated": "Use @eslint/object-schema instead",
+ "dev": true,
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@isaacs/cliui": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
+ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "string-width": "^5.1.2",
+ "string-width-cjs": "npm:string-width@^4.2.0",
+ "strip-ansi": "^7.0.1",
+ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
+ "wrap-ansi": "^8.1.0",
+ "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@isaacs/cliui/node_modules/ansi-regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
+ "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/@isaacs/cliui/node_modules/strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
},
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
@@ -478,38 +647,53 @@
"node": ">= 8"
}
},
+ "node_modules/@pkgjs/parseargs": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
+ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=14"
+ }
+ },
"node_modules/@types/json-schema": {
- "version": "7.0.11",
- "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
- "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
+ "version": "7.0.14",
+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz",
+ "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==",
"dev": true
},
"node_modules/@types/node": {
- "version": "18.13.0",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
- "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==",
- "dev": true
+ "version": "18.19.75",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.75.tgz",
+ "integrity": "sha512-UIksWtThob6ZVSyxcOqCLOUNg/dyO1Qvx4McgeuhrEtHTLFTf7BBhEazaE4K806FGTPtzd/2sE90qn4fVr7cyw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~5.26.4"
+ }
},
"node_modules/@types/semver": {
- "version": "7.3.13",
- "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz",
- "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==",
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==",
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.51.0.tgz",
- "integrity": "sha512-wcAwhEWm1RgNd7dxD/o+nnLW8oH+6RK1OGnmbmkj/GGoDPV1WWMVP0FXYQBivKHdwM1pwii3bt//RC62EriIUQ==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz",
+ "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==",
"dev": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "5.51.0",
- "@typescript-eslint/type-utils": "5.51.0",
- "@typescript-eslint/utils": "5.51.0",
+ "@eslint-community/regexpp": "^4.4.0",
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/type-utils": "5.62.0",
+ "@typescript-eslint/utils": "5.62.0",
"debug": "^4.3.4",
- "grapheme-splitter": "^1.0.4",
+ "graphemer": "^1.4.0",
"ignore": "^5.2.0",
"natural-compare-lite": "^1.4.0",
- "regexpp": "^3.2.0",
"semver": "^7.3.7",
"tsutils": "^3.21.0"
},
@@ -531,14 +715,14 @@
}
},
"node_modules/@typescript-eslint/parser": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.51.0.tgz",
- "integrity": "sha512-fEV0R9gGmfpDeRzJXn+fGQKcl0inIeYobmmUWijZh9zA7bxJ8clPhV9up2ZQzATxAiFAECqPQyMDB4o4B81AaA==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
+ "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==",
"dev": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "5.51.0",
- "@typescript-eslint/types": "5.51.0",
- "@typescript-eslint/typescript-estree": "5.51.0",
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/typescript-estree": "5.62.0",
"debug": "^4.3.4"
},
"engines": {
@@ -558,13 +742,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.51.0.tgz",
- "integrity": "sha512-gNpxRdlx5qw3yaHA0SFuTjW4rxeYhpHxt491PEcKF8Z6zpq0kMhe0Tolxt0qjlojS+/wArSDlj/LtE69xUJphQ==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz",
+ "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "5.51.0",
- "@typescript-eslint/visitor-keys": "5.51.0"
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/visitor-keys": "5.62.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -575,13 +759,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.51.0.tgz",
- "integrity": "sha512-QHC5KKyfV8sNSyHqfNa0UbTbJ6caB8uhcx2hYcWVvJAZYJRBo5HyyZfzMdRx8nvS+GyMg56fugMzzWnojREuQQ==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz",
+ "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==",
"dev": true,
"dependencies": {
- "@typescript-eslint/typescript-estree": "5.51.0",
- "@typescript-eslint/utils": "5.51.0",
+ "@typescript-eslint/typescript-estree": "5.62.0",
+ "@typescript-eslint/utils": "5.62.0",
"debug": "^4.3.4",
"tsutils": "^3.21.0"
},
@@ -602,9 +786,9 @@
}
},
"node_modules/@typescript-eslint/types": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.51.0.tgz",
- "integrity": "sha512-SqOn0ANn/v6hFn0kjvLwiDi4AzR++CBZz0NV5AnusT2/3y32jdc0G4woXPWHCumWtUXZKPAS27/9vziSsC9jnw==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz",
+ "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -615,13 +799,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.51.0.tgz",
- "integrity": "sha512-TSkNupHvNRkoH9FMA3w7TazVFcBPveAAmb7Sz+kArY6sLT86PA5Vx80cKlYmd8m3Ha2SwofM1KwraF24lM9FvA==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz",
+ "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "5.51.0",
- "@typescript-eslint/visitor-keys": "5.51.0",
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/visitor-keys": "5.62.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -642,18 +826,18 @@
}
},
"node_modules/@typescript-eslint/utils": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.51.0.tgz",
- "integrity": "sha512-76qs+5KWcaatmwtwsDJvBk4H76RJQBFe+Gext0EfJdC3Vd2kpY2Pf//OHHzHp84Ciw0/rYoGTDnIAr3uWhhJYw==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz",
+ "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==",
"dev": true,
"dependencies": {
+ "@eslint-community/eslint-utils": "^4.2.0",
"@types/json-schema": "^7.0.9",
"@types/semver": "^7.3.12",
- "@typescript-eslint/scope-manager": "5.51.0",
- "@typescript-eslint/types": "5.51.0",
- "@typescript-eslint/typescript-estree": "5.51.0",
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/typescript-estree": "5.62.0",
"eslint-scope": "^5.1.1",
- "eslint-utils": "^3.0.0",
"semver": "^7.3.7"
},
"engines": {
@@ -668,12 +852,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.51.0.tgz",
- "integrity": "sha512-Oh2+eTdjHjOFjKA27sxESlA87YPSOJafGCR0md5oeMdh1ZcCfAGCIOL216uTBAkAIptvLIfKQhl7lHxMJet4GQ==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz",
+ "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "5.51.0",
+ "@typescript-eslint/types": "5.62.0",
"eslint-visitor-keys": "^3.3.0"
},
"engines": {
@@ -684,11 +868,18 @@
"url": "https://opencollective.com/typescript-eslint"
}
},
+ "node_modules/@ungap/structured-clone": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
+ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
+ "dev": true
+ },
"node_modules/acorn": {
- "version": "8.8.2",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
- "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
+ "version": "8.14.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
+ "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
"dev": true,
+ "license": "MIT",
"bin": {
"acorn": "bin/acorn"
},
@@ -701,6 +892,7 @@
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"dev": true,
+ "license": "MIT",
"peerDependencies": {
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
@@ -710,6 +902,7 @@
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -749,7 +942,8 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
- "dev": true
+ "dev": true,
+ "license": "Python-2.0"
},
"node_modules/array-union": {
"version": "2.1.0",
@@ -760,6 +954,13 @@
"node": ">=8"
}
},
+ "node_modules/as-float": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/as-float/-/as-float-1.0.1.tgz",
+ "integrity": "sha512-TsN1UpoFdtzuKXqqpdnGbFuMYnK/eqMEjd2xVvACG29H/v4KLx+UD+tHRz9v6zO+Ge/AR/uskSruBIPZrchhHw==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -767,11 +968,19 @@
"dev": true
},
"node_modules/binaryen": {
- "version": "111.0.0-nightly.20230202",
- "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-111.0.0-nightly.20230202.tgz",
- "integrity": "sha512-aGMDtxmc8zQHzAamyOBvO38n2e/GuXM0dZCJg+IuG2YUQODTqI37XSkAixS8c0wXn2dgLntDMk1VDblKCsy0GA==",
+ "version": "123.0.0-nightly.20250530",
+ "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-123.0.0-nightly.20250530.tgz",
+ "integrity": "sha512-d1zPHBN5YlOd3Ff+OUxvVExuFeh8heSnqe+X3bjItFxGLvn4VGBKmrvv7pgy/cRhrIUGuPW138iaWfDhwjyDqg==",
+ "license": "Apache-2.0",
"bin": {
+ "wasm-as": "bin/wasm-as",
+ "wasm-ctor-eval": "bin/wasm-ctor-eval",
+ "wasm-dis": "bin/wasm-dis",
+ "wasm-merge": "bin/wasm-merge",
+ "wasm-metadce": "bin/wasm-metadce",
"wasm-opt": "bin/wasm-opt",
+ "wasm-reduce": "bin/wasm-reduce",
+ "wasm-shell": "bin/wasm-shell",
"wasm2js": "bin/wasm2js"
}
},
@@ -786,12 +995,12 @@
}
},
"node_modules/braces": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true,
"dependencies": {
- "fill-range": "^7.0.1"
+ "fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
@@ -802,6 +1011,7 @@
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=6"
}
@@ -843,14 +1053,15 @@
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"dev": true
},
"node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
@@ -884,10 +1095,11 @@
"dev": true
},
"node_modules/diff": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz",
- "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz",
+ "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==",
"dev": true,
+ "license": "BSD-3-Clause",
"engines": {
"node": ">=0.3.1"
}
@@ -916,41 +1128,59 @@
"node": ">=6.0.0"
}
},
+ "node_modules/eastasianwidth": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
+ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/emoji-regex": {
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/esbuild": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz",
- "integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz",
+ "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==",
"dev": true,
"hasInstallScript": true,
+ "license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
- "node": ">=12"
+ "node": ">=18"
},
"optionalDependencies": {
- "@esbuild/android-arm": "0.16.17",
- "@esbuild/android-arm64": "0.16.17",
- "@esbuild/android-x64": "0.16.17",
- "@esbuild/darwin-arm64": "0.16.17",
- "@esbuild/darwin-x64": "0.16.17",
- "@esbuild/freebsd-arm64": "0.16.17",
- "@esbuild/freebsd-x64": "0.16.17",
- "@esbuild/linux-arm": "0.16.17",
- "@esbuild/linux-arm64": "0.16.17",
- "@esbuild/linux-ia32": "0.16.17",
- "@esbuild/linux-loong64": "0.16.17",
- "@esbuild/linux-mips64el": "0.16.17",
- "@esbuild/linux-ppc64": "0.16.17",
- "@esbuild/linux-riscv64": "0.16.17",
- "@esbuild/linux-s390x": "0.16.17",
- "@esbuild/linux-x64": "0.16.17",
- "@esbuild/netbsd-x64": "0.16.17",
- "@esbuild/openbsd-x64": "0.16.17",
- "@esbuild/sunos-x64": "0.16.17",
- "@esbuild/win32-arm64": "0.16.17",
- "@esbuild/win32-ia32": "0.16.17",
- "@esbuild/win32-x64": "0.16.17"
+ "@esbuild/aix-ppc64": "0.25.0",
+ "@esbuild/android-arm": "0.25.0",
+ "@esbuild/android-arm64": "0.25.0",
+ "@esbuild/android-x64": "0.25.0",
+ "@esbuild/darwin-arm64": "0.25.0",
+ "@esbuild/darwin-x64": "0.25.0",
+ "@esbuild/freebsd-arm64": "0.25.0",
+ "@esbuild/freebsd-x64": "0.25.0",
+ "@esbuild/linux-arm": "0.25.0",
+ "@esbuild/linux-arm64": "0.25.0",
+ "@esbuild/linux-ia32": "0.25.0",
+ "@esbuild/linux-loong64": "0.25.0",
+ "@esbuild/linux-mips64el": "0.25.0",
+ "@esbuild/linux-ppc64": "0.25.0",
+ "@esbuild/linux-riscv64": "0.25.0",
+ "@esbuild/linux-s390x": "0.25.0",
+ "@esbuild/linux-x64": "0.25.0",
+ "@esbuild/netbsd-arm64": "0.25.0",
+ "@esbuild/netbsd-x64": "0.25.0",
+ "@esbuild/openbsd-arm64": "0.25.0",
+ "@esbuild/openbsd-x64": "0.25.0",
+ "@esbuild/sunos-x64": "0.25.0",
+ "@esbuild/win32-arm64": "0.25.0",
+ "@esbuild/win32-ia32": "0.25.0",
+ "@esbuild/win32-x64": "0.25.0"
}
},
"node_modules/escape-string-regexp": {
@@ -966,49 +1196,50 @@
}
},
"node_modules/eslint": {
- "version": "8.33.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.33.0.tgz",
- "integrity": "sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==",
+ "version": "8.57.1",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz",
+ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==",
+ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
"dev": true,
+ "license": "MIT",
"dependencies": {
- "@eslint/eslintrc": "^1.4.1",
- "@humanwhocodes/config-array": "^0.11.8",
+ "@eslint-community/eslint-utils": "^4.2.0",
+ "@eslint-community/regexpp": "^4.6.1",
+ "@eslint/eslintrc": "^2.1.4",
+ "@eslint/js": "8.57.1",
+ "@humanwhocodes/config-array": "^0.13.0",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
- "ajv": "^6.10.0",
+ "@ungap/structured-clone": "^1.2.0",
+ "ajv": "^6.12.4",
"chalk": "^4.0.0",
"cross-spawn": "^7.0.2",
"debug": "^4.3.2",
"doctrine": "^3.0.0",
"escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.1.1",
- "eslint-utils": "^3.0.0",
- "eslint-visitor-keys": "^3.3.0",
- "espree": "^9.4.0",
- "esquery": "^1.4.0",
+ "eslint-scope": "^7.2.2",
+ "eslint-visitor-keys": "^3.4.3",
+ "espree": "^9.6.1",
+ "esquery": "^1.4.2",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
"file-entry-cache": "^6.0.1",
"find-up": "^5.0.0",
"glob-parent": "^6.0.2",
"globals": "^13.19.0",
- "grapheme-splitter": "^1.0.4",
+ "graphemer": "^1.4.0",
"ignore": "^5.2.0",
- "import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4",
"is-glob": "^4.0.0",
"is-path-inside": "^3.0.3",
- "js-sdsl": "^4.1.4",
"js-yaml": "^4.1.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.4.1",
"lodash.merge": "^4.6.2",
"minimatch": "^3.1.2",
"natural-compare": "^1.4.0",
- "optionator": "^0.9.1",
- "regexpp": "^3.2.0",
+ "optionator": "^0.9.3",
"strip-ansi": "^6.0.1",
- "strip-json-comments": "^3.1.0",
"text-table": "^0.2.0"
},
"bin": {
@@ -1034,46 +1265,22 @@
"node": ">=8.0.0"
}
},
- "node_modules/eslint-utils": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
- "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
- "dev": true,
- "dependencies": {
- "eslint-visitor-keys": "^2.0.0"
- },
- "engines": {
- "node": "^10.0.0 || ^12.0.0 || >= 14.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/mysticatea"
- },
- "peerDependencies": {
- "eslint": ">=5"
- }
- },
- "node_modules/eslint-utils/node_modules/eslint-visitor-keys": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
- "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
- "dev": true,
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/eslint-visitor-keys": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz",
- "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==",
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
"node_modules/eslint/node_modules/eslint-scope": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz",
- "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==",
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
+ "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
"dev": true,
"dependencies": {
"esrecurse": "^4.3.0",
@@ -1081,6 +1288,9 @@
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
}
},
"node_modules/eslint/node_modules/estraverse": {
@@ -1093,14 +1303,15 @@
}
},
"node_modules/espree": {
- "version": "9.4.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz",
- "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
+ "version": "9.6.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
+ "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
"dev": true,
+ "license": "BSD-2-Clause",
"dependencies": {
- "acorn": "^8.8.0",
+ "acorn": "^8.9.0",
"acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.3.0"
+ "eslint-visitor-keys": "^3.4.1"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1110,9 +1321,9 @@
}
},
"node_modules/esquery": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
- "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
+ "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
"dev": true,
"dependencies": {
"estraverse": "^5.1.0"
@@ -1173,12 +1384,13 @@
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/fast-glob": {
- "version": "3.2.11",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz",
- "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz",
+ "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==",
"dev": true,
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
@@ -1207,18 +1419,19 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
"dev": true
},
"node_modules/fastq": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
- "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
+ "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
"dev": true,
"dependencies": {
"reusify": "^1.0.4"
@@ -1237,9 +1450,9 @@
}
},
"node_modules/fill-range": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true,
"dependencies": {
"to-regex-range": "^5.0.1"
@@ -1265,45 +1478,63 @@
}
},
"node_modules/flat-cache": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
- "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz",
+ "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==",
"dev": true,
"dependencies": {
- "flatted": "^3.1.0",
+ "flatted": "^3.2.9",
+ "keyv": "^4.5.3",
"rimraf": "^3.0.2"
},
"engines": {
- "node": "^10.12.0 || >=12.0.0"
+ "node": ">=12.0.0"
}
},
"node_modules/flatted": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz",
- "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==",
+ "version": "3.2.9",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz",
+ "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==",
"dev": true
},
+ "node_modules/foreground-child": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
+ "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",
+ "dev": true,
+ "dependencies": {
+ "cross-spawn": "^7.0.0",
+ "signal-exit": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"dev": true
},
"node_modules/glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "version": "10.5.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
+ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
"dev": true,
+ "license": "ISC",
"dependencies": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
+ "foreground-child": "^3.1.0",
+ "jackspeak": "^3.1.2",
+ "minimatch": "^9.0.4",
+ "minipass": "^7.1.2",
+ "package-json-from-dist": "^1.0.0",
+ "path-scurry": "^1.11.1"
},
- "engines": {
- "node": "*"
+ "bin": {
+ "glob": "dist/esm/bin.mjs"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
@@ -1321,11 +1552,38 @@
"node": ">=10.13.0"
}
},
+ "node_modules/glob/node_modules/brace-expansion": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/glob/node_modules/minimatch": {
+ "version": "9.0.9",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/globals": {
- "version": "13.20.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz",
- "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==",
+ "version": "13.24.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
+ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"type-fest": "^0.20.2"
},
@@ -1356,10 +1614,10 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/grapheme-splitter": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
- "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
+ "node_modules/graphemer": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
+ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
"dev": true
},
"node_modules/has-flag": {
@@ -1372,19 +1630,20 @@
}
},
"node_modules/ignore": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz",
- "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==",
+ "version": "5.2.4",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
+ "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==",
"dev": true,
"engines": {
"node": ">= 4"
}
},
"node_modules/import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
@@ -1399,7 +1658,7 @@
"node_modules/imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
"dev": true,
"engines": {
"node": ">=0.8.19"
@@ -1408,7 +1667,7 @@
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"dev": true,
"dependencies": {
"once": "^1.3.0",
@@ -1424,12 +1683,22 @@
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/is-glob": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
@@ -1463,24 +1732,31 @@
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
"dev": true
},
- "node_modules/js-sdsl": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz",
- "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==",
+ "node_modules/jackspeak": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
+ "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
"dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "@isaacs/cliui": "^8.0.2"
+ },
"funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/js-sdsl"
+ "url": "https://github.com/sponsors/isaacs"
+ },
+ "optionalDependencies": {
+ "@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
+ "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"argparse": "^2.0.1"
},
@@ -1488,18 +1764,34 @@
"js-yaml": "bin/js-yaml.js"
}
},
+ "node_modules/json-buffer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
+ "dev": true
+ },
"node_modules/json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
- "dev": true
+ "dev": true,
+ "license": "MIT"
},
"node_modules/json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
"dev": true
},
+ "node_modules/keyv": {
+ "version": "4.5.4",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
+ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
+ "dev": true,
+ "dependencies": {
+ "json-buffer": "3.0.1"
+ }
+ },
"node_modules/levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
@@ -1535,21 +1827,17 @@
"dev": true
},
"node_modules/long": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
- "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
+ "version": "5.2.4",
+ "resolved": "https://registry.npmjs.org/long/-/long-5.2.4.tgz",
+ "integrity": "sha512-qtzLbJE8hq7VabR3mISmVGtoXP8KGc2Z/AT8OuqlYD7JTR3oqrgwdjnk07wpj1twXxYmgDXgoKVWUG/fReSzHg==",
+ "license": "Apache-2.0"
},
"node_modules/lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "version": "10.4.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
"dev": true,
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- }
+ "license": "ISC"
},
"node_modules/merge2": {
"version": "1.4.1",
@@ -1561,23 +1849,25 @@
}
},
"node_modules/micromatch": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
- "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==",
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
- "braces": "^3.0.1",
- "picomatch": "^2.2.3"
+ "braces": "^3.0.3",
+ "picomatch": "^2.3.1"
},
"engines": {
"node": ">=8.6"
}
},
"node_modules/minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
"dev": true,
+ "license": "ISC",
"dependencies": {
"brace-expansion": "^1.1.7"
},
@@ -1585,6 +1875,16 @@
"node": "*"
}
},
+ "node_modules/minipass": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
+ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
"node_modules/ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -1594,7 +1894,7 @@
"node_modules/natural-compare": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true
},
"node_modules/natural-compare-lite": {
@@ -1606,24 +1906,24 @@
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"dependencies": {
"wrappy": "1"
}
},
"node_modules/optionator": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
- "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "version": "0.9.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
+ "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
"dev": true,
"dependencies": {
+ "@aashutoshrathi/word-wrap": "^1.2.3",
"deep-is": "^0.1.3",
"fast-levenshtein": "^2.0.6",
"levn": "^0.4.1",
"prelude-ls": "^1.2.1",
- "type-check": "^0.4.0",
- "word-wrap": "^1.2.3"
+ "type-check": "^0.4.0"
},
"engines": {
"node": ">= 0.8.0"
@@ -1659,11 +1959,19 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/package-json-from-dist": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
+ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
+ "dev": true,
+ "license": "BlueOak-1.0.0"
+ },
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"callsites": "^3.0.0"
},
@@ -1683,7 +1991,7 @@
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@@ -1698,6 +2006,23 @@
"node": ">=8"
}
},
+ "node_modules/path-scurry": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "lru-cache": "^10.2.0",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
@@ -1729,10 +2054,11 @@
}
},
"node_modules/punycode": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
- "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=6"
}
@@ -1757,23 +2083,12 @@
}
]
},
- "node_modules/regexpp": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
- "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
- "dev": true,
- "engines": {
- "node": ">=8"
- },
- "funding": {
- "url": "https://github.com/sponsors/mysticatea"
- }
- },
"node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=4"
}
@@ -1803,6 +2118,26 @@
"url": "https://github.com/sponsors/isaacs"
}
},
+ "node_modules/rimraf/node_modules/glob": {
+ "version": "7.2.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "dev": true,
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.1.1",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -1827,9 +2162,9 @@
}
},
"node_modules/semver": {
- "version": "7.3.8",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
- "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
@@ -1841,6 +2176,18 @@
"node": ">=10"
}
},
+ "node_modules/semver/node_modules/lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -1862,6 +2209,18 @@
"node": ">=8"
}
},
+ "node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "dev": true,
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
"node_modules/slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
@@ -1871,6 +2230,76 @@
"node": ">=8"
}
},
+ "node_modules/string-width": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "eastasianwidth": "^0.2.0",
+ "emoji-regex": "^9.2.2",
+ "strip-ansi": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/string-width-cjs": {
+ "name": "string-width",
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/string-width-cjs/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/string-width/node_modules/ansi-regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
+ "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/string-width/node_modules/strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@@ -1883,11 +2312,26 @@
"node": ">=8"
}
},
+ "node_modules/strip-ansi-cjs": {
+ "name": "strip-ansi",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true,
+ "license": "MIT",
"engines": {
"node": ">=8"
},
@@ -1910,7 +2354,7 @@
"node_modules/text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
"dev": true
},
"node_modules/to-regex-range": {
@@ -1963,6 +2407,7 @@
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
"dev": true,
+ "license": "(MIT OR CC0-1.0)",
"engines": {
"node": ">=10"
},
@@ -1971,23 +2416,31 @@
}
},
"node_modules/typescript": {
- "version": "4.7.4",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
- "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
+ "version": "5.7.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
+ "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
"dev": true,
+ "license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
- "node": ">=4.2.0"
+ "node": ">=14.17"
}
},
+ "node_modules/undici-types": {
+ "version": "5.26.5",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
+ "dev": true
+ },
"node_modules/uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
"integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
"dev": true,
+ "license": "BSD-2-Clause",
"dependencies": {
"punycode": "^2.1.0"
}
@@ -2007,19 +2460,111 @@
"node": ">= 8"
}
},
- "node_modules/word-wrap": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
- "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
+ "node_modules/wrap-ansi": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
+ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
"dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^6.1.0",
+ "string-width": "^5.0.1",
+ "strip-ansi": "^7.0.1"
+ },
"engines": {
- "node": ">=0.10.0"
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi-cjs": {
+ "name": "wrap-ansi",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/wrap-ansi-cjs/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/ansi-regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
+ "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/ansi-styles": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
+ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true
},
"node_modules/yallist": {
@@ -2042,169 +2587,211 @@
}
},
"dependencies": {
+ "@aashutoshrathi/word-wrap": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
+ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
+ "dev": true
+ },
+ "@esbuild/aix-ppc64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz",
+ "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==",
+ "dev": true,
+ "optional": true
+ },
"@esbuild/android-arm": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz",
- "integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz",
+ "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==",
"dev": true,
"optional": true
},
"@esbuild/android-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz",
- "integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz",
+ "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==",
"dev": true,
"optional": true
},
"@esbuild/android-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz",
- "integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz",
+ "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==",
"dev": true,
"optional": true
},
"@esbuild/darwin-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz",
- "integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz",
+ "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==",
"dev": true,
"optional": true
},
"@esbuild/darwin-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz",
- "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz",
+ "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==",
"dev": true,
"optional": true
},
"@esbuild/freebsd-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz",
- "integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==",
"dev": true,
"optional": true
},
"@esbuild/freebsd-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz",
- "integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz",
+ "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==",
"dev": true,
"optional": true
},
"@esbuild/linux-arm": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz",
- "integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz",
+ "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==",
"dev": true,
"optional": true
},
"@esbuild/linux-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz",
- "integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz",
+ "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==",
"dev": true,
"optional": true
},
"@esbuild/linux-ia32": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz",
- "integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz",
+ "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==",
"dev": true,
"optional": true
},
"@esbuild/linux-loong64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz",
- "integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz",
+ "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==",
"dev": true,
"optional": true
},
"@esbuild/linux-mips64el": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz",
- "integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz",
+ "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==",
"dev": true,
"optional": true
},
"@esbuild/linux-ppc64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz",
- "integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz",
+ "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==",
"dev": true,
"optional": true
},
"@esbuild/linux-riscv64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz",
- "integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz",
+ "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==",
"dev": true,
"optional": true
},
"@esbuild/linux-s390x": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz",
- "integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz",
+ "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==",
"dev": true,
"optional": true
},
"@esbuild/linux-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz",
- "integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz",
+ "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==",
+ "dev": true,
+ "optional": true
+ },
+ "@esbuild/netbsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==",
"dev": true,
"optional": true
},
"@esbuild/netbsd-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz",
- "integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz",
+ "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==",
+ "dev": true,
+ "optional": true
+ },
+ "@esbuild/openbsd-arm64": {
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz",
+ "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==",
"dev": true,
"optional": true
},
"@esbuild/openbsd-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz",
- "integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz",
+ "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==",
"dev": true,
"optional": true
},
"@esbuild/sunos-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz",
- "integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz",
+ "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==",
"dev": true,
"optional": true
},
"@esbuild/win32-arm64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz",
- "integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz",
+ "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==",
"dev": true,
"optional": true
},
"@esbuild/win32-ia32": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz",
- "integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz",
+ "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==",
"dev": true,
"optional": true
},
"@esbuild/win32-x64": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz",
- "integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==",
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz",
+ "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==",
"dev": true,
"optional": true
},
+ "@eslint-community/eslint-utils": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",
+ "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^3.3.0"
+ }
+ },
+ "@eslint-community/regexpp": {
+ "version": "4.10.0",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz",
+ "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==",
+ "dev": true
+ },
"@eslint/eslintrc": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz",
- "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==",
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
+ "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
"dev": true,
"requires": {
"ajv": "^6.12.4",
"debug": "^4.3.2",
- "espree": "^9.4.0",
+ "espree": "^9.6.0",
"globals": "^13.19.0",
"ignore": "^5.2.0",
"import-fresh": "^3.2.1",
@@ -2213,14 +2800,20 @@
"strip-json-comments": "^3.1.1"
}
},
+ "@eslint/js": {
+ "version": "8.57.1",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz",
+ "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==",
+ "dev": true
+ },
"@humanwhocodes/config-array": {
- "version": "0.11.8",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz",
- "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==",
+ "version": "0.13.0",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz",
+ "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==",
"dev": true,
"requires": {
- "@humanwhocodes/object-schema": "^1.2.1",
- "debug": "^4.1.1",
+ "@humanwhocodes/object-schema": "^2.0.3",
+ "debug": "^4.3.1",
"minimatch": "^3.0.5"
}
},
@@ -2231,11 +2824,42 @@
"dev": true
},
"@humanwhocodes/object-schema": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
- "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
+ "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
"dev": true
},
+ "@isaacs/cliui": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
+ "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
+ "dev": true,
+ "requires": {
+ "string-width": "^5.1.2",
+ "string-width-cjs": "npm:string-width@^4.2.0",
+ "strip-ansi": "^7.0.1",
+ "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
+ "wrap-ansi": "^8.1.0",
+ "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
+ "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^6.0.1"
+ }
+ }
+ }
+ },
"@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -2262,90 +2886,100 @@
"fastq": "^1.6.0"
}
},
+ "@pkgjs/parseargs": {
+ "version": "0.11.0",
+ "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
+ "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
+ "dev": true,
+ "optional": true
+ },
"@types/json-schema": {
- "version": "7.0.11",
- "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
- "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
+ "version": "7.0.14",
+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz",
+ "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==",
"dev": true
},
"@types/node": {
- "version": "18.13.0",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz",
- "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==",
- "dev": true
+ "version": "18.19.75",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.75.tgz",
+ "integrity": "sha512-UIksWtThob6ZVSyxcOqCLOUNg/dyO1Qvx4McgeuhrEtHTLFTf7BBhEazaE4K806FGTPtzd/2sE90qn4fVr7cyw==",
+ "dev": true,
+ "requires": {
+ "undici-types": "~5.26.4"
+ }
},
"@types/semver": {
- "version": "7.3.13",
- "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz",
- "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==",
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==",
"dev": true
},
"@typescript-eslint/eslint-plugin": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.51.0.tgz",
- "integrity": "sha512-wcAwhEWm1RgNd7dxD/o+nnLW8oH+6RK1OGnmbmkj/GGoDPV1WWMVP0FXYQBivKHdwM1pwii3bt//RC62EriIUQ==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz",
+ "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==",
"dev": true,
"requires": {
- "@typescript-eslint/scope-manager": "5.51.0",
- "@typescript-eslint/type-utils": "5.51.0",
- "@typescript-eslint/utils": "5.51.0",
+ "@eslint-community/regexpp": "^4.4.0",
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/type-utils": "5.62.0",
+ "@typescript-eslint/utils": "5.62.0",
"debug": "^4.3.4",
- "grapheme-splitter": "^1.0.4",
+ "graphemer": "^1.4.0",
"ignore": "^5.2.0",
"natural-compare-lite": "^1.4.0",
- "regexpp": "^3.2.0",
"semver": "^7.3.7",
"tsutils": "^3.21.0"
}
},
"@typescript-eslint/parser": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.51.0.tgz",
- "integrity": "sha512-fEV0R9gGmfpDeRzJXn+fGQKcl0inIeYobmmUWijZh9zA7bxJ8clPhV9up2ZQzATxAiFAECqPQyMDB4o4B81AaA==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz",
+ "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==",
"dev": true,
"requires": {
- "@typescript-eslint/scope-manager": "5.51.0",
- "@typescript-eslint/types": "5.51.0",
- "@typescript-eslint/typescript-estree": "5.51.0",
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/typescript-estree": "5.62.0",
"debug": "^4.3.4"
}
},
"@typescript-eslint/scope-manager": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.51.0.tgz",
- "integrity": "sha512-gNpxRdlx5qw3yaHA0SFuTjW4rxeYhpHxt491PEcKF8Z6zpq0kMhe0Tolxt0qjlojS+/wArSDlj/LtE69xUJphQ==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz",
+ "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==",
"dev": true,
"requires": {
- "@typescript-eslint/types": "5.51.0",
- "@typescript-eslint/visitor-keys": "5.51.0"
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/visitor-keys": "5.62.0"
}
},
"@typescript-eslint/type-utils": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.51.0.tgz",
- "integrity": "sha512-QHC5KKyfV8sNSyHqfNa0UbTbJ6caB8uhcx2hYcWVvJAZYJRBo5HyyZfzMdRx8nvS+GyMg56fugMzzWnojREuQQ==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz",
+ "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==",
"dev": true,
"requires": {
- "@typescript-eslint/typescript-estree": "5.51.0",
- "@typescript-eslint/utils": "5.51.0",
+ "@typescript-eslint/typescript-estree": "5.62.0",
+ "@typescript-eslint/utils": "5.62.0",
"debug": "^4.3.4",
"tsutils": "^3.21.0"
}
},
"@typescript-eslint/types": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.51.0.tgz",
- "integrity": "sha512-SqOn0ANn/v6hFn0kjvLwiDi4AzR++CBZz0NV5AnusT2/3y32jdc0G4woXPWHCumWtUXZKPAS27/9vziSsC9jnw==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz",
+ "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.51.0.tgz",
- "integrity": "sha512-TSkNupHvNRkoH9FMA3w7TazVFcBPveAAmb7Sz+kArY6sLT86PA5Vx80cKlYmd8m3Ha2SwofM1KwraF24lM9FvA==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz",
+ "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==",
"dev": true,
"requires": {
- "@typescript-eslint/types": "5.51.0",
- "@typescript-eslint/visitor-keys": "5.51.0",
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/visitor-keys": "5.62.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@@ -2354,35 +2988,41 @@
}
},
"@typescript-eslint/utils": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.51.0.tgz",
- "integrity": "sha512-76qs+5KWcaatmwtwsDJvBk4H76RJQBFe+Gext0EfJdC3Vd2kpY2Pf//OHHzHp84Ciw0/rYoGTDnIAr3uWhhJYw==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz",
+ "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==",
"dev": true,
"requires": {
+ "@eslint-community/eslint-utils": "^4.2.0",
"@types/json-schema": "^7.0.9",
"@types/semver": "^7.3.12",
- "@typescript-eslint/scope-manager": "5.51.0",
- "@typescript-eslint/types": "5.51.0",
- "@typescript-eslint/typescript-estree": "5.51.0",
+ "@typescript-eslint/scope-manager": "5.62.0",
+ "@typescript-eslint/types": "5.62.0",
+ "@typescript-eslint/typescript-estree": "5.62.0",
"eslint-scope": "^5.1.1",
- "eslint-utils": "^3.0.0",
"semver": "^7.3.7"
}
},
"@typescript-eslint/visitor-keys": {
- "version": "5.51.0",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.51.0.tgz",
- "integrity": "sha512-Oh2+eTdjHjOFjKA27sxESlA87YPSOJafGCR0md5oeMdh1ZcCfAGCIOL216uTBAkAIptvLIfKQhl7lHxMJet4GQ==",
+ "version": "5.62.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz",
+ "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==",
"dev": true,
"requires": {
- "@typescript-eslint/types": "5.51.0",
+ "@typescript-eslint/types": "5.62.0",
"eslint-visitor-keys": "^3.3.0"
}
},
+ "@ungap/structured-clone": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz",
+ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==",
+ "dev": true
+ },
"acorn": {
- "version": "8.8.2",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
- "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==",
+ "version": "8.14.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
+ "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
"dev": true
},
"acorn-jsx": {
@@ -2431,6 +3071,12 @@
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true
},
+ "as-float": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/as-float/-/as-float-1.0.1.tgz",
+ "integrity": "sha512-TsN1UpoFdtzuKXqqpdnGbFuMYnK/eqMEjd2xVvACG29H/v4KLx+UD+tHRz9v6zO+Ge/AR/uskSruBIPZrchhHw==",
+ "dev": true
+ },
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -2438,9 +3084,9 @@
"dev": true
},
"binaryen": {
- "version": "111.0.0-nightly.20230202",
- "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-111.0.0-nightly.20230202.tgz",
- "integrity": "sha512-aGMDtxmc8zQHzAamyOBvO38n2e/GuXM0dZCJg+IuG2YUQODTqI37XSkAixS8c0wXn2dgLntDMk1VDblKCsy0GA=="
+ "version": "123.0.0-nightly.20250530",
+ "resolved": "https://registry.npmjs.org/binaryen/-/binaryen-123.0.0-nightly.20250530.tgz",
+ "integrity": "sha512-d1zPHBN5YlOd3Ff+OUxvVExuFeh8heSnqe+X3bjItFxGLvn4VGBKmrvv7pgy/cRhrIUGuPW138iaWfDhwjyDqg=="
},
"brace-expansion": {
"version": "1.1.11",
@@ -2453,12 +3099,12 @@
}
},
"braces": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true,
"requires": {
- "fill-range": "^7.0.1"
+ "fill-range": "^7.1.1"
}
},
"callsites": {
@@ -2495,13 +3141,13 @@
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"dev": true
},
"cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
@@ -2525,9 +3171,9 @@
"dev": true
},
"diff": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz",
- "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==",
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz",
+ "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==",
"dev": true
},
"dir-glob": {
@@ -2548,34 +3194,49 @@
"esutils": "^2.0.2"
}
},
+ "eastasianwidth": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
+ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "9.2.2",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
+ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
+ "dev": true
+ },
"esbuild": {
- "version": "0.16.17",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz",
- "integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==",
- "dev": true,
- "requires": {
- "@esbuild/android-arm": "0.16.17",
- "@esbuild/android-arm64": "0.16.17",
- "@esbuild/android-x64": "0.16.17",
- "@esbuild/darwin-arm64": "0.16.17",
- "@esbuild/darwin-x64": "0.16.17",
- "@esbuild/freebsd-arm64": "0.16.17",
- "@esbuild/freebsd-x64": "0.16.17",
- "@esbuild/linux-arm": "0.16.17",
- "@esbuild/linux-arm64": "0.16.17",
- "@esbuild/linux-ia32": "0.16.17",
- "@esbuild/linux-loong64": "0.16.17",
- "@esbuild/linux-mips64el": "0.16.17",
- "@esbuild/linux-ppc64": "0.16.17",
- "@esbuild/linux-riscv64": "0.16.17",
- "@esbuild/linux-s390x": "0.16.17",
- "@esbuild/linux-x64": "0.16.17",
- "@esbuild/netbsd-x64": "0.16.17",
- "@esbuild/openbsd-x64": "0.16.17",
- "@esbuild/sunos-x64": "0.16.17",
- "@esbuild/win32-arm64": "0.16.17",
- "@esbuild/win32-ia32": "0.16.17",
- "@esbuild/win32-x64": "0.16.17"
+ "version": "0.25.0",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz",
+ "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==",
+ "dev": true,
+ "requires": {
+ "@esbuild/aix-ppc64": "0.25.0",
+ "@esbuild/android-arm": "0.25.0",
+ "@esbuild/android-arm64": "0.25.0",
+ "@esbuild/android-x64": "0.25.0",
+ "@esbuild/darwin-arm64": "0.25.0",
+ "@esbuild/darwin-x64": "0.25.0",
+ "@esbuild/freebsd-arm64": "0.25.0",
+ "@esbuild/freebsd-x64": "0.25.0",
+ "@esbuild/linux-arm": "0.25.0",
+ "@esbuild/linux-arm64": "0.25.0",
+ "@esbuild/linux-ia32": "0.25.0",
+ "@esbuild/linux-loong64": "0.25.0",
+ "@esbuild/linux-mips64el": "0.25.0",
+ "@esbuild/linux-ppc64": "0.25.0",
+ "@esbuild/linux-riscv64": "0.25.0",
+ "@esbuild/linux-s390x": "0.25.0",
+ "@esbuild/linux-x64": "0.25.0",
+ "@esbuild/netbsd-arm64": "0.25.0",
+ "@esbuild/netbsd-x64": "0.25.0",
+ "@esbuild/openbsd-arm64": "0.25.0",
+ "@esbuild/openbsd-x64": "0.25.0",
+ "@esbuild/sunos-x64": "0.25.0",
+ "@esbuild/win32-arm64": "0.25.0",
+ "@esbuild/win32-ia32": "0.25.0",
+ "@esbuild/win32-x64": "0.25.0"
}
},
"escape-string-regexp": {
@@ -2585,56 +3246,55 @@
"dev": true
},
"eslint": {
- "version": "8.33.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.33.0.tgz",
- "integrity": "sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==",
+ "version": "8.57.1",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz",
+ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==",
"dev": true,
"requires": {
- "@eslint/eslintrc": "^1.4.1",
- "@humanwhocodes/config-array": "^0.11.8",
+ "@eslint-community/eslint-utils": "^4.2.0",
+ "@eslint-community/regexpp": "^4.6.1",
+ "@eslint/eslintrc": "^2.1.4",
+ "@eslint/js": "8.57.1",
+ "@humanwhocodes/config-array": "^0.13.0",
"@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8",
- "ajv": "^6.10.0",
+ "@ungap/structured-clone": "^1.2.0",
+ "ajv": "^6.12.4",
"chalk": "^4.0.0",
"cross-spawn": "^7.0.2",
"debug": "^4.3.2",
"doctrine": "^3.0.0",
"escape-string-regexp": "^4.0.0",
- "eslint-scope": "^7.1.1",
- "eslint-utils": "^3.0.0",
- "eslint-visitor-keys": "^3.3.0",
- "espree": "^9.4.0",
- "esquery": "^1.4.0",
+ "eslint-scope": "^7.2.2",
+ "eslint-visitor-keys": "^3.4.3",
+ "espree": "^9.6.1",
+ "esquery": "^1.4.2",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
"file-entry-cache": "^6.0.1",
"find-up": "^5.0.0",
"glob-parent": "^6.0.2",
"globals": "^13.19.0",
- "grapheme-splitter": "^1.0.4",
+ "graphemer": "^1.4.0",
"ignore": "^5.2.0",
- "import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4",
"is-glob": "^4.0.0",
"is-path-inside": "^3.0.3",
- "js-sdsl": "^4.1.4",
"js-yaml": "^4.1.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.4.1",
"lodash.merge": "^4.6.2",
"minimatch": "^3.1.2",
"natural-compare": "^1.4.0",
- "optionator": "^0.9.1",
- "regexpp": "^3.2.0",
+ "optionator": "^0.9.3",
"strip-ansi": "^6.0.1",
- "strip-json-comments": "^3.1.0",
"text-table": "^0.2.0"
},
"dependencies": {
"eslint-scope": {
- "version": "7.1.1",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz",
- "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==",
+ "version": "7.2.2",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
+ "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==",
"dev": true,
"requires": {
"esrecurse": "^4.3.0",
@@ -2659,44 +3319,27 @@
"estraverse": "^4.1.1"
}
},
- "eslint-utils": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
- "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
- "dev": true,
- "requires": {
- "eslint-visitor-keys": "^2.0.0"
- },
- "dependencies": {
- "eslint-visitor-keys": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
- "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
- "dev": true
- }
- }
- },
"eslint-visitor-keys": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz",
- "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==",
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
"dev": true
},
"espree": {
- "version": "9.4.1",
- "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz",
- "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==",
+ "version": "9.6.1",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz",
+ "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==",
"dev": true,
"requires": {
- "acorn": "^8.8.0",
+ "acorn": "^8.9.0",
"acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^3.3.0"
+ "eslint-visitor-keys": "^3.4.1"
}
},
"esquery": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz",
- "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==",
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
+ "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
"dev": true,
"requires": {
"estraverse": "^5.1.0"
@@ -2746,9 +3389,9 @@
"dev": true
},
"fast-glob": {
- "version": "3.2.11",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz",
- "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz",
+ "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==",
"dev": true,
"requires": {
"@nodelib/fs.stat": "^2.0.2",
@@ -2778,13 +3421,13 @@
"fast-levenshtein": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
- "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
"dev": true
},
"fastq": {
- "version": "1.13.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
- "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
+ "version": "1.15.0",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz",
+ "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==",
"dev": true,
"requires": {
"reusify": "^1.0.4"
@@ -2800,9 +3443,9 @@
}
},
"fill-range": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true,
"requires": {
"to-regex-range": "^5.0.1"
@@ -2819,39 +3462,70 @@
}
},
"flat-cache": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz",
- "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==",
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz",
+ "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==",
"dev": true,
"requires": {
- "flatted": "^3.1.0",
+ "flatted": "^3.2.9",
+ "keyv": "^4.5.3",
"rimraf": "^3.0.2"
}
},
"flatted": {
- "version": "3.2.5",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz",
- "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==",
+ "version": "3.2.9",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz",
+ "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==",
"dev": true
},
+ "foreground-child": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",
+ "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^7.0.0",
+ "signal-exit": "^4.0.1"
+ }
+ },
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"dev": true
},
"glob": {
- "version": "7.2.3",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
- "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "version": "10.5.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
+ "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
"dev": true,
"requires": {
- "fs.realpath": "^1.0.0",
- "inflight": "^1.0.4",
- "inherits": "2",
- "minimatch": "^3.1.1",
- "once": "^1.3.0",
- "path-is-absolute": "^1.0.0"
+ "foreground-child": "^3.1.0",
+ "jackspeak": "^3.1.2",
+ "minimatch": "^9.0.4",
+ "minipass": "^7.1.2",
+ "package-json-from-dist": "^1.0.0",
+ "path-scurry": "^1.11.1"
+ },
+ "dependencies": {
+ "brace-expansion": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "minimatch": {
+ "version": "9.0.9",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^2.0.2"
+ }
+ }
}
},
"glob-parent": {
@@ -2864,9 +3538,9 @@
}
},
"globals": {
- "version": "13.20.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz",
- "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==",
+ "version": "13.24.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
+ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",
"dev": true,
"requires": {
"type-fest": "^0.20.2"
@@ -2886,10 +3560,10 @@
"slash": "^3.0.0"
}
},
- "grapheme-splitter": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
- "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
+ "graphemer": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
+ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
"dev": true
},
"has-flag": {
@@ -2899,15 +3573,15 @@
"dev": true
},
"ignore": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz",
- "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==",
+ "version": "5.2.4",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
+ "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==",
"dev": true
},
"import-fresh": {
- "version": "3.3.0",
- "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
- "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
"dev": true,
"requires": {
"parent-module": "^1.0.0",
@@ -2917,13 +3591,13 @@
"imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
- "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
- "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"dev": true,
"requires": {
"once": "^1.3.0",
@@ -2939,7 +3613,13 @@
"is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"is-glob": {
@@ -2966,24 +3646,34 @@
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
- "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
"dev": true
},
- "js-sdsl": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz",
- "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==",
- "dev": true
+ "jackspeak": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
+ "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
+ "dev": true,
+ "requires": {
+ "@isaacs/cliui": "^8.0.2",
+ "@pkgjs/parseargs": "^0.11.0"
+ }
},
"js-yaml": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
- "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
+ "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"dev": true,
"requires": {
"argparse": "^2.0.1"
}
},
+ "json-buffer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
+ "dev": true
+ },
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
@@ -2993,9 +3683,18 @@
"json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
"dev": true
},
+ "keyv": {
+ "version": "4.5.4",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
+ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
+ "dev": true,
+ "requires": {
+ "json-buffer": "3.0.1"
+ }
+ },
"levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
@@ -3022,18 +3721,15 @@
"dev": true
},
"long": {
- "version": "5.2.1",
- "resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
- "integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
+ "version": "5.2.4",
+ "resolved": "https://registry.npmjs.org/long/-/long-5.2.4.tgz",
+ "integrity": "sha512-qtzLbJE8hq7VabR3mISmVGtoXP8KGc2Z/AT8OuqlYD7JTR3oqrgwdjnk07wpj1twXxYmgDXgoKVWUG/fReSzHg=="
},
"lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
- "dev": true,
- "requires": {
- "yallist": "^4.0.0"
- }
+ "version": "10.4.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
+ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
+ "dev": true
},
"merge2": {
"version": "1.4.1",
@@ -3042,24 +3738,30 @@
"dev": true
},
"micromatch": {
- "version": "4.0.4",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
- "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==",
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true,
"requires": {
- "braces": "^3.0.1",
- "picomatch": "^2.2.3"
+ "braces": "^3.0.3",
+ "picomatch": "^2.3.1"
}
},
"minimatch": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
- "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
+ "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
+ "minipass": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
+ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
+ "dev": true
+ },
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -3069,7 +3771,7 @@
"natural-compare": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
- "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
"dev": true
},
"natural-compare-lite": {
@@ -3081,24 +3783,24 @@
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
- "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dev": true,
"requires": {
"wrappy": "1"
}
},
"optionator": {
- "version": "0.9.1",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz",
- "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==",
+ "version": "0.9.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz",
+ "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==",
"dev": true,
"requires": {
+ "@aashutoshrathi/word-wrap": "^1.2.3",
"deep-is": "^0.1.3",
"fast-levenshtein": "^2.0.6",
"levn": "^0.4.1",
"prelude-ls": "^1.2.1",
- "type-check": "^0.4.0",
- "word-wrap": "^1.2.3"
+ "type-check": "^0.4.0"
}
},
"p-limit": {
@@ -3119,6 +3821,12 @@
"p-limit": "^3.0.2"
}
},
+ "package-json-from-dist": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
+ "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
+ "dev": true
+ },
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@@ -3137,7 +3845,7 @@
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"dev": true
},
"path-key": {
@@ -3146,6 +3854,16 @@
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
+ "path-scurry": {
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
+ "dev": true,
+ "requires": {
+ "lru-cache": "^10.2.0",
+ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
+ }
+ },
"path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
@@ -3165,9 +3883,9 @@
"dev": true
},
"punycode": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
- "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"dev": true
},
"queue-microtask": {
@@ -3176,12 +3894,6 @@
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"dev": true
},
- "regexpp": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
- "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
- "dev": true
- },
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
@@ -3201,6 +3913,22 @@
"dev": true,
"requires": {
"glob": "^7.1.3"
+ },
+ "dependencies": {
+ "glob": {
+ "version": "7.2.3",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
+ "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.1.1",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ }
}
},
"run-parallel": {
@@ -3213,12 +3941,23 @@
}
},
"semver": {
- "version": "7.3.8",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
- "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
+ "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
+ },
+ "dependencies": {
+ "lru-cache": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
+ "requires": {
+ "yallist": "^4.0.0"
+ }
+ }
}
},
"shebang-command": {
@@ -3236,12 +3975,65 @@
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
+ "signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "dev": true
+ },
"slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
+ "string-width": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
+ "dev": true,
+ "requires": {
+ "eastasianwidth": "^0.2.0",
+ "emoji-regex": "^9.2.2",
+ "strip-ansi": "^7.0.1"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
+ "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^6.0.1"
+ }
+ }
+ }
+ },
+ "string-width-cjs": {
+ "version": "npm:string-width@4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "dependencies": {
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ }
+ }
+ },
"strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
@@ -3251,6 +4043,15 @@
"ansi-regex": "^5.0.1"
}
},
+ "strip-ansi-cjs": {
+ "version": "npm:strip-ansi@6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.1"
+ }
+ },
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
@@ -3269,7 +4070,7 @@
"text-table": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
- "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
"dev": true
},
"to-regex-range": {
@@ -3312,9 +4113,15 @@
"dev": true
},
"typescript": {
- "version": "4.7.4",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
- "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
+ "version": "5.7.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
+ "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
+ "dev": true
+ },
+ "undici-types": {
+ "version": "5.26.5",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"uri-js": {
@@ -3335,16 +4142,74 @@
"isexe": "^2.0.0"
}
},
- "word-wrap": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
- "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
- "dev": true
+ "wrap-ansi": {
+ "version": "8.1.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
+ "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^6.1.0",
+ "string-width": "^5.0.1",
+ "strip-ansi": "^7.0.1"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
+ "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
+ "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^6.0.1"
+ }
+ }
+ }
+ },
+ "wrap-ansi-cjs": {
+ "version": "npm:wrap-ansi@7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "dependencies": {
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ }
+ }
+ }
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"dev": true
},
"yallist": {
diff --git a/package.json b/package.json
index c8c9fa43bf..627dc00210 100644
--- a/package.json
+++ b/package.json
@@ -20,23 +20,24 @@
"url": "https://github.com/AssemblyScript/assemblyscript/issues"
},
"engines": {
- "node": ">=16",
- "npm": ">=7"
+ "node": ">=20",
+ "npm": ">=10"
},
"engineStrict": true,
"dependencies": {
- "binaryen": "111.0.0-nightly.20230202",
- "long": "^5.2.1"
+ "binaryen": "123.0.0-nightly.20250530",
+ "long": "^5.2.4"
},
"devDependencies": {
- "@types/node": "^18.13.0",
- "@typescript-eslint/eslint-plugin": "^5.51.0",
- "@typescript-eslint/parser": "^5.51.0",
- "diff": "^5.1.0",
- "esbuild": "^0.16.17",
- "eslint": "^8.33.0",
- "glob": "^7.2.0",
- "typescript": "~4.7.4"
+ "@types/node": "^18.19.75",
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
+ "@typescript-eslint/parser": "^5.62.0",
+ "as-float": "^1.0.1",
+ "diff": "^7.0.0",
+ "esbuild": "^0.25.0",
+ "eslint": "^8.57.1",
+ "glob": "^10.4.5",
+ "typescript": "^5.7.3"
},
"type": "module",
"exports": {
@@ -50,8 +51,8 @@
},
"./transform": {
"import": "./dist/transform.js",
- "require": "./dist/transform.cjs",
- "types": "./dist/transform.d.ts"
+ "types": "./dist/transform.d.ts",
+ "require": "./dist/transform.cjs"
},
"./binaryen": {
"import": "./lib/binaryen.js",
@@ -72,12 +73,12 @@
"scripts": {
"check": "npm run check:config && npm run check:import && npm run lint",
"check:config": "tsc --noEmit -p src --diagnostics --listFiles",
- "check:import": "tsc --noEmit --target ESNEXT --module es6 --experimentalDecorators tests/import/index",
+ "check:import": "tsc --noEmit --target ESNEXT --module nodenext --moduleResolution nodenext --experimentalDecorators tests/import/index",
"lint": "eslint --max-warnings 0 --ext js . && eslint --max-warnings 0 --ext ts .",
"build": "node scripts/build",
"watch": "node scripts/build --watch",
"coverage": "npx c8 -- npm test",
- "test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:browser && npm run test:asconfig && npm run test:transform",
+ "test": "npm run test:parser && npm run test:compiler -- --parallel && npm run test:browser && npm run test:asconfig && npm run test:transform && npm run test:cli",
"test:parser": "node --enable-source-maps tests/parser",
"test:compiler": "node --enable-source-maps --no-warnings tests/compiler",
"test:browser": "node --enable-source-maps tests/browser",
@@ -85,6 +86,7 @@
"test:transform": "npm run test:transform:esm && npm run test:transform:cjs",
"test:transform:esm": "node bin/asc tests/compiler/empty --transform ./tests/transform/index.js --noEmit && node bin/asc tests/compiler/empty --transform ./tests/transform/simple.js --noEmit",
"test:transform:cjs": "node bin/asc tests/compiler/empty --transform ./tests/transform/cjs/index.js --noEmit && node bin/asc tests/compiler/empty --transform ./tests/transform/cjs/simple.js --noEmit",
+ "test:cli": "node tests/cli/options.js",
"asbuild": "npm run asbuild:debug && npm run asbuild:release",
"asbuild:debug": "node bin/asc --config src/asconfig.json --target debug",
"asbuild:release": "node bin/asc --config src/asconfig.json --target release",
diff --git a/scripts/build-dts.js b/scripts/build-dts.js
index 00438bc4ab..0493075824 100644
--- a/scripts/build-dts.js
+++ b/scripts/build-dts.js
@@ -1,32 +1,19 @@
import fs from "fs";
-import glob from "glob";
-import os from "os";
+import { globSync } from "glob";
import pathUtil from "path";
import ts from "typescript";
-import stream from "stream";
-import util from "util";
import { fileURLToPath } from 'url';
+import { debuglog } from "util";
const __dirname = pathUtil.dirname(fileURLToPath(import.meta.url));
+const debug = debuglog("dts");
// © 2015-2019 SitePen, Inc. New BSD License.
// see: https://github.com/SitePen/dts-generator
-const generate = (function() {
+const generate = (() => {
// declare some constants so we don't have magic integers without explanation
- const DTSLEN = '.d.ts'.length;
- const filenameToMid = (function () {
- if (pathUtil.sep === '/') {
- return function (filename) {
- return filename;
- };
- }
- else {
- const separatorExpression = new RegExp(pathUtil.sep.replace('\\', '\\\\'), 'g');
- return function (filename) {
- return filename.replace(separatorExpression, '/');
- };
- }
- })();
+ const DTS = ".d.ts";
+ const DTSLEN = DTS.length;
/**
* A helper function that takes TypeScript diagnostic errors and returns an error
@@ -34,8 +21,8 @@ const generate = (function() {
* @param diagnostics The array of TypeScript Diagnostic objects
*/
function getError(diagnostics) {
- let message = 'Declaration generation failed';
- diagnostics.forEach(function (diagnostic) {
+ let message = "Declaration generation failed";
+ for (const diagnostic of diagnostics) {
// not all errors have an associated file: in particular, problems with a
// the tsconfig.json don't; the messageText is enough to diagnose in those
// cases.
@@ -44,26 +31,27 @@ const generate = (function() {
message +=
`\n${diagnostic.file.fileName}(${position.line + 1},${position.character + 1}): ` +
`error TS${diagnostic.code}: ${diagnostic.messageText}`;
- }
- else {
+ } else {
message += `\nerror TS${diagnostic.code}: ${diagnostic.messageText}`;
}
- });
+ }
+
const error = new Error(message);
- error.name = 'EmitterError';
+ error.name = "EmitterError";
return error;
}
+
function getFilenames(baseDir, files) {
return files.map(function (filename) {
const resolvedFilename = pathUtil.resolve(filename);
- if (resolvedFilename.indexOf(baseDir) === 0) {
- return resolvedFilename;
- }
- return pathUtil.resolve(baseDir, filename);
+ return resolvedFilename.indexOf(baseDir) === 0
+ ? resolvedFilename
+ : pathUtil.resolve(baseDir, filename);
});
}
+
function processTree(sourceFile, replacer) {
- let code = '';
+ let code = "";
let cursorPosition = 0;
function skip(node) {
cursorPosition = node.end;
@@ -78,8 +66,7 @@ const generate = (function() {
if (replacement != null) {
code += replacement;
skip(node);
- }
- else {
+ } else {
ts.forEachChild(node, visit);
}
}
@@ -87,6 +74,7 @@ const generate = (function() {
code += sourceFile.text.slice(cursorPosition);
return code;
}
+
/**
* Load and parse a TSConfig File
* @param options The dts-generator options to load config into
@@ -95,7 +83,7 @@ const generate = (function() {
function getTSConfig(fileName) {
// TODO this needs a better design than merging stuff into options.
// the trouble is what to do when no tsconfig is specified...
- const configText = fs.readFileSync(fileName, { encoding: 'utf8' });
+ const configText = fs.readFileSync(fileName, { encoding: "utf8" });
const result = ts.parseConfigFileTextToJson(fileName, configText);
if (result.error) {
throw getError([result.error]);
@@ -110,144 +98,95 @@ const generate = (function() {
configParseResult.options
];
}
- function isNodeKindImportDeclaration(value) {
- return value && value.kind === ts.SyntaxKind.ImportDeclaration;
- }
- function isNodeKindExternalModuleReference(value) {
- return value && value.kind === ts.SyntaxKind.ExternalModuleReference;
- }
- function isNodeKindStringLiteral(value) {
- return value && value.kind === ts.SyntaxKind.StringLiteral;
- }
- function isNodeKindExportDeclaration(value) {
- return value && value.kind === ts.SyntaxKind.ExportDeclaration;
- }
- function isNodeKindExportAssignment(value) {
- return value && value.kind === ts.SyntaxKind.ExportAssignment;
- }
- function isNodeKindModuleDeclaration(value) {
- return value && value.kind === ts.SyntaxKind.ModuleDeclaration;
- }
+
+ const isNodeKind = kind => value => value?.kind === kind;
+ const isNodeKindImportDeclaration = isNodeKind(ts.SyntaxKind.ImportDeclaration);
+ const isNodeKindStringLiteral = isNodeKind(ts.SyntaxKind.StringLiteral);
+ const isNodeKindExportDeclaration = isNodeKind(ts.SyntaxKind.ExportDeclaration);
+ const isNodeKindModuleDeclaration = isNodeKind(ts.SyntaxKind.ModuleDeclaration);
+
function generate(options) {
- if (Boolean(options.main) !== Boolean(options.name)) {
- if (options.name) {
- // since options.name used to do double duty as the prefix, let's be
- // considerate and point out that name should be replaced with prefix.
- // TODO update this error message when we finalize which version this change
- // will be released in.
- throw new Error(`name and main must be used together. Perhaps you want prefix instead of
- name? In dts-generator version 2.1, name did double duty as the option to
- use to prefix module names with, but in >=2.2 the name option was split
- into two; prefix is what is now used to prefix imports and module names
- in the output.`);
- }
- else {
- throw new Error('name and main must be used together.');
- }
- }
- const noop = function () { /* nop */ };
- const sendMessage = options.sendMessage || noop;
- const verboseMessage = options.verbose ? sendMessage : noop;
let compilerOptions = {};
let files = options.files;
/* following tsc behaviour, if a project is specified, or if no files are specified then
* attempt to load tsconfig.json */
if (options.project || !options.files || options.files.length === 0) {
- verboseMessage(`project = "${options.project || options.baseDir}"`);
+ debug(`project = "${options.project || options.baseDir}"`);
// if project isn't specified, use baseDir. If it is and it's a directory,
// assume we want tsconfig.json in that directory. If it is a file, though
// use that as our tsconfig.json. This allows for projects that have more
// than one tsconfig.json file.
let tsconfigFilename;
- if (options.project) {
- if (fs.lstatSync(options.project).isDirectory()) {
- tsconfigFilename = pathUtil.join(options.project, 'tsconfig.json');
- }
- else {
- // project isn't a diretory, it's a file
- tsconfigFilename = options.project;
- }
- }
- else {
- tsconfigFilename = pathUtil.join(options.baseDir, 'tsconfig.json');
+ if (!options.project) {
+ tsconfigFilename = pathUtil.join(options.baseDir, "tsconfig.json");
+ } else if (fs.lstatSync(options.project).isDirectory()) {
+ tsconfigFilename = pathUtil.join(options.project, "tsconfig.json");
+ } else {
+ // project isn't a directory, it's a file
+ tsconfigFilename = options.project;
}
if (fs.existsSync(tsconfigFilename)) {
- verboseMessage(` parsing "${tsconfigFilename}"`);
+ debug(` parsing "${tsconfigFilename}"`);
[files, compilerOptions] = getTSConfig(tsconfigFilename);
- }
- else {
- sendMessage(`No "tsconfig.json" found at "${tsconfigFilename}"!`);
- return new Promise(function (resolve, reject) {
- reject(new SyntaxError('Unable to resolve configuration.'));
- });
+ } else {
+ debug(`No "tsconfig.json" found at "${tsconfigFilename}"!`);
+ throw new Error("Unable to resolve configuration.");
}
}
- const eol = options.eol || os.EOL;
- const nonEmptyLineStart = new RegExp(eol + '(?!' + eol + '|$)', 'g');
- const indent = options.indent === undefined ? '\t' : options.indent;
+
+ const nonEmptyLineStart = /\n(?!\n|$)/g;
// use input values if tsconfig leaves any of these undefined.
// this is for backwards compatibility
compilerOptions.declaration = true;
- compilerOptions.target = compilerOptions.target || ts.ScriptTarget.Latest; // is this necessary?
- compilerOptions.moduleResolution = compilerOptions.moduleResolution || options.moduleResolution;
- compilerOptions.outDir = compilerOptions.outDir || options.outDir;
+ compilerOptions.target ||= ts.ScriptTarget.Latest; // is this necessary?
// TODO should compilerOptions.baseDir come into play?
const baseDir = pathUtil.resolve(compilerOptions.rootDir || options.project || options.baseDir);
const outDir = compilerOptions.outDir;
- verboseMessage(`baseDir = "${baseDir}"`);
- verboseMessage(`target = ${compilerOptions.target}`);
- verboseMessage(`outDir = ${compilerOptions.outDir}`);
- verboseMessage(`rootDir = ${compilerOptions.rootDir}`);
- verboseMessage(`moduleResolution = ${compilerOptions.moduleResolution}`);
+
+ debug(`baseDir = "${baseDir}"`);
+ debug(`target = ${compilerOptions.target}`);
+ debug(`outDir = ${compilerOptions.outDir}`);
+ debug(`rootDir = ${compilerOptions.rootDir}`);
+ debug(`moduleResolution = ${compilerOptions.moduleResolution}`);
+
const filenames = getFilenames(baseDir, files);
- verboseMessage('filenames:');
- filenames.forEach(name => { verboseMessage(' ' + name); });
- const excludesMap = {};
- options.exclude = options.exclude || ['node_modules/**/*.d.ts'];
- options.exclude && options.exclude.forEach(function (filename) {
- glob.sync(filename, { cwd: baseDir }).forEach(function (globFileName) {
- excludesMap[filenameToMid(pathUtil.resolve(baseDir, globFileName))] = true;
- });
- });
- if (options.exclude) {
- verboseMessage('exclude:');
- options.exclude.forEach(name => { verboseMessage(' ' + name); });
+
+ debug("filenames:");
+ for (const name of filenames) debug(" " + name);
+
+ const exclusions = new Set();
+
+ options.exclude ||= [];
+ options.exclude.push("node_modules/**/*.d.ts");
+
+ for (const filename of globSync(options.exclude, { cwd: baseDir })) {
+ exclusions.add(pathUtil.resolve(baseDir, filename));
}
- if (!options.stdout) fs.mkdirSync(pathUtil.dirname(options.out), { recursive: true });
- /* node.js typings are missing the optional mode in createWriteStream options and therefore
- * in TS 1.6 the strict object literal checking is throwing, therefore a hammer to the nut */
- const output = options.stdout || fs.createWriteStream(options.out, { mode: parseInt('644', 8) });
+
+ debug("exclude:");
+ for (const name of exclusions) debug(" " + name);
+
+ const output = options.stdout;
const host = ts.createCompilerHost(compilerOptions);
const program = ts.createProgram(filenames, compilerOptions, host);
function writeFile(filename, data) {
// Compiler is emitting the non-declaration file, which we do not care about
- if (filename.slice(-DTSLEN) !== '.d.ts') {
- return;
- }
+ if (filename.slice(-DTSLEN) !== DTS) return;
writeDeclaration(ts.createSourceFile(filename, data, compilerOptions.target, true), true);
}
let declaredExternalModules = [];
- return new Promise(function (resolve, reject) {
- output.on('close', () => { resolve(undefined); });
- output.on('error', reject);
+
+ {
if (options.externs) {
- options.externs.forEach(function (path) {
- sendMessage(`Writing external dependency ${path}`);
- output.write(`/// ` + eol);
- });
- }
- if (options.types) {
- options.types.forEach(function (type) {
- sendMessage(`Writing external @types package dependency ${type}`);
- output.write(`/// ` + eol);
- });
+ for (const path of options.externs) {
+ debug(`Writing external dependency ${path}`);
+ output.push(`/// \n`);
+ }
}
- sendMessage('processing:');
- let mainExportDeclaration = false;
- let mainExportAssignment = false;
- let foundMain = false;
- program.getSourceFiles().forEach(function (sourceFile) {
- processTree(sourceFile, function (node) {
+
+ debug("processing:");
+ for (const sourceFile of program.getSourceFiles()) {
+ processTree(sourceFile, node => {
if (isNodeKindModuleDeclaration(node)) {
const name = node.name;
if (isNodeKindStringLiteral(name)) {
@@ -256,64 +195,31 @@ const generate = (function() {
}
return null;
});
- });
- program.getSourceFiles().some(function (sourceFile) {
+
// Source file is a default library, or other dependency from another project, that should not be included in
// our bundled output
- if (pathUtil.normalize(sourceFile.fileName).indexOf(baseDir + pathUtil.sep) !== 0) {
- return;
- }
- if (excludesMap[filenameToMid(pathUtil.normalize(sourceFile.fileName))]) {
- return;
- }
- sendMessage(` ${sourceFile.fileName}`);
+ const normalizedFileName = pathUtil.normalize(sourceFile.fileName);
+ if (normalizedFileName.indexOf(baseDir + pathUtil.sep) !== 0) continue;
+ if (exclusions.has(normalizedFileName)) continue;
+
+ debug(` ${sourceFile.fileName}`);
// Source file is already a declaration file so should does not need to be pre-processed by the emitter
- if (sourceFile.fileName.slice(-DTSLEN) === '.d.ts') {
+ if (sourceFile.fileName.slice(-DTSLEN) === DTS) {
writeDeclaration(sourceFile, false);
- return;
- }
- // We can optionally output the main module if there's something to export.
- if (options.main && options.main === (options.prefix + filenameToMid(sourceFile.fileName.slice(baseDir.length, -3)))) {
- foundMain = true;
- ts.forEachChild(sourceFile, function (node) {
- mainExportDeclaration = mainExportDeclaration || isNodeKindExportDeclaration(node);
- mainExportAssignment = mainExportAssignment || isNodeKindExportAssignment(node);
- });
+ continue;
}
const emitOutput = program.emit(sourceFile, writeFile);
if (emitOutput.emitSkipped || emitOutput.diagnostics.length > 0) {
- reject(getError(emitOutput.diagnostics
- .concat(program.getSemanticDiagnostics(sourceFile))
- .concat(program.getSyntacticDiagnostics(sourceFile))
- .concat(program.getDeclarationDiagnostics(sourceFile))));
- return true;
- }
- });
- if (options.main && !foundMain) {
- throw new Error(`main module ${options.main} was not found`);
- }
- if (options.main) {
- output.write(`declare module '${options.name}' {` + eol + indent);
- if (compilerOptions.target >= ts.ScriptTarget.ES2015) {
- if (mainExportAssignment) {
- output.write(`export {default} from '${options.main}';` + eol + indent);
- }
- if (mainExportDeclaration) {
- output.write(`export * from '${options.main}';` + eol);
- }
+ const diagnostics = emitOutput.diagnostics.concat(
+ program.getSemanticDiagnostics(sourceFile),
+ program.getSyntacticDiagnostics(sourceFile),
+ program.getDeclarationDiagnostics(sourceFile)
+ );
+ throw getError(diagnostics);
}
- else {
- output.write(`import main = require('${options.main}');` + eol + indent);
- output.write('export = main;' + eol);
- }
- output.write('}' + eol);
- sendMessage(`Aliased main module ${options.name} to ${options.main}`);
- }
- if (!options.stdout) {
- sendMessage(`output to "${options.out}"`);
- output.end();
}
- });
+ }
+
function writeDeclaration(declarationFile, isOutput) {
// resolving is important for dealting with relative outDirs
const filename = pathUtil.resolve(declarationFile.fileName);
@@ -323,26 +229,27 @@ const generate = (function() {
// is also used for. Also if no outDir is used, the compiled code ends up
// alongside the source, so use baseDir in that case too.
const outputDir = (isOutput && Boolean(outDir)) ? pathUtil.resolve(outDir) : baseDir;
- const sourceModuleId = filenameToMid(filename.slice(outputDir.length + 1, -DTSLEN));
- const currentModuleId = filenameToMid(filename.slice(outputDir.length + 1, -DTSLEN));
+ // I give up; this needs Windows-to-POSIX conversion:
+ const sourceModuleId = pathUtil
+ .relative(outputDir, filename)
+ .slice(0, -DTSLEN)
+ .replaceAll(pathUtil.sep, "/");
function resolveModuleImport(moduleId) {
const isDeclaredExternalModule = declaredExternalModules.indexOf(moduleId) !== -1;
let resolved;
if (options.resolveModuleImport) {
resolved = options.resolveModuleImport({
importedModuleId: moduleId,
- currentModuleId: currentModuleId,
- isDeclaredExternalModule: isDeclaredExternalModule
+ currentModuleId: sourceModuleId,
+ isDeclaredExternalModule
});
}
if (!resolved) {
// resolve relative imports relative to the current module id.
- if (moduleId.charAt(0) === '.') {
- resolved = filenameToMid(pathUtil.join(pathUtil.dirname(sourceModuleId), moduleId));
- }
- else {
- resolved = moduleId;
- }
+ resolved = moduleId.charAt(0) === "."
+ ? pathUtil.posix.join(pathUtil.posix.dirname(sourceModuleId), moduleId)
+ : moduleId;
+
// prefix the import with options.prefix, so that both non-relative imports
// and relative imports end up prefixed with options.prefix. We only
// do this when no resolveModuleImport function is given so that that
@@ -350,97 +257,53 @@ const generate = (function() {
// NOTE: we may want to revisit the isDeclaredExternalModule behavior.
// discussion is on https://github.com/SitePen/dts-generator/pull/94
// but currently there's no strong argument against this behavior.
- if (Boolean(options.prefix) && !isDeclaredExternalModule) {
- resolved = `${options.prefix}/${resolved}`;
- }
+ if (!isDeclaredExternalModule) resolved = `${options.prefix}/${resolved}`;
}
return resolved;
}
/* For some reason, SourceFile.externalModuleIndicator is missing from 1.6+, so having
* to use a sledgehammer on the nut */
if (declarationFile.externalModuleIndicator) {
- let resolvedModuleId = sourceModuleId;
- if (options.resolveModuleId) {
- const resolveModuleIdResult = options.resolveModuleId({
- currentModuleId: currentModuleId
- });
- if (resolveModuleIdResult) {
- resolvedModuleId = resolveModuleIdResult;
- }
- else if (options.prefix) {
- resolvedModuleId = `${options.prefix}/${resolvedModuleId}`;
- }
- }
- else if (options.prefix) {
- resolvedModuleId = `${options.prefix}/${resolvedModuleId}`;
- }
- output.write('declare module \'' + resolvedModuleId + '\' {' + eol + indent);
- const content = processTree(declarationFile, function (node) {
- if (isNodeKindExternalModuleReference(node)) {
- // TODO figure out if this branch is possible, and if so, write a test
- // that covers it.
- const expression = node.expression;
- // convert both relative and non-relative module names in import = require(...)
- // statements.
- const resolved = resolveModuleImport(expression.text);
- return ` require('${resolved}')`;
- }
- else if (node.kind === ts.SyntaxKind.DeclareKeyword) {
- return '';
- }
- else if (isNodeKindStringLiteral(node) && node.parent &&
- (isNodeKindExportDeclaration(node.parent) || isNodeKindImportDeclaration(node.parent))) {
+ let resolvedModuleId = `${options.prefix}/${sourceModuleId}`;
+ output.push(`declare module '${resolvedModuleId}' {\n\t`);
+ const content = processTree(declarationFile, node => {
+ if (node.kind === ts.SyntaxKind.DeclareKeyword) return "";
+ if (
+ isNodeKindStringLiteral(node) &&
+ (isNodeKindExportDeclaration(node.parent) || isNodeKindImportDeclaration(node.parent))
+ ) {
// This block of code is modifying the names of imported modules
const text = node.text;
const resolved = resolveModuleImport(text);
- if (resolved) {
- return ` '${resolved}'`;
- }
+ if (resolved) return ` '${resolved}'`;
}
});
- output.write(content.replace(nonEmptyLineStart, '$&' + indent));
- output.write(eol + '}' + eol);
- }
- else {
- output.write(declarationFile.text);
+ output.push(content.replace(nonEmptyLineStart, "$&\t"));
+ output.push("\n}\n");
+ } else {
+ output.push(declarationFile.text);
}
}
}
return generate;
})();
-function OutputStream(options) {
- stream.Writable.call(this, options);
- this.chunks = [];
-}
-util.inherits(OutputStream, stream.Writable);
-OutputStream.prototype._write = function (chunk, enc, cb) {
- this.chunks.push(chunk);
- cb();
-};
-OutputStream.prototype.toBuffer = function () {
- return Buffer.concat(this.chunks);
-};
-OutputStream.prototype.toString = function () {
- return this.toBuffer().toString("utf8");
-};
-
function transformTypes(sourceFile) {
let numReplaced = 0;
- console.log("transforming:");
+ debug("transforming:");
let result = ts.transform(sourceFile, [
- function (context) {
+ context => {
const visit = node => {
node = ts.visitEachChild(node, visit, context);
if (ts.isTypeNode(node)) {
const name = node.getText(sourceFile);
switch (name) {
// this is wrong, but works
- case "bool": ++numReplaced; return ts.createIdentifier("boolean");
+ case "bool": ++numReplaced; return context.factory.createIdentifier("boolean");
default: if (!/^(?:Binaryen|Relooper)/.test(name)) break;
case "i8": case "i16": case "i32": case "isize":
case "u8": case "u16": case "u32": case "usize":
- case "f32": case "f64": ++numReplaced; return ts.createIdentifier("number");
+ case "f32": case "f64": ++numReplaced; return context.factory.createIdentifier("number");
}
}
return node;
@@ -448,14 +311,14 @@ function transformTypes(sourceFile) {
return node => ts.visitNode(node, visit);
}
]);
- console.log(" replaced " + numReplaced + " AS types with TS types");
+ debug(" replaced " + numReplaced + " AS types with TS types");
return result;
}
const prefix = "types:assemblyscript";
-function generateSrc() {
- const stdout = new OutputStream();
+export function generateSrc() {
+ const stdout = [];
generate({
project: pathUtil.resolve(__dirname, "..", "src"),
@@ -463,23 +326,19 @@ function generateSrc() {
exclude: [
"glue/**",
],
- verbose: true,
- sendMessage: console.log,
- stdout: stdout
+ stdout
});
- stdout.write("\n");
+ stdout.push("\n");
generate({
project: pathUtil.resolve(__dirname, "..", "std", "assembly", "shared"),
prefix: prefix + "/std/assembly/shared",
exclude: [],
- verbose: true,
- sendMessage: console.log,
- stdout: stdout
+ stdout
});
- stdout.write("\n");
+ stdout.push("\n");
generate({
project: pathUtil.resolve(__dirname, "..", "src", "glue"),
@@ -488,33 +347,20 @@ function generateSrc() {
"js/index.ts",
"js/node.d.ts"
],
- verbose: true,
- sendMessage: console.log,
- stdout: stdout
+ stdout
});
- const source = stdout.toString().replace(/\/\/\/ ]*>\r?\n/g, "");
+ const source = stdout.join("").replace(/\/\/\/ ]*>\r?\n/g, "");
const sourceFile = ts.createSourceFile("assemblyscript.d.ts", source, ts.ScriptTarget.ESNext, false, ts.ScriptKind.TS);
const result = transformTypes(sourceFile);
- if (!fs.existsSync(pathUtil.join(__dirname, "..", "dist"))) {
- fs.mkdirSync(pathUtil.join(__dirname, "..", "dist"));
- }
fs.writeFileSync(
pathUtil.resolve(__dirname, "..", "dist", "assemblyscript.generated.d.ts"),
ts.createPrinter().printFile(result.transformed[0])
);
- fs.writeFileSync(
- pathUtil.resolve(__dirname, "..", "dist", "assemblyscript.d.ts"),
- [ `/// \n`,
- `export * from "${prefix}/src/index";\n`,
- `import * as assemblyscript from "${prefix}/src/index";\n`,
- `export default assemblyscript;\n`
- ].join("")
- );
}
-function generateCli() {
- const stdout = new OutputStream();
+export function generateCli() {
+ const stdout = [];
generate({
baseDir: pathUtil.resolve(__dirname, ".."),
@@ -525,58 +371,23 @@ function generateCli() {
"./assemblyscript.generated.d.ts"
],
prefix,
- verbose: true,
- sendMessage: console.log,
- stdout: stdout,
+ stdout,
resolveModuleImport: ({ importedModuleId, currentModuleId }) => {
- if (currentModuleId == "cli/index") {
- if (importedModuleId == "../src") return prefix + "/src/index";
- }
+ if (currentModuleId == "cli/index" && importedModuleId == "../src")
+ return prefix + "/src/index";
+
+ if (importedModuleId == "binaryen")
+ return "binaryen";
+
return null;
},
});
- const source = stdout.toString();
+ const source = stdout.join("");
const sourceFile = ts.createSourceFile("asc.d.ts", source, ts.ScriptTarget.ESNext, false, ts.ScriptKind.TS);
const result = transformTypes(sourceFile);
- if (!fs.existsSync(pathUtil.join(__dirname, "..", "dist"))) {
- fs.mkdirSync(pathUtil.join(__dirname, "..", "dist"));
- }
fs.writeFileSync(
pathUtil.resolve(__dirname, "..", "dist", "asc.generated.d.ts"),
ts.createPrinter().printFile(result.transformed[0])
);
- fs.writeFileSync(
- pathUtil.resolve(__dirname, "..", "dist", "asc.d.ts"),
- [ `/// \n`,
- `export * from "${prefix}/cli/index";\n`,
- `import * as asc from "${prefix}/cli/index";\n`,
- `export default asc;\n`
- ].join("")
- );
}
-
-function generateTransform() {
- fs.writeFileSync(
- pathUtil.resolve(__dirname, "..", "dist", "transform.js"),
- [
- `export function Transform() { /* stub */ }\n`
- ].join("")
- );
- fs.writeFileSync(
- pathUtil.resolve(__dirname, "..", "dist", "transform.cjs"),
- [
- `module.exports = function Transform() { /* stub */ }\n`
- ].join("")
- );
- fs.writeFileSync(
- pathUtil.resolve(__dirname, "..", "dist", "transform.d.ts"),
- [
- `export { Transform } from "./asc";\n`
- ].join("")
- );
-}
-
-generateSrc();
-generateCli();
-generateTransform();
diff --git a/scripts/build-web.js b/scripts/build-web.js
index 619cc03380..fb703a7e24 100644
--- a/scripts/build-web.js
+++ b/scripts/build-web.js
@@ -1,42 +1,43 @@
-import path from "path";
+import { dirname, join } from "path";
import fs from "fs";
-import { createRequire } from "module";
import { fileURLToPath } from "url";
-const dirname = path.dirname(fileURLToPath(import.meta.url));
-const require = createRequire(import.meta.url);
-const pkg = require("../package-lock.json");
+const __dirname = dirname(fileURLToPath(import.meta.url));
-const mainVersion = pkg.version;
-const binaryenVersion = pkg.dependencies.binaryen.version;
-const longVersion = pkg.dependencies.long.version;
+export function buildWeb() {
+ const pkg = JSON.parse(fs.readFileSync(join(__dirname, "../package-lock.json")));
-const distUrl = mainVersion === "0.0.0" ? `./` : `https://cdn.jsdelivr.net/npm/assemblyscript@${mainVersion}/dist/`;
-const binaryenUrl = `https://cdn.jsdelivr.net/npm/binaryen@${binaryenVersion}/index.js`;
-const longUrl = `https://cdn.jsdelivr.net/npm/long@${longVersion}/index.js`;
-const importmap = {
- "imports": {
- "assemblyscript": `${distUrl}assemblyscript.js`,
- "assemblyscript/asc": `${distUrl}asc.js`,
- "binaryen": binaryenUrl,
- "long": longUrl
- }
-};
+ const mainVersion = pkg.version;
+ const binaryenVersion = pkg.dependencies.binaryen.version;
+ const longVersion = pkg.dependencies.long.version;
+
+ const distUrl = mainVersion === "0.0.0" ? `./` : `https://cdn.jsdelivr.net/npm/assemblyscript@${mainVersion}/dist/`;
+ const binaryenUrl = `https://cdn.jsdelivr.net/npm/binaryen@${binaryenVersion}/index.js`;
+ const longUrl = `https://cdn.jsdelivr.net/npm/long@${longVersion}/index.js`;
+ const importmap = {
+ "imports": {
+ "assemblyscript": `${distUrl}assemblyscript.js`,
+ "assemblyscript/asc": `${distUrl}asc.js`,
+ "binaryen": binaryenUrl,
+ "long": longUrl
+ }
+ };
-fs.writeFileSync(path.join(dirname, "..", "dist", "importmap.json"), `${JSON.stringify(importmap, null, 2)}
-`);
-fs.writeFileSync(path.join(dirname, "..", "dist", "web.js"), `var ASSEMBLYSCRIPT_VERSION = ${JSON.stringify(mainVersion)};
-var ASSEMBLYSCRIPT_IMPORTMAP = ${JSON.stringify(importmap, null, 2)};
-if (!document.currentScript.src.includes("noinstall")) {
- let elem = document.createElement("script");
- elem.type = "importmap";
- elem.text = JSON.stringify(ASSEMBLYSCRIPT_IMPORTMAP);
- document.head.appendChild(elem);
-}
-if (!document.currentScript.src.includes("noshim")) {
- let elem = document.createElement("script");
- elem.async = true;
- elem.src = "https://cdn.jsdelivr.net/npm/es-module-shims@1/dist/es-module-shims.wasm.min.js";
- document.head.appendChild(elem);
-}
-`);
+ fs.writeFileSync(join(__dirname, "..", "dist", "importmap.json"), `${JSON.stringify(importmap, null, 2)}
+ `);
+ fs.writeFileSync(join(__dirname, "..", "dist", "web.js"), `var ASSEMBLYSCRIPT_VERSION = ${JSON.stringify(mainVersion)};
+ var ASSEMBLYSCRIPT_IMPORTMAP = ${JSON.stringify(importmap, null, 2)};
+ if (!document.currentScript.src.includes("noinstall")) {
+ let elem = document.createElement("script");
+ elem.type = "importmap";
+ elem.text = JSON.stringify(ASSEMBLYSCRIPT_IMPORTMAP);
+ document.head.appendChild(elem);
+ }
+ if (!document.currentScript.src.includes("noshim")) {
+ let elem = document.createElement("script");
+ elem.async = true;
+ elem.src = "https://cdn.jsdelivr.net/npm/es-module-shims@1/dist/es-module-shims.wasm.min.js";
+ document.head.appendChild(elem);
+ }
+ `);
+}
\ No newline at end of file
diff --git a/scripts/build.js b/scripts/build.js
index 043933aa57..ecf0a0f0b3 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -1,12 +1,14 @@
import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
-import childProcess from "child_process";
import esbuild from "esbuild";
-import glob from "glob";
+import { globSync } from "glob";
import { createRequire } from "module";
import { stdoutColors } from "../util/terminal.js";
+import {buildWeb} from "./build-web.js";
+import * as dts from "./build-dts.js";
+
const require = createRequire(import.meta.url);
const dirname = path.dirname(fileURLToPath(import.meta.url));
const watch = process.argv[2] === "--watch";
@@ -61,7 +63,7 @@ const stdlibPlugin = {
build.onResolve({ filter: /\bindex\.generated\.js$/ }, args => {
return {
path: path.join(args.resolveDir, args.path),
- watchFiles: glob.sync(path.join(dirname, "..", "std", "assembly") + "/**/*.ts")
+ watchFiles: globSync(path.join(dirname, "..", "std", "assembly") + "/**/*.ts")
.concat([
path.join(dirname, "..", "package.json"),
path.join(dirname, "..", "cli", "options.json"),
@@ -86,7 +88,7 @@ const stdlibPlugin = {
);
const libraryDir = path.join(dirname, "..", "std", "assembly");
const libraryFiles = {};
- for (const file of glob.sync("**/!(*.d).ts", { cwd: libraryDir })) {
+ for (const file of globSync("**/!(*.d).ts", { cwd: libraryDir, posix: true }).sort()) {
libraryFiles[file.replace(/\.ts$/, "")] = bundleFile(path.join(libraryDir, file));
}
out.push(
@@ -173,22 +175,22 @@ const webPlugin = {
setup(build) {
build.onEnd(() => {
const startTime = Date.now();
- const stdout = [];
- console.log(`${time()} - ${"web"} - Starting new build ...`);
- childProcess.spawn("node", [ "./build-web.js" ], {
- cwd: dirname,
- stdio: "pipe"
- }).on("data", data => {
- stdout.push(data.toString());
- }).on("error", err => {
+ console.log(`${time()} - web - Starting new build ...`);
+
+ try {
+ buildWeb();
+
const duration = Date.now() - startTime;
- console.log(stdout.join(""));
- console.log(`${time()} - ${"web"} - ${stdoutColors.red("ERROR")} (had errors, ${duration} ms)`);
- }).on("close", code => {
- if (code) return;
+ console.log(`${time()} - web - ${stdoutColors.green("SUCCESS")} (no errors, ${duration} ms)`);
+ process.exitCode = 0;
+ } catch (e) {
const duration = Date.now() - startTime;
- console.log(`${time()} - ${"web"} - ${stdoutColors.green("SUCCESS")} (no errors, ${duration} ms)`);
- });
+ console.error(e);
+ console.log(`${time()} - web - ${stdoutColors.red("ERROR")} (had errors, ${duration} ms)`);
+ process.exitCode = 1;
+ } finally {
+ buildingDefinitions = false;
+ }
});
}
};
@@ -208,12 +210,20 @@ const common = {
bundle: true,
sourcemap: true,
treeShaking: true,
- minify: true,
- watch,
- incremental: watch
+ minify: true
};
-const srcBuild = esbuild.build({
+async function invokeBuild(options) {
+ const ctx = await esbuild.context(options);
+ if (watch) {
+ await ctx.watch();
+ } else {
+ await ctx.rebuild();
+ ctx.dispose();
+ }
+}
+
+const srcBuild = invokeBuild({
entryPoints: [ "./src/index.ts" ],
tsconfig: "./src/tsconfig.json",
outfile: "./dist/assemblyscript.js",
@@ -222,7 +232,7 @@ const srcBuild = esbuild.build({
...common
});
-const cliBuild = esbuild.build({
+const cliBuild = invokeBuild({
entryPoints: [ "./cli/index.js" ],
tsconfig: "./cli/tsconfig.json",
outfile: "./dist/asc.js",
@@ -237,25 +247,24 @@ let buildingDefinitions = false;
function buildDefinitions() {
const startTime = Date.now();
- const stdout = [];
- console.log(`${time()} - ${"dts"} - Starting new build ...`);
+ console.log(`${time()} - dts - Starting new build ...`);
buildingDefinitions = true;
- childProcess.spawn("node", [ "./build-dts.js" ], {
- cwd: dirname,
- stdio: "pipe"
- }).on("data", data => {
- stdout.push(data.toString());
- }).on("error", err => {
- buildingDefinitions = false;
+
+ try {
+ dts.generateSrc();
+ dts.generateCli();
+
const duration = Date.now() - startTime;
- console.log(stdout.join(""));
- console.log(`${time()} - ${"dts"} - ${stdoutColors.red("ERROR")} (had errors, ${duration} ms)`);
- }).on("close", code => {
- buildingDefinitions = false;
- if (code) return;
+ console.log(`${time()} - dts - ${stdoutColors.green("SUCCESS")} (no errors, ${duration} ms)`);
+ process.exitCode = 0;
+ } catch (e) {
const duration = Date.now() - startTime;
- console.log(`${time()} - ${"dts"} - ${stdoutColors.green("SUCCESS")} (no errors, ${duration} ms)`);
- });
+ console.error(e);
+ console.log(`${time()} - dts - ${stdoutColors.red("ERROR")} (had errors, ${duration} ms)`);
+ process.exitCode = 1;
+ } finally {
+ buildingDefinitions = false;
+ }
}
if (watch) {
diff --git a/src/README.md b/src/README.md
index 65eb7e260e..55c85e0fc4 100644
--- a/src/README.md
+++ b/src/README.md
@@ -46,11 +46,11 @@ Uses the AssemblyScript compiler compiled to JavaScript to compile itself to Web
Running `asc` with the WebAssembly variant:
```ts
-asc [options...] --wasm build/assemblyscript.release-bootstrap.wasm
+asc [options...] --wasm build/assemblyscript.release-bootstrap.js
```
Running the compiler tests with the WebAssembly variant:
```ts
-npm run test:compiler -- --wasm build/assemblyscript.release-bootstrap.wasm
+npm run test:compiler -- --wasm build/assemblyscript.release-bootstrap.js
```
diff --git a/src/ast.ts b/src/ast.ts
index da2271ef3d..01d8e9a421 100644
--- a/src/ast.ts
+++ b/src/ast.ts
@@ -18,7 +18,6 @@ import {
CommonFlags,
PATH_DELIMITER,
LIBRARY_PREFIX,
- LIBRARY_SUBST
} from "./common";
import {
@@ -1668,7 +1667,7 @@ export class Source extends Node {
/** Checks if this source represents native code. */
get isNative(): bool {
- return this.internalPath == LIBRARY_SUBST;
+ return this == Source._native;
}
/** Checks if this source is part of the (standard) library. */
diff --git a/src/bindings/js.ts b/src/bindings/js.ts
index c267a069cc..456b2f79ac 100644
--- a/src/bindings/js.ts
+++ b/src/bindings/js.ts
@@ -13,6 +13,11 @@ import {
CommonFlags
} from "../common";
+import {
+ runtimeFunctions,
+ runtimeGlobals
+} from "../compiler";
+
import {
ElementKind,
Element,
@@ -300,7 +305,7 @@ export class JSBuilder extends ExportsWalker {
sb.push(escapeString(name, CharCode.DoubleQuote));
sb.push("\"");
}
- if (isPlainFunction(signature, Mode.Import) && !code) {
+ if (isPlainFunction(signature, Mode.Import) && !code && isIdentifier(name)) {
sb.push(": (\n");
indent(sb, this.indentLevel + 1);
sb.push("// ");
@@ -549,18 +554,10 @@ export class JSBuilder extends ExportsWalker {
continue;
}
let resetPos = sb.length;
- sb.push(": Object.assign(Object.create(");
- if (moduleName == "env") {
- sb.push("globalThis");
- } else {
- sb.push("__module");
- sb.push(moduleId.toString());
- }
- sb.push("), ");
- if (moduleName == "env") {
- sb.push("imports.env || {}, ");
- }
- sb.push("{\n");
+
+ // Use Object.setPrototypeOf to avoid issues with read-only properties
+ // on module objects created by bundlers (issue #2659)
+ sb.push(": Object.setPrototypeOf({\n");
++this.indentLevel;
let numInstrumented = 0;
for (let _keys2 = Map_keys(module), j = 0, l = _keys2.length; j < l; ++j) {
@@ -593,7 +590,15 @@ export class JSBuilder extends ExportsWalker {
sb.push(",\n");
} else {
indent(sb, this.indentLevel);
- sb.push("}),\n");
+ sb.push("}, ");
+ if (moduleName == "env") {
+ // TODO: If necessary, use "Object.setPrototypeOf(Object.assign({}, imports.env || {}), globalThis)"
+ sb.push("Object.assign(Object.create(globalThis), imports.env || {})");
+ } else {
+ sb.push("__module");
+ sb.push(moduleId.toString());
+ }
+ sb.push("),\n");
}
}
--this.indentLevel;
@@ -945,22 +950,35 @@ export class JSBuilder extends ExportsWalker {
assert(this.indentLevel == 0);
if (this.esm) {
- sb.push("export const {\n ");
+ sb.push("export const {\n");
if (this.program.options.exportMemory) {
- sb.push("memory,\n ");
+ sb.push(" memory,\n");
}
if (this.program.options.exportTable) {
- sb.push("table,\n ");
+ sb.push(" table,\n");
+ }
+ if (this.program.options.exportRuntime) {
+ for (let i = 0, k = runtimeFunctions.length; i < k; ++i) {
+ sb.push(" ");
+ sb.push(runtimeFunctions[i]);
+ sb.push(",\n");
+ }
+ for (let i = 0, k = runtimeGlobals.length; i < k; ++i) {
+ sb.push(" ");
+ sb.push(runtimeGlobals[i]);
+ sb.push(",\n");
+ }
}
for (let i = 0, k = exports.length; i < k; ++i) {
- if (i > 0) sb.push(",\n ");
+ sb.push(" ");
sb.push(exports[i]);
+ sb.push(",\n");
}
- sb.push(`
-} = await (async url => instantiate(
+ sb.push(`} = await (async url => instantiate(
await (async () => {
- try { return await globalThis.WebAssembly.compileStreaming(globalThis.fetch(url)); }
- catch { return globalThis.WebAssembly.compile(await (await import("node:fs/promises")).readFile(url)); }
+ const isNodeOrBun = typeof process != "undefined" && process.versions != null && (process.versions.node != null || process.versions.bun != null);
+ if (isNodeOrBun) { return globalThis.WebAssembly.compile(await (await import("node:fs/promises")).readFile(url)); }
+ else { return await globalThis.WebAssembly.compileStreaming(globalThis.fetch(url)); }
})(), {
`);
let needsMaybeDefault = false;
diff --git a/src/bindings/tsd.ts b/src/bindings/tsd.ts
index a7f65bfd9d..23374fb553 100644
--- a/src/bindings/tsd.ts
+++ b/src/bindings/tsd.ts
@@ -198,6 +198,20 @@ export class TSDBuilder extends ExportsWalker {
indent(sb, this.indentLevel);
sb.push(`export ${this.esm ? "declare " : ""}const table: WebAssembly.Table;\n`);
}
+ if (this.program.options.exportRuntime) {
+ indent(sb, this.indentLevel);
+ sb.push("// Exported runtime interface\n");
+ indent(sb, this.indentLevel);
+ sb.push(`export ${this.esm ? "declare " : ""}function __new(size: number, id: number): number;\n`);
+ indent(sb, this.indentLevel);
+ sb.push(`export ${this.esm ? "declare " : ""}function __pin(ptr: number): number;\n`);
+ indent(sb, this.indentLevel);
+ sb.push(`export ${this.esm ? "declare " : ""}function __unpin(ptr: number): void;\n`);
+ indent(sb, this.indentLevel);
+ sb.push(`export ${this.esm ? "declare " : ""}function __collect(): void;\n`);
+ indent(sb, this.indentLevel);
+ sb.push(`export ${this.esm ? "declare " : ""}const __rtti_base: number;\n`);
+ }
this.walk();
if (!this.esm) {
--this.indentLevel;
diff --git a/src/builtins.ts b/src/builtins.ts
index 8b8dd638cf..f876049603 100644
--- a/src/builtins.ts
+++ b/src/builtins.ts
@@ -43,7 +43,8 @@ import {
NodeKind,
LiteralExpression,
ArrayLiteralExpression,
- IdentifierExpression
+ IdentifierExpression,
+ NamedTypeNode
} from "./ast";
import {
@@ -85,7 +86,9 @@ import {
DecoratorFlags,
Class,
PropertyPrototype,
- VariableLikeElement
+ VariableLikeElement,
+ Element,
+ OperatorKind
} from "./program";
import {
@@ -94,11 +97,13 @@ import {
} from "./flow";
import {
- ReportMode
+ ReportMode,
+ Resolver
} from "./resolver";
import {
CommonFlags,
+ CommonNames,
Feature,
featureToString,
TypeinfoFlags
@@ -143,8 +148,6 @@ export namespace BuiltinNames {
export const isManaged = "~lib/builtins/isManaged";
export const isVoid = "~lib/builtins/isVoid";
- export const bswap = "~lib/builtins/bswap";
-
export const add = "~lib/builtins/add";
export const sub = "~lib/builtins/sub";
export const mul = "~lib/builtins/mul";
@@ -193,6 +196,7 @@ export namespace BuiltinNames {
export const assert = "~lib/builtins/assert";
export const call_indirect = "~lib/builtins/call_indirect";
export const unchecked = "~lib/builtins/unchecked";
+ export const inline_always = "~lib/builtins/inline.always";
export const instantiate = "~lib/builtins/instantiate";
export const idof = "~lib/builtins/idof";
@@ -450,6 +454,17 @@ export namespace BuiltinNames {
export const v128_q15mulr_sat = "~lib/builtins/v128.q15mulr_sat";
export const v128_extmul_low = "~lib/builtins/v128.extmul_low";
export const v128_extmul_high = "~lib/builtins/v128.extmul_high";
+ export const v128_relaxed_swizzle = "~lib/builtins/v128.relaxed_swizzle";
+ export const v128_relaxed_trunc = "~lib/builtins/v128.relaxed_trunc";
+ export const v128_relaxed_trunc_zero = "~lib/builtins/v128.relaxed_trunc_zero";
+ export const v128_relaxed_madd = "~lib/builtins/v128.relaxed_madd";
+ export const v128_relaxed_nmadd = "~lib/builtins/v128.relaxed_nmadd";
+ export const v128_relaxed_laneselect = "~lib/builtins/v128.relaxed_laneselect";
+ export const v128_relaxed_min = "~lib/builtins/v128.relaxed_min";
+ export const v128_relaxed_max = "~lib/builtins/v128.relaxed_max";
+ export const v128_relaxed_q15mulr = "~lib/builtins/v128.relaxed_q15mulr";
+ export const v128_relaxed_dot = "~lib/builtins/v128.relaxed_dot";
+ export const v128_relaxed_dot_add = "~lib/builtins/v128.relaxed_dot_add";
export const i8x16 = "~lib/builtins/i8x16";
export const i16x8 = "~lib/builtins/i16x8";
@@ -544,7 +559,6 @@ export namespace BuiltinNames {
export const i16x8_extmul_high_i8x16_s = "~lib/builtins/i16x8.extmul_high_i8x16_s";
export const i16x8_extmul_high_i8x16_u = "~lib/builtins/i16x8.extmul_high_i8x16_u";
export const i16x8_shuffle = "~lib/builtins/i16x8.shuffle";
- export const i16x8_swizzle = "~lib/builtins/i16x8.swizzle";
export const i32x4_splat = "~lib/builtins/i32x4.splat";
export const i32x4_extract_lane = "~lib/builtins/i32x4.extract_lane";
@@ -589,7 +603,6 @@ export namespace BuiltinNames {
export const i32x4_extmul_high_i16x8_s = "~lib/builtins/i32x4.extmul_high_i16x8_s";
export const i32x4_extmul_high_i16x8_u = "~lib/builtins/i32x4.extmul_high_i16x8_u";
export const i32x4_shuffle = "~lib/builtins/i32x4.shuffle";
- export const i32x4_swizzle = "~lib/builtins/i32x4.swizzle";
export const i64x2_splat = "~lib/builtins/i64x2.splat";
export const i64x2_extract_lane = "~lib/builtins/i64x2.extract_lane";
@@ -623,7 +636,6 @@ export namespace BuiltinNames {
export const i64x2_extmul_high_i32x4_s = "~lib/builtins/i64x2.extmul_high_i32x4_s";
export const i64x2_extmul_high_i32x4_u = "~lib/builtins/i64x2.extmul_high_i32x4_u";
export const i64x2_shuffle = "~lib/builtins/i64x2.shuffle";
- export const i64x2_swizzle = "~lib/builtins/i64x2.swizzle";
export const f32x4_splat = "~lib/builtins/f32x4.splat";
export const f32x4_extract_lane = "~lib/builtins/f32x4.extract_lane";
@@ -653,7 +665,6 @@ export namespace BuiltinNames {
export const f32x4_convert_i32x4_u = "~lib/builtins/f32x4.convert_i32x4_u";
export const f32x4_demote_f64x2_zero = "~lib/builtins/f32x4.demote_f64x2_zero";
export const f32x4_shuffle = "~lib/builtins/f32x4.shuffle";
- export const f32x4_swizzle = "~lib/builtins/f32x4.swizzle";
export const f64x2_splat = "~lib/builtins/f64x2.splat";
export const f64x2_extract_lane = "~lib/builtins/f64x2.extract_lane";
@@ -683,7 +694,27 @@ export namespace BuiltinNames {
export const f64x2_convert_low_i32x4_u = "~lib/builtins/f64x2.convert_low_i32x4_u";
export const f64x2_promote_low_f32x4 = "~lib/builtins/f64x2.promote_low_f32x4";
export const f64x2_shuffle = "~lib/builtins/f64x2.shuffle";
- export const f64x2_swizzle = "~lib/builtins/f64x2.swizzle";
+
+ export const i8x16_relaxed_swizzle = "~lib/builtins/i8x16.relaxed_swizzle";
+ export const i32x4_relaxed_trunc_f32x4_s = "~lib/builtins/i32x4.relaxed_trunc_f32x4_s";
+ export const i32x4_relaxed_trunc_f32x4_u = "~lib/builtins/i32x4.relaxed_trunc_f32x4_u";
+ export const i32x4_relaxed_trunc_f64x2_s_zero = "~lib/builtins/i32x4.relaxed_trunc_f64x2_s_zero";
+ export const i32x4_relaxed_trunc_f64x2_u_zero = "~lib/builtins/i32x4.relaxed_trunc_f64x2_u_zero";
+ export const f32x4_relaxed_madd = "~lib/builtins/f32x4.relaxed_madd";
+ export const f32x4_relaxed_nmadd = "~lib/builtins/f32x4.relaxed_nmadd";
+ export const f64x2_relaxed_madd = "~lib/builtins/f64x2.relaxed_madd";
+ export const f64x2_relaxed_nmadd = "~lib/builtins/f64x2.relaxed_nmadd";
+ export const i8x16_relaxed_laneselect = "~lib/builtins/i8x16.relaxed_laneselect";
+ export const i16x8_relaxed_laneselect = "~lib/builtins/i16x8.relaxed_laneselect";
+ export const i32x4_relaxed_laneselect = "~lib/builtins/i32x4.relaxed_laneselect";
+ export const i64x2_relaxed_laneselect = "~lib/builtins/i64x2.relaxed_laneselect";
+ export const f32x4_relaxed_min = "~lib/builtins/f32x4.relaxed_min";
+ export const f32x4_relaxed_max = "~lib/builtins/f32x4.relaxed_max";
+ export const f64x2_relaxed_min = "~lib/builtins/f64x2.relaxed_min";
+ export const f64x2_relaxed_max = "~lib/builtins/f64x2.relaxed_max";
+ export const i16x8_relaxed_q15mulr_s = "~lib/builtins/i16x8.relaxed_q15mulr_s";
+ export const i16x8_relaxed_dot_i8x16_i7x16_s = "~lib/builtins/i16x8.relaxed_dot_i8x16_i7x16_s";
+ export const i32x4_relaxed_dot_i8x16_i7x16_add_s = "~lib/builtins/i32x4.relaxed_dot_i8x16_i7x16_add_s";
export const i31_new = "~lib/builtins/i31.new";
export const i31_get = "~lib/builtins/i31.get";
@@ -742,6 +773,17 @@ export namespace BuiltinNames {
export const Object = "~lib/object/Object";
}
+/** Builtin types context. */
+export class BuiltinTypesContext {
+ constructor(
+ public resolver: Resolver,
+ public node: NamedTypeNode,
+ public ctxElement: Element,
+ public ctxTypes: Map | null,
+ public reportMode: ReportMode
+ ) {}
+}
+
/** Builtin variable compilation context. */
export class BuiltinVariableContext {
constructor(
@@ -778,6 +820,9 @@ export class BuiltinFunctionContext {
) {}
}
+/** Builtin types map. */
+export const builtinTypes = new Map Type | null>();
+
/** Builtin functions map. */
export const builtinFunctions = new Map ExpressionRef>();
@@ -785,6 +830,142 @@ export const builtinFunctions = new Map
export const builtinVariables_onCompile = new Map void>();
export const builtinVariables_onAccess = new Map ExpressionRef>();
+// === Builtin Types ==========================================================================
+function builtin_resolveNativeType(ctx: BuiltinTypesContext): Type | null {
+ let resolver = ctx.resolver;
+ let node = ctx.node;
+ let ctxElement = ctx.ctxElement;
+ let ctxTypes = ctx.ctxTypes;
+ let reportMode = ctx.reportMode;
+ const typeArgumentNode = resolver.ensureOneTypeArgument(node, reportMode);
+ if (!typeArgumentNode) return null;
+ let typeArgument = resolver.resolveType(typeArgumentNode, null, ctxElement, ctxTypes, reportMode);
+ if (!typeArgument) return null;
+ switch (typeArgument.kind) {
+ case TypeKind.I8:
+ case TypeKind.I16:
+ case TypeKind.I32: return Type.i32;
+ case TypeKind.Isize: if (!resolver.program.options.isWasm64) return Type.i32;
+ case TypeKind.I64: return Type.i64;
+ case TypeKind.U8:
+ case TypeKind.U16:
+ case TypeKind.U32:
+ case TypeKind.Bool: return Type.u32;
+ case TypeKind.Usize: if (!resolver.program.options.isWasm64) return Type.u32;
+ case TypeKind.U64: return Type.u64;
+ case TypeKind.F32: return Type.f32;
+ case TypeKind.F64: return Type.f64;
+ case TypeKind.V128: return Type.v128;
+ case TypeKind.Void: return Type.void;
+ default: assert(false);
+ }
+ return null;
+}
+builtinTypes.set(CommonNames.native, builtin_resolveNativeType);
+
+function builtin_resolveIndexOfType(ctx: BuiltinTypesContext): Type | null {
+ let resolver = ctx.resolver;
+ let node = ctx.node;
+ let ctxElement = ctx.ctxElement;
+ let ctxTypes = ctx.ctxTypes;
+ let reportMode = ctx.reportMode;
+ const typeArgumentNode = resolver.ensureOneTypeArgument(node, reportMode);
+ if (!typeArgumentNode) return null;
+ let typeArgument = resolver.resolveType(typeArgumentNode, null, ctxElement, ctxTypes, reportMode);
+ if (!typeArgument) return null;
+ let classReference = typeArgument.classReference;
+ if (!classReference) {
+ if (reportMode == ReportMode.Report) {
+ resolver.error(
+ DiagnosticCode.Index_signature_is_missing_in_type_0,
+ typeArgumentNode.range, typeArgument.toString()
+ );
+ }
+ return null;
+ }
+ let overload = classReference.lookupOverload(OperatorKind.IndexedGet);
+ if (overload) {
+ let parameterTypes = overload.signature.parameterTypes;
+ if (overload.is(CommonFlags.Static)) {
+ assert(parameterTypes.length == 2);
+ return parameterTypes[1];
+ } else {
+ assert(parameterTypes.length == 1);
+ return parameterTypes[0];
+ }
+ }
+ if (reportMode == ReportMode.Report) {
+ resolver.error(
+ DiagnosticCode.Index_signature_is_missing_in_type_0,
+ typeArgumentNode.range, typeArgument.toString()
+ );
+ }
+ return null;
+}
+builtinTypes.set(CommonNames.indexof, builtin_resolveIndexOfType);
+
+function builtin_resolveValueOfType(ctx: BuiltinTypesContext): Type | null {
+ let resolver = ctx.resolver;
+ let node = ctx.node;
+ let ctxElement = ctx.ctxElement;
+ let ctxTypes = ctx.ctxTypes;
+ let reportMode = ctx.reportMode;
+ const typeArgumentNode = resolver.ensureOneTypeArgument(node, reportMode);
+ if (!typeArgumentNode) return null;
+ let typeArgument = resolver.resolveType(typeArgumentNode, null, ctxElement, ctxTypes, reportMode);
+ if (!typeArgument) return null;
+ let classReference = typeArgument.getClassOrWrapper(resolver.program);
+ if (classReference) {
+ let overload = classReference.lookupOverload(OperatorKind.IndexedGet);
+ if (overload) return overload.signature.returnType;
+ }
+ if (reportMode == ReportMode.Report) {
+ resolver.error(
+ DiagnosticCode.Index_signature_is_missing_in_type_0,
+ typeArgumentNode.range, typeArgument.toString()
+ );
+ }
+ return null;
+}
+builtinTypes.set(CommonNames.valueof, builtin_resolveValueOfType);
+
+function builtin_resolveReturnOfType(ctx: BuiltinTypesContext): Type | null {
+ let resolver = ctx.resolver;
+ let node = ctx.node;
+ let ctxElement = ctx.ctxElement;
+ let ctxTypes = ctx.ctxTypes;
+ let reportMode = ctx.reportMode;
+ const typeArgumentNode = resolver.ensureOneTypeArgument(node, reportMode);
+ if (!typeArgumentNode) return null;
+ let typeArgument = resolver.resolveType(typeArgumentNode, null, ctxElement, ctxTypes, reportMode);
+ if (!typeArgument) return null;
+ let signatureReference = typeArgument.getSignature();
+ if (signatureReference) return signatureReference.returnType;
+ if (reportMode == ReportMode.Report) {
+ resolver.error(
+ DiagnosticCode.Type_0_has_no_call_signatures,
+ typeArgumentNode.range, typeArgument.toString()
+ );
+ }
+ return null;
+}
+builtinTypes.set(CommonNames.returnof, builtin_resolveReturnOfType);
+
+function builtin_resolveNonnullableType(ctx: BuiltinTypesContext): Type | null {
+ let resolver = ctx.resolver;
+ let node = ctx.node;
+ let ctxElement = ctx.ctxElement;
+ let ctxTypes = ctx.ctxTypes;
+ let reportMode = ctx.reportMode;
+ const typeArgumentNode = resolver.ensureOneTypeArgument(node, reportMode);
+ if (!typeArgumentNode) return null;
+ let typeArgument = resolver.resolveType(typeArgumentNode, null, ctxElement, ctxTypes, reportMode);
+ if (!typeArgument) return null;
+ if (!typeArgument.isNullableReference) return typeArgument;
+ return typeArgument.nonNullableType;
+}
+builtinTypes.set(CommonNames.nonnull, builtin_resolveNonnullableType);
+
// === Static type evaluation =================================================================
// helper global used by checkConstantType
@@ -1166,181 +1347,6 @@ function builtin_idof(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.idof, builtin_idof);
-// bswap(value: T) -> T
-function builtin_bswap(ctx: BuiltinFunctionContext): ExpressionRef {
- let compiler = ctx.compiler;
- let module = compiler.module;
- if (
- checkTypeOptional(ctx, true) |
- checkArgsRequired(ctx, 1)
- ) return module.unreachable();
-
- let typeArguments = ctx.typeArguments;
- let arg0 = typeArguments
- ? compiler.compileExpression(
- ctx.operands[0],
- typeArguments[0].toUnsigned(),
- Constraints.ConvImplicit | Constraints.MustWrap
- )
- : compiler.compileExpression(
- ctx.operands[0],
- Type.u32,
- Constraints.MustWrap
- );
-
- let type = compiler.currentType;
- if (type.isValue) {
- switch (type.kind) {
- case TypeKind.Bool:
- case TypeKind.I8:
- case TypeKind.U8: return arg0;
- case TypeKind.I16:
- case TypeKind.U16: {
- // (x << 8 | x >> 8)
- let flow = compiler.currentFlow;
- let temp = flow.getTempLocal(type);
- flow.setLocalFlag(temp.index, LocalFlags.Wrapped);
-
- let res = module.binary(
- BinaryOp.OrI32,
- module.binary(
- BinaryOp.ShlI32,
- module.local_tee(temp.index, arg0, false),
- module.i32(8)
- ),
- module.binary(
- BinaryOp.ShrU32,
- module.local_get(temp.index, TypeRef.I32),
- module.i32(8)
- )
- );
- // avoid wrapping for u16 due to it's already done for input arg
- if (type.kind == TypeKind.I16) {
- res = compiler.ensureSmallIntegerWrap(res, Type.i16);
- }
- return res;
- }
- case TypeKind.I32:
- case TypeKind.U32:
- case TypeKind.Isize:
- case TypeKind.Usize: {
- if (type.size == 32) {
- // rotl(x & 0xFF00FF00, 8) | rotr(x & 0x00FF00FF, 8)
- let flow = compiler.currentFlow;
- let temp = flow.getTempLocal(type);
- flow.setLocalFlag(temp.index, LocalFlags.Wrapped);
-
- let res = module.binary(
- BinaryOp.OrI32,
- module.binary(
- BinaryOp.RotlI32,
- module.binary(
- BinaryOp.AndI32,
- module.local_tee(temp.index, arg0, false),
- module.i32(0xFF00FF00)
- ),
- module.i32(8)
- ),
- module.binary(
- BinaryOp.RotrI32,
- module.binary(
- BinaryOp.AndI32,
- module.local_get(temp.index, TypeRef.I32),
- module.i32(0x00FF00FF)
- ),
- module.i32(8)
- ),
- );
- return res;
- }
- // fall-through
- }
- case TypeKind.I64:
- case TypeKind.U64: {
- // let t =
- // ((x >>> 8) & 0x00FF00FF00FF00FF) |
- // ((x & 0x00FF00FF00FF00FF) << 8)
- //
- // let res =
- // ((t >>> 16) & 0x0000FFFF0000FFFF) |
- // ((t & 0x0000FFFF0000FFFF) << 16)
- //
- // rotr(res, 32)
-
- let flow = compiler.currentFlow;
- let temp1 = flow.getTempLocal(type);
- flow.setLocalFlag(temp1.index, LocalFlags.Wrapped);
- let temp2 = flow.getTempLocal(type);
- flow.setLocalFlag(temp2.index, LocalFlags.Wrapped);
-
- // t = ((x >>> 8) & 0x00FF00FF00FF00FF) | ((x & 0x00FF00FF00FF00FF) << 8)
- let expr = module.local_tee(
- temp2.index,
- module.binary(
- BinaryOp.OrI64,
- module.binary(
- BinaryOp.AndI64,
- module.binary(
- BinaryOp.ShrU64,
- module.local_tee(temp1.index, arg0, false),
- module.i64(8)
- ),
- module.i64(0x00FF00FF, 0x00FF00FF)
- ),
- module.binary(
- BinaryOp.ShlI64,
- module.binary(
- BinaryOp.AndI64,
- module.local_get(temp1.index, TypeRef.I64),
- module.i64(0x00FF00FF, 0x00FF00FF)
- ),
- module.i64(8)
- ),
- ),
- false
- );
-
- // ((t >>> 16) & 0x0000FFFF0000FFFF) | ((t & 0x0000FFFF0000FFFF) << 16)
- let res = module.binary(
- BinaryOp.OrI64,
- module.binary(
- BinaryOp.AndI64,
- module.binary(
- BinaryOp.ShrU64,
- expr,
- module.i64(16)
- ),
- module.i64(0x0000FFFF, 0x0000FFFF)
- ),
- module.binary(
- BinaryOp.ShlI64,
- module.binary(
- BinaryOp.AndI64,
- module.local_get(temp2.index, TypeRef.I64),
- module.i64(0x0000FFFF, 0x0000FFFF)
- ),
- module.i64(16)
- ),
- );
-
- // rotr(res, 32)
- res = module.binary(
- BinaryOp.RotrI64,
- res,
- module.i64(32)
- );
- return res;
- }
- }
- }
- compiler.error(
- DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
- ctx.reportNode.typeArgumentsRange, "bswap", type.toString()
- );
- return module.unreachable();
-}
-builtinFunctions.set(BuiltinNames.bswap, builtin_bswap);
-
// === Math ===================================================================================
// NaN
@@ -1773,6 +1779,7 @@ function builtin_max(ctx: BuiltinFunctionContext): ExpressionRef {
} else {
arg1 = compiler.compileExpression(operands[1], type, Constraints.ConvImplicit | Constraints.MustWrap);
}
+ // @ts-expect-error
let op: BinaryOp = -1;
switch (type.kind) {
case TypeKind.I8:
@@ -1802,8 +1809,7 @@ function builtin_max(ctx: BuiltinFunctionContext): ExpressionRef {
module.binary(op,
module.local_get(temp1.index, typeRef),
module.local_get(temp2.index, typeRef)
- ),
- typeRef
+ )
);
return ret;
}
@@ -1841,6 +1847,7 @@ function builtin_min(ctx: BuiltinFunctionContext): ExpressionRef {
} else {
arg1 = compiler.compileExpression(operands[1], type, Constraints.ConvImplicit | Constraints.MustWrap);
}
+ // @ts-expect-error
let op: BinaryOp = -1;
switch (type.kind) {
case TypeKind.I8:
@@ -1870,8 +1877,7 @@ function builtin_min(ctx: BuiltinFunctionContext): ExpressionRef {
module.binary(op,
module.local_get(temp1.index, typeRef),
module.local_get(temp2.index, typeRef)
- ),
- typeRef
+ )
);
return ret;
}
@@ -3280,7 +3286,7 @@ function builtin_select(ctx: BuiltinFunctionContext): ExpressionRef {
operands[2]
);
compiler.currentType = type;
- return module.select(arg0, arg1, arg2, type.toRef());
+ return module.select(arg0, arg1, arg2);
}
builtinFunctions.set(BuiltinNames.select, builtin_select);
@@ -3496,7 +3502,7 @@ function builtin_i31_new(ctx: BuiltinFunctionContext): ExpressionRef {
) return module.unreachable();
let operands = ctx.operands;
let arg0 = compiler.compileExpression(operands[0], Type.i32, Constraints.ConvImplicit);
- compiler.currentType = Type.i31ref;
+ compiler.currentType = Type.i31;
return module.i31_new(arg0);
}
builtinFunctions.set(BuiltinNames.i31_new, builtin_i31_new);
@@ -3509,7 +3515,7 @@ function builtin_i31_get(ctx: BuiltinFunctionContext): ExpressionRef {
checkArgsRequired(ctx, 1)
) return module.unreachable();
let operands = ctx.operands;
- let arg0 = compiler.compileExpression(operands[0], Type.i31ref, Constraints.ConvImplicit);
+ let arg0 = compiler.compileExpression(operands[0], Type.i31.asNullable(), Constraints.ConvImplicit);
if (ctx.contextualType.is(TypeFlags.Unsigned)) {
compiler.currentType = Type.u32;
return module.i31_get(arg0, false);
@@ -3626,14 +3632,14 @@ function builtin_assert(ctx: BuiltinFunctionContext): ExpressionRef {
// TODO: also check for NaN in float assertions, as in `Boolean(NaN) -> false`?
case TypeKind.F32: return module.if(module.binary(BinaryOp.EqF32, arg0, module.f32(0)), abort);
case TypeKind.F64: return module.if(module.binary(BinaryOp.EqF64, arg0, module.f64(0)), abort);
- case TypeKind.Funcref:
- case TypeKind.Externref:
- case TypeKind.Anyref:
- case TypeKind.Eqref:
- case TypeKind.Structref:
- case TypeKind.Arrayref:
- case TypeKind.I31ref:
- case TypeKind.Stringref:
+ case TypeKind.Func:
+ case TypeKind.Extern:
+ case TypeKind.Any:
+ case TypeKind.Eq:
+ case TypeKind.Struct:
+ case TypeKind.Array:
+ case TypeKind.I31:
+ case TypeKind.String:
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter: return module.if(module.ref_is_null(arg0), abort);
@@ -3707,14 +3713,14 @@ function builtin_assert(ctx: BuiltinFunctionContext): ExpressionRef {
);
return ret;
}
- case TypeKind.Funcref:
- case TypeKind.Externref:
- case TypeKind.Anyref:
- case TypeKind.Eqref:
- case TypeKind.Structref:
- case TypeKind.Arrayref:
- case TypeKind.I31ref:
- case TypeKind.Stringref:
+ case TypeKind.Func:
+ case TypeKind.Extern:
+ case TypeKind.Any:
+ case TypeKind.Eq:
+ case TypeKind.Struct:
+ case TypeKind.Array:
+ case TypeKind.I31:
+ case TypeKind.String:
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter: {
@@ -3759,6 +3765,24 @@ function builtin_unchecked(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.unchecked, builtin_unchecked);
+// inline.always(expr: *) -> *
+function builtin_inline_always(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkTypeAbsent(ctx) |
+ checkArgsRequired(ctx, 1)
+ ) return module.unreachable();
+ let flow = compiler.currentFlow;
+ let alreadyInline = flow.is(FlowFlags.InlineContext);
+ if (!alreadyInline) flow.set(FlowFlags.InlineContext);
+ // eliminate unnecessary tees by preferring contextualType(=void)
+ let expr = compiler.compileExpression(ctx.operands[0], ctx.contextualType);
+ if (!alreadyInline) flow.unset(FlowFlags.InlineContext);
+ return expr;
+}
+builtinFunctions.set(BuiltinNames.inline_always, builtin_inline_always);
+
// call_indirect(index: u32, ...args: *[]) -> T
function builtin_call_indirect(ctx: BuiltinFunctionContext): ExpressionRef {
let compiler = ctx.compiler;
@@ -3782,6 +3806,9 @@ function builtin_call_indirect(ctx: BuiltinFunctionContext): ExpressionRef {
let paramTypeRefs = new Array(numOperands);
for (let i = 0; i < numOperands; ++i) {
operandExprs[i] = compiler.compileExpression(operands[1 + i], Type.auto);
+ if (compiler.currentType.isManaged) {
+ operandExprs[i] = module.tostack(operandExprs[i]);
+ }
paramTypeRefs[i] = compiler.currentType.toRef();
}
compiler.currentType = returnType;
@@ -4889,7 +4916,7 @@ function builtin_v128_load_lane(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.v128_load_lane, builtin_v128_load_lane);
-// v128.store_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize) -> v128
+// v128.store_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize) -> void
function builtin_v128_store_lane(ctx: BuiltinFunctionContext): ExpressionRef {
let compiler = ctx.compiler;
let module = compiler.module;
@@ -4931,7 +4958,7 @@ function builtin_v128_store_lane(ctx: BuiltinFunctionContext): ExpressionRef {
}
}
}
- compiler.currentType = Type.v128;
+ compiler.currentType = Type.void;
if (type.isValue) {
let maxIdx = (16 / assert(type.byteSize)) - 1;
if (idx < 0 || idx > maxIdx) {
@@ -6346,7 +6373,8 @@ function builtin_v128_not(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.v128_not, builtin_v128_not);
-function builtin_v128_bitwise_ternary(ctx: BuiltinFunctionContext, op: SIMDTernaryOp): ExpressionRef {
+// v128.bitselect(v1: v128, v2: v128, c: v128) -> v128
+function builtin_v128_bitselect(ctx: BuiltinFunctionContext): ExpressionRef {
let compiler = ctx.compiler;
let module = compiler.module;
if (
@@ -6361,12 +6389,7 @@ function builtin_v128_bitwise_ternary(ctx: BuiltinFunctionContext, op: SIMDTerna
let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
let arg2 = compiler.compileExpression(operands[2], Type.v128, Constraints.ConvImplicit);
- return module.simd_ternary(op, arg0, arg1, arg2);
-}
-
-// v128.bitselect(v1: v128, v2: v128, c: v128) -> v128
-function builtin_v128_bitselect(ctx: BuiltinFunctionContext): ExpressionRef {
- return builtin_v128_bitwise_ternary(ctx, SIMDTernaryOp.Bitselect);
+ return module.simd_ternary(SIMDTernaryOp.Bitselect, arg0, arg1, arg2);
}
builtinFunctions.set(BuiltinNames.v128_bitselect, builtin_v128_bitselect);
@@ -6701,83 +6724,445 @@ function builtin_v128_extmul_high(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.v128_extmul_high, builtin_v128_extmul_high);
-// === Internal runtime =======================================================================
+// === Relaxed SIMD ===========================================================================
-// __visit_globals(cookie: u32) -> void
-function builtin_visit_globals(ctx: BuiltinFunctionContext): ExpressionRef {
+// v128.relaxed_swizzle(a: v128, s: v128) -> v128
+function builtin_v128_relaxed_swizzle(ctx: BuiltinFunctionContext): ExpressionRef {
let compiler = ctx.compiler;
let module = compiler.module;
if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
checkTypeAbsent(ctx) |
- checkArgsRequired(ctx, 1) // cookie
+ checkArgsRequired(ctx, 2)
) {
- compiler.currentType = Type.void;
+ compiler.currentType = Type.v128;
return module.unreachable();
}
let operands = ctx.operands;
- let arg0 = compiler.compileExpression(operands[0], Type.u32, Constraints.ConvImplicit);
- compiler.runtimeFeatures |= RuntimeFeatures.visitGlobals;
- compiler.currentType = Type.void;
- return module.call(BuiltinNames.visit_globals, [ arg0 ], TypeRef.None);
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ return module.binary(BinaryOp.RelaxedSwizzleI8x16, arg0, arg1);
}
-builtinFunctions.set(BuiltinNames.visit_globals, builtin_visit_globals);
+builtinFunctions.set(BuiltinNames.v128_relaxed_swizzle, builtin_v128_relaxed_swizzle);
-// __visit_members(ref: usize, cookie: u32) -> void
-function builtin_visit_members(ctx: BuiltinFunctionContext): ExpressionRef {
+// v128.relaxed_trunc(a: v128) -> v128
+function builtin_v128_relaxed_trunc(ctx: BuiltinFunctionContext): ExpressionRef {
let compiler = ctx.compiler;
let module = compiler.module;
if (
- checkTypeAbsent(ctx) |
- checkArgsRequired(ctx, 2) // ref, cookie
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkTypeRequired(ctx) |
+ checkArgsRequired(ctx, 1)
) {
- compiler.currentType = Type.void;
+ compiler.currentType = Type.v128;
return module.unreachable();
}
let operands = ctx.operands;
- let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, Constraints.ConvImplicit);
- let arg1 = compiler.compileExpression(operands[1], Type.u32, Constraints.ConvImplicit);
- compiler.runtimeFeatures |= RuntimeFeatures.visitMembers;
- compiler.currentType = Type.void;
- return module.call(BuiltinNames.visit_members, [ arg0, arg1 ], TypeRef.None);
-}
-builtinFunctions.set(BuiltinNames.visit_members, builtin_visit_members);
-
-// === Inline assembler =======================================================================
-
-// TODO: Operators can't be just deferred (don't have a corresponding generic built-in)
-// add, sub, mul, div_s, div_u, rem_s, rem_u
-// and, or, xor, shl, shr_u, shr_s
-// eq, eqz, ne, lt_s, lt_u, le_s, le_u, gt_s, gt_u, ge_s, ge_u
-
-// i32.clz -> clz
-function builtin_i32_clz(ctx: BuiltinFunctionContext): ExpressionRef {
- checkTypeAbsent(ctx);
- ctx.typeArguments = [ Type.i32 ];
- ctx.contextualType = Type.i32;
- return builtin_clz(ctx);
-}
-builtinFunctions.set(BuiltinNames.i32_clz, builtin_i32_clz);
-
-// i64.clz -> clz
-function builtin_i64_clz(ctx: BuiltinFunctionContext): ExpressionRef {
- checkTypeAbsent(ctx);
- ctx.typeArguments = [ Type.i64 ];
- ctx.contextualType = Type.i64;
- return builtin_clz(ctx);
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ if (type.isValue) {
+ switch (type.kind) {
+ case TypeKind.Isize: {
+ if (compiler.options.isWasm64) break;
+ // fall-through
+ }
+ case TypeKind.I32: return module.unary(UnaryOp.RelaxedTruncF32x4ToI32x4, arg0);
+ case TypeKind.Usize: {
+ if (compiler.options.isWasm64) break;
+ // fall-through
+ }
+ case TypeKind.U32: return module.unary(UnaryOp.RelaxedTruncF32x4ToU32x4, arg0);
+ }
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_trunc", type.toString()
+ );
+ return module.unreachable();
}
-builtinFunctions.set(BuiltinNames.i64_clz, builtin_i64_clz);
+builtinFunctions.set(BuiltinNames.v128_relaxed_trunc, builtin_v128_relaxed_trunc);
-// i32.ctz -> ctz
-function builtin_i32_ctz(ctx: BuiltinFunctionContext): ExpressionRef {
- checkTypeAbsent(ctx);
- ctx.typeArguments = [ Type.i32 ];
- ctx.contextualType = Type.i32;
- return builtin_ctz(ctx);
+// v128.relaxed_trunc_zero(a: v128) -> v128
+function builtin_v128_relaxed_trunc_zero(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkTypeRequired(ctx) |
+ checkArgsRequired(ctx, 1)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ if (type.isValue) {
+ switch (type.kind) {
+ case TypeKind.Isize: {
+ if (compiler.options.isWasm64) break;
+ // fall-through
+ }
+ case TypeKind.I32: return module.unary(UnaryOp.RelaxedTruncF64x2ToI32x4Zero, arg0);
+ case TypeKind.Usize: {
+ if (compiler.options.isWasm64) break;
+ // fall-through
+ }
+ case TypeKind.U32: return module.unary(UnaryOp.RelaxedTruncF64x2ToU32x4Zero, arg0);
+ }
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_trunc_zero", type.toString()
+ );
+ return module.unreachable();
}
-builtinFunctions.set(BuiltinNames.i32_ctz, builtin_i32_ctz);
+builtinFunctions.set(BuiltinNames.v128_relaxed_trunc_zero, builtin_v128_relaxed_trunc_zero);
-// i64.ctz -> ctz
-function builtin_i64_ctz(ctx: BuiltinFunctionContext): ExpressionRef {
+// v128.relaxed_madd(a: v128, b: v128, c: v128) -> v128
+function builtin_v128_relaxed_madd(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkTypeRequired(ctx) |
+ checkArgsRequired(ctx, 3)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ let arg2 = compiler.compileExpression(operands[2], Type.v128, Constraints.ConvImplicit);
+ if (type.isValue) {
+ switch (type.kind) {
+ case TypeKind.F32: return module.simd_ternary(SIMDTernaryOp.RelaxedMaddF32x4, arg0, arg1, arg2);
+ case TypeKind.F64: return module.simd_ternary(SIMDTernaryOp.RelaxedMaddF64x2, arg0, arg1, arg2);
+ }
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_madd", type.toString()
+ );
+ return module.unreachable();
+}
+builtinFunctions.set(BuiltinNames.v128_relaxed_madd, builtin_v128_relaxed_madd);
+
+// v128.relaxed_nmadd(a: v128, b: v128, c: v128) -> v128
+function builtin_v128_relaxed_nmadd(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkTypeRequired(ctx) |
+ checkArgsRequired(ctx, 3)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ let arg2 = compiler.compileExpression(operands[2], Type.v128, Constraints.ConvImplicit);
+ if (type.isValue) {
+ switch (type.kind) {
+ case TypeKind.F32: return module.simd_ternary(SIMDTernaryOp.RelaxedNmaddF32x4, arg0, arg1, arg2);
+ case TypeKind.F64: return module.simd_ternary(SIMDTernaryOp.RelaxedNmaddF64x2, arg0, arg1, arg2);
+ }
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_nmadd", type.toString()
+ );
+ return module.unreachable();
+}
+builtinFunctions.set(BuiltinNames.v128_relaxed_nmadd, builtin_v128_relaxed_nmadd);
+
+// v128.relaxed_laneselect(a: v128, b: v128, m: v128) -> v128
+function builtin_v128_relaxed_laneselect(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkTypeRequired(ctx) |
+ checkArgsRequired(ctx, 3)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ let arg2 = compiler.compileExpression(operands[2], Type.v128, Constraints.ConvImplicit);
+ if (type.isValue) {
+ switch (type.kind) {
+ case TypeKind.I8:
+ case TypeKind.U8: return module.simd_ternary(SIMDTernaryOp.RelaxedLaneselectI8x16, arg0, arg1, arg2);
+ case TypeKind.I16:
+ case TypeKind.U16: return module.simd_ternary(SIMDTernaryOp.RelaxedLaneselectI16x8, arg0, arg1, arg2);
+ case TypeKind.I32:
+ case TypeKind.U32: return module.simd_ternary(SIMDTernaryOp.RelaxedLaneselectI32x4, arg0, arg1, arg2);
+ case TypeKind.I64:
+ case TypeKind.U64: return module.simd_ternary(SIMDTernaryOp.RelaxedLaneselectI64x2, arg0, arg1, arg2);
+ case TypeKind.Isize:
+ case TypeKind.Usize: {
+ return module.simd_ternary(
+ compiler.options.isWasm64
+ ? SIMDTernaryOp.RelaxedLaneselectI64x2
+ : SIMDTernaryOp.RelaxedLaneselectI32x4,
+ arg0, arg1, arg2
+ );
+ }
+ }
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_laneselect", type.toString()
+ );
+ return module.unreachable();
+}
+builtinFunctions.set(BuiltinNames.v128_relaxed_laneselect, builtin_v128_relaxed_laneselect);
+
+// v128.relaxed_min(a: v128, b: v128) -> v128
+function builtin_v128_relaxed_min(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkTypeRequired(ctx) |
+ checkArgsRequired(ctx, 2)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ if (type.isValue) {
+ switch (type.kind) {
+ case TypeKind.F32: return module.binary(BinaryOp.RelaxedMinF32x4, arg0, arg1);
+ case TypeKind.F64: return module.binary(BinaryOp.RelaxedMinF64x2, arg0, arg1);
+ }
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_min", type.toString()
+ );
+ return module.unreachable();
+}
+builtinFunctions.set(BuiltinNames.v128_relaxed_min, builtin_v128_relaxed_min);
+
+// v128.relaxed_max(a: v128, b: v128) -> v128
+function builtin_v128_relaxed_max(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkTypeRequired(ctx) |
+ checkArgsRequired(ctx, 2)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ if (type.isValue) {
+ switch (type.kind) {
+ case TypeKind.F32: return module.binary(BinaryOp.RelaxedMaxF32x4, arg0, arg1);
+ case TypeKind.F64: return module.binary(BinaryOp.RelaxedMaxF64x2, arg0, arg1);
+ }
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_max", type.toString()
+ );
+ return module.unreachable();
+}
+builtinFunctions.set(BuiltinNames.v128_relaxed_max, builtin_v128_relaxed_max);
+
+// v128.relaxed_q15mulr(a: v128, b: v128) -> v128
+function builtin_v128_relaxed_q15mulr(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkTypeRequired(ctx) |
+ checkArgsRequired(ctx, 2)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ if (type.isValue) {
+ switch (type.kind) {
+ case TypeKind.I16: return module.binary(BinaryOp.RelaxedQ15MulrI16x8, arg0, arg1);
+ }
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_q15mulr", type.toString()
+ );
+ return module.unreachable();
+}
+builtinFunctions.set(BuiltinNames.v128_relaxed_q15mulr, builtin_v128_relaxed_q15mulr);
+
+// v128.relaxed_dot(a: v128, b: v128) -> v128
+function builtin_v128_relaxed_dot(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkArgsRequired(ctx, 2) |
+ checkTypeRequired(ctx)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ switch (type.kind) {
+ case TypeKind.I16: return module.binary(BinaryOp.RelaxedDotI8x16I7x16ToI16x8, arg0, arg1);
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_dot", type.toString()
+ );
+ return module.unreachable();
+}
+builtinFunctions.set(BuiltinNames.v128_relaxed_dot, builtin_v128_relaxed_dot);
+
+// v128.relaxed_dot_add(a: v128, b: v128, c: v128) -> v128
+function builtin_v128_relaxed_dot_add(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkFeatureEnabled(ctx, Feature.RelaxedSimd) |
+ checkArgsRequired(ctx, 3) |
+ checkTypeRequired(ctx)
+ ) {
+ compiler.currentType = Type.v128;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let typeArguments = ctx.typeArguments!;
+ let type = typeArguments[0];
+ let arg0 = compiler.compileExpression(operands[0], Type.v128, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.v128, Constraints.ConvImplicit);
+ let arg2 = compiler.compileExpression(operands[2], Type.v128, Constraints.ConvImplicit);
+ switch (type.kind) {
+ // TOOD: emulate relaxed_dot_add of i16 with multiple instructions?
+ case TypeKind.Isize: {
+ if (compiler.options.isWasm64) break;
+ // fall-through
+ }
+ case TypeKind.I32: return module.simd_ternary(SIMDTernaryOp.RelaxedDotI8x16I7x16AddToI32x4, arg0, arg1, arg2);
+ }
+ compiler.error(
+ DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
+ ctx.reportNode.typeArgumentsRange, "v128.relaxed_dot_add", type.toString()
+ );
+ return module.unreachable();
+}
+builtinFunctions.set(BuiltinNames.v128_relaxed_dot_add, builtin_v128_relaxed_dot_add);
+
+// === Internal runtime =======================================================================
+
+// __visit_globals(cookie: u32) -> void
+function builtin_visit_globals(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkTypeAbsent(ctx) |
+ checkArgsRequired(ctx, 1) // cookie
+ ) {
+ compiler.currentType = Type.void;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let arg0 = compiler.compileExpression(operands[0], Type.u32, Constraints.ConvImplicit);
+ compiler.runtimeFeatures |= RuntimeFeatures.visitGlobals;
+ compiler.currentType = Type.void;
+ return module.call(BuiltinNames.visit_globals, [ arg0 ], TypeRef.None);
+}
+builtinFunctions.set(BuiltinNames.visit_globals, builtin_visit_globals);
+
+// __visit_members(ref: usize, cookie: u32) -> void
+function builtin_visit_members(ctx: BuiltinFunctionContext): ExpressionRef {
+ let compiler = ctx.compiler;
+ let module = compiler.module;
+ if (
+ checkTypeAbsent(ctx) |
+ checkArgsRequired(ctx, 2) // ref, cookie
+ ) {
+ compiler.currentType = Type.void;
+ return module.unreachable();
+ }
+ let operands = ctx.operands;
+ let arg0 = compiler.compileExpression(operands[0], compiler.options.usizeType, Constraints.ConvImplicit);
+ let arg1 = compiler.compileExpression(operands[1], Type.u32, Constraints.ConvImplicit);
+ compiler.runtimeFeatures |= RuntimeFeatures.visitMembers;
+ compiler.currentType = Type.void;
+ return module.call(BuiltinNames.visit_members, [ arg0, arg1 ], TypeRef.None);
+}
+builtinFunctions.set(BuiltinNames.visit_members, builtin_visit_members);
+
+// === Inline assembler =======================================================================
+
+// TODO: Operators can't be just deferred (don't have a corresponding generic built-in)
+// add, sub, mul, div_s, div_u, rem_s, rem_u
+// and, or, xor, shl, shr_u, shr_s
+// eq, eqz, ne, lt_s, lt_u, le_s, le_u, gt_s, gt_u, ge_s, ge_u
+
+// i32.clz -> clz
+function builtin_i32_clz(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i32 ];
+ ctx.contextualType = Type.i32;
+ return builtin_clz(ctx);
+}
+builtinFunctions.set(BuiltinNames.i32_clz, builtin_i32_clz);
+
+// i64.clz -> clz
+function builtin_i64_clz(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i64 ];
+ ctx.contextualType = Type.i64;
+ return builtin_clz(ctx);
+}
+builtinFunctions.set(BuiltinNames.i64_clz, builtin_i64_clz);
+
+// i32.ctz -> ctz
+function builtin_i32_ctz(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i32 ];
+ ctx.contextualType = Type.i32;
+ return builtin_ctz(ctx);
+}
+builtinFunctions.set(BuiltinNames.i32_ctz, builtin_i32_ctz);
+
+// i64.ctz -> ctz
+function builtin_i64_ctz(ctx: BuiltinFunctionContext): ExpressionRef {
checkTypeAbsent(ctx);
ctx.typeArguments = [ Type.i64 ];
ctx.contextualType = Type.i64;
@@ -8688,6 +9073,7 @@ builtinFunctions.set(BuiltinNames.i8x16_shuffle, builtin_i8x16_shuffle);
// i8x16.swizzle -> v128.swizzle
function builtin_i8x16_swizzle(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
ctx.typeArguments = null;
ctx.contextualType = Type.v128;
return builtin_v128_swizzle(ctx);
@@ -9117,14 +9503,6 @@ function builtin_i16x8_shuffle(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.i16x8_shuffle, builtin_i16x8_shuffle);
-// i16x8.swizzle -> v128.swizzle
-function builtin_i16x8_swizzle(ctx: BuiltinFunctionContext): ExpressionRef {
- ctx.typeArguments = null;
- ctx.contextualType = Type.v128;
- return builtin_v128_swizzle(ctx);
-}
-builtinFunctions.set(BuiltinNames.i16x8_swizzle, builtin_i16x8_swizzle);
-
// i32x4.splat -> v128.splat
function builtin_i32x4_splat(ctx: BuiltinFunctionContext): ExpressionRef {
checkTypeAbsent(ctx);
@@ -9512,14 +9890,6 @@ function builtin_i32x4_shuffle(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.i32x4_shuffle, builtin_i32x4_shuffle);
-// i32x4.swizzle -> v128.swizzle
-function builtin_i32x4_swizzle(ctx: BuiltinFunctionContext): ExpressionRef {
- ctx.typeArguments = null;
- ctx.contextualType = Type.v128;
- return builtin_v128_swizzle(ctx);
-}
-builtinFunctions.set(BuiltinNames.i32x4_swizzle, builtin_i32x4_swizzle);
-
// i64x2.splat -> v128.splat
function builtin_i64x2_splat(ctx: BuiltinFunctionContext): ExpressionRef {
checkTypeAbsent(ctx);
@@ -9772,14 +10142,6 @@ function builtin_i64x2_shuffle(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.i64x2_shuffle, builtin_i64x2_shuffle);
-// i64x2.swizzle -> v128.swizzle
-function builtin_i64x2_swizzle(ctx: BuiltinFunctionContext): ExpressionRef {
- ctx.typeArguments = null;
- ctx.contextualType = Type.v128;
- return builtin_v128_swizzle(ctx);
-}
-builtinFunctions.set(BuiltinNames.i64x2_swizzle, builtin_i64x2_swizzle);
-
// f32x4.splat -> v128.splat
function builtin_f32x4_splat(ctx: BuiltinFunctionContext): ExpressionRef {
checkTypeAbsent(ctx);
@@ -10032,14 +10394,6 @@ function builtin_f32x4_shuffle(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.f32x4_shuffle, builtin_f32x4_shuffle);
-// f32x4.swizzle -> v128.swizzle
-function builtin_f32x4_swizzle(ctx: BuiltinFunctionContext): ExpressionRef {
- ctx.typeArguments = null;
- ctx.contextualType = Type.v128;
- return builtin_v128_swizzle(ctx);
-}
-builtinFunctions.set(BuiltinNames.f32x4_swizzle, builtin_f32x4_swizzle);
-
// f64x2.splat -> v128.splat
function builtin_f64x2_splat(ctx: BuiltinFunctionContext): ExpressionRef {
checkTypeAbsent(ctx);
@@ -10292,13 +10646,185 @@ function builtin_f64x2_shuffle(ctx: BuiltinFunctionContext): ExpressionRef {
}
builtinFunctions.set(BuiltinNames.f64x2_shuffle, builtin_f64x2_shuffle);
-// f64x2.swizzle -> v128.swizzle
-function builtin_f64x2_swizzle(ctx: BuiltinFunctionContext): ExpressionRef {
+// i8x16.relaxed_swizzle -> v128.relaxed_swizzle
+function builtin_i8x16_relaxed_swizzle(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
ctx.typeArguments = null;
ctx.contextualType = Type.v128;
- return builtin_v128_swizzle(ctx);
+ return builtin_v128_relaxed_swizzle(ctx);
+}
+builtinFunctions.set(BuiltinNames.i8x16_relaxed_swizzle, builtin_i8x16_relaxed_swizzle);
+
+// i32x4.relaxed_trunc_f32x4_s -> v128.relaxed_trunc
+function builtin_i32x4_relaxed_trunc_f32x4_s(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_trunc(ctx);
}
-builtinFunctions.set(BuiltinNames.f64x2_swizzle, builtin_f64x2_swizzle);
+builtinFunctions.set(BuiltinNames.i32x4_relaxed_trunc_f32x4_s, builtin_i32x4_relaxed_trunc_f32x4_s);
+
+// i32x4.relaxed_trunc_f32x4_u -> v128.relaxed_trunc
+function builtin_i32x4_relaxed_trunc_f32x4_u(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.u32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_trunc(ctx);
+}
+builtinFunctions.set(BuiltinNames.i32x4_relaxed_trunc_f32x4_u, builtin_i32x4_relaxed_trunc_f32x4_u);
+
+// i32x4.relaxed_trunc_f64x2_s_zero -> v128.relaxed_trunc_zero
+function builtin_i32x4_relaxed_trunc_f64x2_s_zero(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_trunc_zero(ctx);
+}
+builtinFunctions.set(BuiltinNames.i32x4_relaxed_trunc_f64x2_s_zero, builtin_i32x4_relaxed_trunc_f64x2_s_zero);
+
+// i32x4.relaxed_trunc_f64x2_u_zero -> v128.relaxed_trunc_zero
+function builtin_i32x4_relaxed_trunc_f64x2_u_zero(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.u32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_trunc_zero(ctx);
+}
+builtinFunctions.set(BuiltinNames.i32x4_relaxed_trunc_f64x2_u_zero, builtin_i32x4_relaxed_trunc_f64x2_u_zero);
+
+// f32x4.relaxed_madd -> v128.relaxed_madd
+function builtin_f32x4_relaxed_madd(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.f32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_madd(ctx);
+}
+builtinFunctions.set(BuiltinNames.f32x4_relaxed_madd, builtin_f32x4_relaxed_madd);
+
+// f32x4.relaxed_nmadd -> v128.relaxed_nmadd
+function builtin_f32x4_relaxed_nmadd(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.f32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_nmadd(ctx);
+}
+builtinFunctions.set(BuiltinNames.f32x4_relaxed_nmadd, builtin_f32x4_relaxed_nmadd);
+
+// f64x2.relaxed_madd -> v128.relaxed_madd
+function builtin_f64x2_relaxed_madd(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.f64 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_madd(ctx);
+}
+builtinFunctions.set(BuiltinNames.f64x2_relaxed_madd, builtin_f64x2_relaxed_madd);
+
+// f64x2.relaxed_nmadd -> v128.relaxed_nmadd
+function builtin_f64x2_relaxed_nmadd(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.f64 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_nmadd(ctx);
+}
+builtinFunctions.set(BuiltinNames.f64x2_relaxed_nmadd, builtin_f64x2_relaxed_nmadd);
+
+// i8x16.relaxed_laneselect -> v128.relaxed_laneselect
+function builtin_i8x16_relaxed_laneselect(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i8 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_laneselect(ctx);
+}
+builtinFunctions.set(BuiltinNames.i8x16_relaxed_laneselect, builtin_i8x16_relaxed_laneselect);
+
+// i16x8.relaxed_laneselect -> v128.relaxed_laneselect
+function builtin_i16x8_relaxed_laneselect(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i16 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_laneselect(ctx);
+}
+builtinFunctions.set(BuiltinNames.i16x8_relaxed_laneselect, builtin_i16x8_relaxed_laneselect);
+
+// i32x4.relaxed_laneselect -> v128.relaxed_laneselect
+function builtin_i32x4_relaxed_laneselect(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_laneselect(ctx);
+}
+builtinFunctions.set(BuiltinNames.i32x4_relaxed_laneselect, builtin_i32x4_relaxed_laneselect);
+
+// i64x2.relaxed_laneselect -> v128.relaxed_laneselect
+function builtin_i64x2_relaxed_laneselect(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i64 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_laneselect(ctx);
+}
+builtinFunctions.set(BuiltinNames.i64x2_relaxed_laneselect, builtin_i64x2_relaxed_laneselect);
+
+// f32x4.relaxed_min -> v128.relaxed_min
+function builtin_f32x4_relaxed_min(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.f32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_min(ctx);
+}
+builtinFunctions.set(BuiltinNames.f32x4_relaxed_min, builtin_f32x4_relaxed_min);
+
+// f32x4.relaxed_max -> v128.relaxed_max
+function builtin_f32x4_relaxed_max(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.f32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_max(ctx);
+}
+builtinFunctions.set(BuiltinNames.f32x4_relaxed_max, builtin_f32x4_relaxed_max);
+
+// f64x2.relaxed_min -> v128.relaxed_min
+function builtin_f64x2_relaxed_min(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.f64 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_min(ctx);
+}
+builtinFunctions.set(BuiltinNames.f64x2_relaxed_min, builtin_f64x2_relaxed_min);
+
+// f64x2.relaxed_max -> v128.relaxed_max
+function builtin_f64x2_relaxed_max(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.f64 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_max(ctx);
+}
+builtinFunctions.set(BuiltinNames.f64x2_relaxed_max, builtin_f64x2_relaxed_max);
+
+// i16x8.relaxed_q15mulr_s -> v128.relaxed_q15mulr
+function builtin_i16x8_relaxed_q15mulr_s(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i16 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_q15mulr(ctx);
+}
+builtinFunctions.set(BuiltinNames.i16x8_relaxed_q15mulr_s, builtin_i16x8_relaxed_q15mulr_s);
+
+// i16x8.relaxed_dot_i8x16_i7x16_s -> v128.relaxed_dot
+function builtin_i16x8_relaxed_dot_i8x16_i7x16_s(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i16 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_dot(ctx);
+}
+builtinFunctions.set(BuiltinNames.i16x8_relaxed_dot_i8x16_i7x16_s, builtin_i16x8_relaxed_dot_i8x16_i7x16_s);
+
+// i32x4.relaxed_dot_i8x16_i7x16_add_s -> v128.relaxed_dot_add
+function builtin_i32x4_relaxed_dot_i8x16_i7x16_add_s(ctx: BuiltinFunctionContext): ExpressionRef {
+ checkTypeAbsent(ctx);
+ ctx.typeArguments = [ Type.i32 ];
+ ctx.contextualType = Type.v128;
+ return builtin_v128_relaxed_dot_add(ctx);
+}
+builtinFunctions.set(BuiltinNames.i32x4_relaxed_dot_i8x16_i7x16_add_s, builtin_i32x4_relaxed_dot_i8x16_i7x16_add_s);
// === Internal helpers =======================================================================
@@ -10437,20 +10963,14 @@ function ensureVisitMembersOf(compiler: Compiler, instance: Class): void {
assert(fieldOffset >= 0);
needsTempValue = true;
body.push(
- // if ($2 = value) __visit($2, $1)
- module.if(
- module.local_tee(2,
- module.load(sizeTypeSize, false,
- module.local_get(0, sizeTypeRef),
- sizeTypeRef, fieldOffset
- ),
- false // internal
- ),
- module.call(visitInstance.internalName, [
- module.local_get(2, sizeTypeRef), // value
- module.local_get(1, TypeRef.I32) // cookie
- ], TypeRef.None)
- )
+ // __visit(load($this, fieldOffset), $cookie)
+ module.call(visitInstance.internalName, [
+ module.load(sizeTypeSize, false,
+ module.local_get(0, sizeTypeRef),
+ sizeTypeRef, fieldOffset
+ ), // value
+ module.local_get(1, TypeRef.I32) // cookie
+ ], TypeRef.None)
);
}
}
diff --git a/src/common.ts b/src/common.ts
index 8e03684d05..3cc25a0845 100644
--- a/src/common.ts
+++ b/src/common.ts
@@ -81,7 +81,9 @@ export const enum CommonFlags {
// Other
/** Is quoted. */
- Quoted = 1 << 30
+ Quoted = 1 << 30,
+ /** Is internally nullable. */
+ InternallyNullable = 1 << 31
}
/** Path delimiter inserted between file system levels. */
@@ -126,17 +128,17 @@ export namespace CommonNames {
export const f32 = "f32";
export const f64 = "f64";
export const v128 = "v128";
- export const funcref = "funcref";
- export const externref = "externref";
- export const anyref = "anyref";
- export const eqref = "eqref";
- export const structref = "structref";
- export const arrayref = "arrayref";
- export const i31ref = "i31ref";
- export const stringref = "stringref";
- export const stringview_wtf8 = "stringview_wtf8";
- export const stringview_wtf16 = "stringview_wtf16";
- export const stringview_iter = "stringview_iter";
+ export const ref_func = "ref_func";
+ export const ref_extern = "ref_extern";
+ export const ref_any = "ref_any";
+ export const ref_eq = "ref_eq";
+ export const ref_struct = "ref_struct";
+ export const ref_array = "ref_array";
+ export const ref_i31 = "ref_i31";
+ export const ref_string = "ref_string";
+ export const ref_stringview_wtf8 = "ref_stringview_wtf8";
+ export const ref_stringview_wtf16 = "ref_stringview_wtf16";
+ export const ref_stringview_iter = "ref_stringview_iter";
export const i8x16 = "i8x16";
export const u8x16 = "u8x16";
export const i16x8 = "i16x8";
@@ -192,6 +194,8 @@ export namespace CommonNames {
export const ASC_VERSION_MAJOR = "ASC_VERSION_MAJOR";
export const ASC_VERSION_MINOR = "ASC_VERSION_MINOR";
export const ASC_VERSION_PATCH = "ASC_VERSION_PATCH";
+ // enums
+ export const EnumToString = "__enum_to_string";
// classes
export const I8 = "I8";
export const I16 = "I16";
@@ -207,13 +211,14 @@ export namespace CommonNames {
export const F32 = "F32";
export const F64 = "F64";
export const V128 = "V128";
- export const Funcref = "Funcref";
- export const Externref = "Externref";
- export const Anyref = "Anyref";
- export const Eqref = "Eqref";
- export const Structref = "Structref";
- export const Arrayref = "Arrayref";
- export const I31ref = "I31ref";
+ export const RefFunc = "RefFunc";
+ export const RefExtern = "RefExtern";
+ export const RefAny = "RefAny";
+ export const RefEq = "RefEq";
+ export const RefStruct = "RefStruct";
+ export const RefArray = "RefArray";
+ export const RefI31 = "RefI31";
+ export const RefString = "RefString";
export const String = "String";
export const RegExp = "RegExp";
export const Object = "Object";
diff --git a/src/compiler.ts b/src/compiler.ts
index 25e094503a..36f09ab8aa 100644
--- a/src/compiler.ts
+++ b/src/compiler.ts
@@ -48,18 +48,17 @@ import {
getBlockChildCount,
getBlockChildAt,
getBlockName,
- getLocalSetValue,
getGlobalGetName,
isGlobalMutable,
getSideEffects,
SideEffects,
SwitchBuilder,
ExpressionRunnerFlags,
- isConstZero,
isConstNegZero,
isConstExpressionNaN,
ensureType,
- createType
+ createType,
+ getConstValueInteger
} from "./module";
import {
@@ -93,7 +92,8 @@ import {
PropertyPrototype,
IndexSignature,
File,
- mangleInternalName
+ mangleInternalName,
+ TypeDefinition
} from "./program";
import {
@@ -180,7 +180,9 @@ import {
findDecorator,
isTypeOmitted,
- Source
+ Source,
+ TypeDeclaration,
+ ParameterKind
} from "./ast";
import {
@@ -221,6 +223,12 @@ import {
lowerRequiresExportRuntime
} from "./bindings/js";
+/** Features enabled by default. */
+export const defaultFeatures = Feature.MutableGlobals
+ | Feature.SignExtension
+ | Feature.NontrappingF2I
+ | Feature.BulkMemory;
+
/** Compiler options. */
export class Options {
constructor() { /* as internref */ }
@@ -261,11 +269,8 @@ export class Options {
tableBase: u32 = 0;
/** Global aliases, mapping alias names as the key to internal names to be aliased as the value. */
globalAliases: Map | null = null;
- /** Features to activate by default. These are the finished proposals. */
- features: Feature = Feature.MutableGlobals
- | Feature.SignExtension
- | Feature.NontrappingF2I
- | Feature.BulkMemory;
+ /** Features to activate by default. */
+ features: Feature = defaultFeatures;
/** If true, disallows unsafe features in user code. */
noUnsafe: bool = false;
/** If true, enables pedantic diagnostics. */
@@ -317,6 +322,27 @@ export class Options {
return this.optimizeLevelHint > 0 || this.shrinkLevelHint > 0;
}
+ /** Sets whether a feature is enabled. */
+ setFeature(feature: Feature, on: bool = true): void {
+ if (on) {
+ // Enabling Stringref also enables GC
+ if (feature & Feature.Stringref) feature |= Feature.GC;
+ // Enabling GC also enables Reference Types
+ if (feature & Feature.GC) feature |= Feature.ReferenceTypes;
+ // Enabling Relaxed SIMD also enables SIMD
+ if (feature & Feature.RelaxedSimd) feature |= Feature.Simd;
+ this.features |= feature;
+ } else {
+ // Disabling Reference Types also disables GC
+ if (feature & Feature.ReferenceTypes) feature |= Feature.GC;
+ // Disabling GC also disables Stringref
+ if (feature & Feature.GC) feature |= Feature.Stringref;
+ // Disabling SIMD also disables Relaxed SIMD
+ if (feature & Feature.Simd) feature |= Feature.RelaxedSimd;
+ this.features &= ~feature;
+ }
+ }
+
/** Tests if a specific feature is activated. */
hasFeature(feature: Feature): bool {
return (this.features & feature) != 0;
@@ -394,9 +420,9 @@ export namespace ExportNames {
}
/** Functions to export if `--exportRuntime` is set. */
-const runtimeFunctions = [ "__new", "__pin", "__unpin", "__collect" ];
+export const runtimeFunctions = [ "__new", "__pin", "__unpin", "__collect" ];
/** Globals to export if `--exportRuntime` is set. */
-const runtimeGlobals = [ "__rtti_base" ];
+export const runtimeGlobals = [ "__rtti_base" ];
/** Compiler interface. */
export class Compiler extends DiagnosticEmitter {
@@ -424,6 +450,8 @@ export class Compiler extends DiagnosticEmitter {
memorySegments: MemorySegment[] = [];
/** Map of already compiled static string segments. */
stringSegments: Map = new Map();
+ /** Set of static GC object offsets. tostack is unnecessary for them. */
+ staticGcObjectOffsets: Map> = new Map();
/** Function table being compiled. First elem is blank. */
functionTable: Function[] = [];
/** Arguments length helper global. */
@@ -509,6 +537,12 @@ export class Compiler extends DiagnosticEmitter {
// initialize lookup maps, built-ins, imports, exports, etc.
this.program.initialize();
+
+ // Binaryen treats all function references as being leaked to the outside world when
+ // the module isn't marked as closed-world (see WebAssembly/binaryen#7135). Therefore,
+ // we should mark the module as closed-world when we're definitely sure it is.
+ module.setClosedWorld(true);
+
// obtain the main start function
let startFunctionInstance = this.currentFlow.targetFunction;
assert(startFunctionInstance.internalName == BuiltinNames.start);
@@ -830,6 +864,7 @@ export class Compiler extends DiagnosticEmitter {
ImportNames.DefaultNamespace,
ImportNames.Table
);
+ module.setClosedWorld(false);
if (options.pedantic && options.willOptimize) {
this.pedantic(
DiagnosticCode.Importing_the_table_disables_some_indirect_call_optimizations,
@@ -839,6 +874,7 @@ export class Compiler extends DiagnosticEmitter {
}
if (options.exportTable) {
module.addTableExport(CommonNames.DefaultTable, ExportNames.Table);
+ module.setClosedWorld(false);
if (options.pedantic && options.willOptimize) {
this.pedantic(
DiagnosticCode.Exporting_the_table_disables_some_indirect_call_optimizations,
@@ -950,6 +986,7 @@ export class Compiler extends DiagnosticEmitter {
}
}
}
+ if (functionInstance.signature.returnType.kind == TypeKind.Func) this.module.setClosedWorld(false);
}
return;
}
@@ -980,6 +1017,7 @@ export class Compiler extends DiagnosticEmitter {
this.desiresExportRuntime = true;
}
}
+ if (global.type.kind == TypeKind.Func) this.module.setClosedWorld(false);
}
if (global.type == Type.v128) {
this.warning(
@@ -1132,7 +1170,7 @@ export class Compiler extends DiagnosticEmitter {
// Resolve type if annotated
if (typeNode) {
- let resolvedType = this.resolver.resolveType(typeNode, global.parent); // reports
+ let resolvedType = this.resolver.resolveType(typeNode, null, global.parent); // reports
if (!resolvedType) {
global.set(CommonFlags.Errored);
pendingElements.delete(global);
@@ -1357,7 +1395,14 @@ export class Compiler extends DiagnosticEmitter {
findDecorator(DecoratorKind.Inline, global.decoratorNodes)!.range, "inline"
);
}
- module.addGlobal(internalName, typeRef, true, this.makeZero(type));
+ let internalType = type;
+ if (type.isExternalReference && !type.is(TypeFlags.Nullable)) {
+ // There is no default value for non-nullable external references, so
+ // make the global nullable internally and use `null`.
+ global.set(CommonFlags.InternallyNullable);
+ internalType = type.asNullable();
+ }
+ module.addGlobal(internalName, internalType.toRef(), true, this.makeZero(internalType));
this.currentBody.push(
module.global_set(internalName, initExpr)
);
@@ -1477,6 +1522,49 @@ export class Compiler extends DiagnosticEmitter {
return true;
}
+ private ensureEnumToString(enumElement: Enum, reportNode: Node): string | null {
+ if (enumElement.toStringFunctionName) return enumElement.toStringFunctionName;
+
+ if (!this.compileEnum(enumElement)) return null;
+ if (enumElement.is(CommonFlags.Const)) {
+ this.errorRelated(
+ DiagnosticCode.A_const_enum_member_can_only_be_accessed_using_a_string_literal,
+ reportNode.range, enumElement.identifierNode.range
+ );
+ return null;
+ }
+
+ let members = enumElement.members;
+ if (!members) return null;
+
+ let module = this.module;
+ const isInline = enumElement.hasDecorator(DecoratorFlags.Inline);
+
+ const functionName = `${enumElement.internalName}#${CommonNames.EnumToString}`;
+ enumElement.toStringFunctionName = functionName;
+
+ let exprs = new Array();
+ // when the values are the same, TS returns the last enum value name that appears
+ for (let _keys = Map_keys(members), _values = Map_values(members), i = 1, k = _keys.length; i <= k; ++i) {
+ let enumValueName = unchecked(_keys[k - i]);
+ let member = unchecked(_values[k - i]);
+ if (member.kind != ElementKind.EnumValue) continue;
+ let enumValue = member;
+ const enumValueExpr = isInline
+ ? module.i32(i64_low(enumValue.constantIntegerValue))
+ : module.global_get(enumValue.internalName, TypeRef.I32);
+ let expr = module.if(
+ module.binary(BinaryOp.EqI32, enumValueExpr, module.local_get(0, TypeRef.I32)),
+ module.return(this.ensureStaticString(enumValueName))
+ );
+ exprs.push(expr);
+ }
+ exprs.push(module.unreachable());
+ module.addFunction(functionName, TypeRef.I32, TypeRef.I32, null, module.block(null, exprs, TypeRef.I32));
+
+ return functionName;
+ }
+
// === Functions ================================================================================
/** Compiles a priorly resolved function. */
@@ -1757,7 +1845,7 @@ export class Compiler extends DiagnosticEmitter {
// Implicitly return `this` if the flow falls through
if (!flow.is(FlowFlags.Terminates)) {
stmts.push(
- module.local_get(thisLocal.index, this.options.sizeTypeRef)
+ module.local_get(thisLocal.index, thisLocal.type.toRef())
);
flow.set(FlowFlags.Returns | FlowFlags.ReturnsNonNull | FlowFlags.Terminates);
}
@@ -1895,7 +1983,16 @@ export class Compiler extends DiagnosticEmitter {
stringSegment = this.addRuntimeMemorySegment(buf);
segments.set(stringValue, stringSegment);
}
- return i64_add(stringSegment.offset, i64_new(totalOverhead));
+ let stringOffset = i64_add(stringSegment.offset, i64_new(totalOverhead));
+ let staticGcObjectOffsets = this.staticGcObjectOffsets;
+ if (staticGcObjectOffsets.has(i64_high(stringOffset))) {
+ assert(staticGcObjectOffsets.get(i64_high(stringOffset))).add(i64_low(stringOffset));
+ } else {
+ let s = new Set();
+ s.add(i64_low(stringOffset));
+ staticGcObjectOffsets.set(i64_high(stringOffset), s);
+ }
+ return stringOffset;
}
/** Writes a series of static values of the specified type to a buffer. */
@@ -2207,13 +2304,7 @@ export class Compiler extends DiagnosticEmitter {
break;
}
case NodeKind.TypeDeclaration: {
- // TODO: integrate inner type declaration into flow
- this.error(
- DiagnosticCode.Not_implemented_0,
- statement.range,
- "Inner type alias"
- );
- stmt = module.unreachable();
+ stmt = this.compileTypeDeclaration(statement);
break;
}
case NodeKind.Module: {
@@ -2274,6 +2365,24 @@ export class Compiler extends DiagnosticEmitter {
return this.module.flatten(stmts);
}
+ private compileTypeDeclaration(statement: TypeDeclaration): ExpressionRef {
+ let flow = this.currentFlow;
+ let name = statement.name.text;
+ let existedTypeAlias = flow.lookupScopedTypeAlias(name);
+ if (existedTypeAlias) {
+ this.errorRelated(
+ DiagnosticCode.Duplicate_identifier_0,
+ statement.range,
+ existedTypeAlias.declaration.range,
+ name
+ );
+ return this.module.unreachable();
+ }
+ let element = new TypeDefinition(name, flow.sourceFunction, statement, DecoratorFlags.None);
+ flow.addScopedTypeAlias(name, element);
+ return this.module.nop();
+ }
+
private compileBreakStatement(
statement: BreakStatement
): ExpressionRef {
@@ -2550,11 +2659,20 @@ export class Compiler extends DiagnosticEmitter {
bodyStmts.length = 1;
}
+ if (condKind == ConditionKind.True) {
+ // Body executes at least once
+ flow.inherit(bodyFlow);
+ } else {
+ // Otherwise executes conditionally
+ flow.mergeBranch(bodyFlow);
+ }
+
// Compile the incrementor if it possibly executes
let possiblyLoops = possiblyContinues || possiblyFallsThrough;
if (possiblyLoops) {
let incrementor = statement.incrementor;
if (incrementor) {
+ this.currentFlow = flow;
bodyStmts.push(
this.compileExpression(incrementor, Type.void, Constraints.ConvImplicit | Constraints.WillDrop)
);
@@ -2572,14 +2690,6 @@ export class Compiler extends DiagnosticEmitter {
}
}
- // Body executes at least once
- if (condKind == ConditionKind.True) {
- flow.inherit(bodyFlow);
-
- // Otherwise executes conditionally
- } else {
- flow.mergeBranch(bodyFlow);
- }
// Finalize
outerFlow.inherit(flow);
@@ -2759,19 +2869,18 @@ export class Compiler extends DiagnosticEmitter {
let numCases = cases.length;
// Compile the condition (always executes)
- let condExpr = this.compileExpression(statement.condition, Type.u32,
- Constraints.ConvImplicit
- );
-
+ let condExpr = this.compileExpression(statement.condition, Type.auto);
+ let condType = this.currentType;
+
// Shortcut if there are no cases
if (!numCases) return module.drop(condExpr);
// Assign the condition to a temporary local as we compare it multiple times
let outerFlow = this.currentFlow;
- let tempLocal = outerFlow.getTempLocal(Type.u32);
+ let tempLocal = outerFlow.getTempLocal(condType);
let tempLocalIndex = tempLocal.index;
let breaks = new Array(1 + numCases);
- breaks[0] = module.local_set(tempLocalIndex, condExpr, false); // u32
+ breaks[0] = module.local_set(tempLocalIndex, condExpr, condType.isManaged);
// Make one br_if per labeled case and leave it to Binaryen to optimize the
// sequence of br_ifs to a br_table according to optimization levels
@@ -2784,14 +2893,24 @@ export class Compiler extends DiagnosticEmitter {
defaultIndex = i;
continue;
}
- breaks[breakIndex++] = module.br(`case${i}|${label}`,
- module.binary(BinaryOp.EqI32,
- module.local_get(tempLocalIndex, TypeRef.I32),
- this.compileExpression(assert(case_.label), Type.u32,
- Constraints.ConvImplicit
- )
- )
+
+ // Compile the equality expression for this case
+ const left = statement.condition;
+ const leftExpr = module.local_get(tempLocalIndex, condType.toRef());
+ const leftType = condType;
+ const right = case_.label!;
+ const rightExpr = this.compileExpression(assert(case_.label), condType, Constraints.ConvImplicit);
+ const rightType = this.currentType;
+ const equalityExpr = this.compileCommutativeCompareBinaryExpressionFromParts(
+ Token.Equals_Equals,
+ left, leftExpr, leftType,
+ right, rightExpr, rightType,
+ condType,
+ statement
);
+
+ // Add it to the list of breaks
+ breaks[breakIndex++] = module.br(`case${i}|${label}`, equalityExpr);
}
// If there is a default case, break to it, otherwise break out of the switch
@@ -2931,7 +3050,7 @@ export class Compiler extends DiagnosticEmitter {
let initializerNode = declaration.initializer;
if (typeNode) {
type = resolver.resolveType( // reports
- typeNode,
+ typeNode, flow,
flow.sourceFunction,
cloneMap(flow.contextualTypeArguments)
);
@@ -3602,43 +3721,29 @@ export class Compiler extends DiagnosticEmitter {
// int to float
} else if (fromType.isIntegerValue && toType.isFloatValue) {
-
+ // Clear extra bits.
+ expr = this.ensureSmallIntegerWrap(expr, fromType);
+ let op: UnaryOp;
// int to f32
if (toType.kind == TypeKind.F32) {
if (fromType.isLongIntegerValue) {
- expr = module.unary(
- fromType.isSignedIntegerValue
- ? UnaryOp.ConvertI64ToF32
- : UnaryOp.ConvertU64ToF32,
- expr
- );
+ if (fromType.isSignedIntegerValue) op = UnaryOp.ConvertI64ToF32;
+ else op = UnaryOp.ConvertU64ToF32;
} else {
- expr = module.unary(
- fromType.isSignedIntegerValue
- ? UnaryOp.ConvertI32ToF32
- : UnaryOp.ConvertU32ToF32,
- expr
- );
+ if (fromType.isSignedIntegerValue) op = UnaryOp.ConvertI32ToF32;
+ else op = UnaryOp.ConvertU32ToF32;
}
-
// int to f64
} else {
if (fromType.isLongIntegerValue) {
- expr = module.unary(
- fromType.isSignedIntegerValue
- ? UnaryOp.ConvertI64ToF64
- : UnaryOp.ConvertU64ToF64,
- expr
- );
+ if (fromType.isSignedIntegerValue) op = UnaryOp.ConvertI64ToF64;
+ else op = UnaryOp.ConvertU64ToF64;
} else {
- expr = module.unary(
- fromType.isSignedIntegerValue
- ? UnaryOp.ConvertI32ToF64
- : UnaryOp.ConvertU32ToF64,
- expr
- );
+ if (fromType.isSignedIntegerValue) op = UnaryOp.ConvertI32ToF64;
+ else op = UnaryOp.ConvertU32ToF64;
}
}
+ expr = module.unary(op, expr);
// v128 to bool
} else if (fromType == Type.v128 && toType.isBooleanValue) {
@@ -3698,7 +3803,7 @@ export class Compiler extends DiagnosticEmitter {
case AssertionKind.As: {
let flow = this.currentFlow;
let toType = this.resolver.resolveType( // reports
- assert(expression.toType),
+ assert(expression.toType), flow,
flow.sourceFunction,
cloneMap(flow.contextualTypeArguments)
);
@@ -3752,270 +3857,222 @@ export class Compiler extends DiagnosticEmitter {
private i32PowInstance: Function | null = null;
private i64PowInstance: Function | null = null;
- private compileBinaryExpression(
+ /** compile `==` `===` `!=` `!==` BinaryExpression */
+ private compileCommutativeCompareBinaryExpression(
+ expression: BinaryExpression,
+ contextualType: Type,
+ ): ExpressionRef {
+
+ const left = expression.left;
+ const leftExpr = this.compileExpression(left, contextualType);
+ const leftType = this.currentType;
+
+ const right = expression.right;
+ const rightExpr = this.compileExpression(right, leftType);
+ const rightType = this.currentType;
+
+ return this.compileCommutativeCompareBinaryExpressionFromParts(
+ expression.operator,
+ left, leftExpr, leftType,
+ right, rightExpr, rightType,
+ contextualType,
+ expression
+ );
+ }
+
+ /**
+ * compile `==` `===` `!=` `!==` BinaryExpression, from previously compiled left and right expressions.
+ *
+ * This is split from `compileCommutativeCompareBinaryExpression` so that the logic can be reused
+ * for switch cases in `compileSwitchStatement`, where the left expression only should be compiled once.
+ */
+ private compileCommutativeCompareBinaryExpressionFromParts(
+ operator: Token,
+ left: Expression,
+ leftExpr: ExpressionRef,
+ leftType: Type,
+ right: Expression,
+ rightExpr: ExpressionRef,
+ rightType: Type,
+ contextualType: Type,
+ reportNode: Node
+ ): ExpressionRef {
+
+ let module = this.module;
+ let operatorString = operatorTokenToString(operator);
+
+ // check operator overload
+ const operatorKind = OperatorKind.fromBinaryToken(operator);
+ const leftOverload = leftType.lookupOverload(operatorKind, this.program);
+ const rightOverload = rightType.lookupOverload(operatorKind, this.program);
+ if (leftOverload && rightOverload && leftOverload != rightOverload) {
+ this.error(
+ DiagnosticCode.Ambiguous_operator_overload_0_conflicting_overloads_1_and_2,
+ reportNode.range,
+ operatorString,
+ leftOverload.internalName,
+ rightOverload.internalName
+ );
+ this.currentType = contextualType;
+ return module.unreachable();
+ }
+ if (leftOverload) {
+ return this.compileCommutativeBinaryOverload(
+ leftOverload,
+ left, leftExpr, leftType,
+ right, rightExpr, rightType,
+ reportNode
+ );
+ }
+ if (rightOverload) {
+ return this.compileCommutativeBinaryOverload(
+ rightOverload,
+ right, rightExpr, rightType,
+ left, leftExpr, leftType,
+ reportNode
+ );
+ }
+ const signednessIsRelevant = false;
+ const commonType = Type.commonType(leftType, rightType, contextualType, signednessIsRelevant);
+ if (!commonType) {
+ this.error(
+ DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
+ reportNode.range,
+ operatorString,
+ leftType.toString(),
+ rightType.toString()
+ );
+ this.currentType = contextualType;
+ return module.unreachable();
+ }
+
+ if (commonType.isFloatValue) {
+ if (isConstExpressionNaN(module, rightExpr) || isConstExpressionNaN(module, leftExpr)) {
+ this.warning(
+ DiagnosticCode._NaN_does_not_compare_equal_to_any_other_value_including_itself_Use_isNaN_x_instead,
+ reportNode.range
+ );
+ }
+ if (isConstNegZero(rightExpr) || isConstNegZero(leftExpr)) {
+ this.warning(
+ DiagnosticCode.Comparison_with_0_0_is_sign_insensitive_Use_Object_is_x_0_0_if_the_sign_matters,
+ reportNode.range
+ );
+ }
+ }
+
+ leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
+ leftType = commonType;
+ rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
+ rightType = commonType;
+
+ this.currentType = Type.bool;
+ switch (operator) {
+ case Token.Equals_Equals_Equals:
+ case Token.Equals_Equals:
+ return this.makeEq(leftExpr, rightExpr, commonType, reportNode);
+ case Token.Exclamation_Equals_Equals:
+ case Token.Exclamation_Equals:
+ return this.makeNe(leftExpr, rightExpr, commonType, reportNode);
+ default:
+ assert(false);
+ return module.unreachable();
+ }
+ }
+
+ /** compile `>` `>=` `<` `<=` BinaryExpression */
+ private compileNonCommutativeCompareBinaryExpression(
expression: BinaryExpression,
contextualType: Type,
- constraints: Constraints
): ExpressionRef {
let module = this.module;
let left = expression.left;
let right = expression.right;
-
let leftExpr: ExpressionRef;
let leftType: Type;
let rightExpr: ExpressionRef;
let rightType: Type;
let commonType: Type | null;
-
- let expr: ExpressionRef;
- let compound = false;
-
let operator = expression.operator;
- switch (operator) {
- case Token.LessThan: {
- leftExpr = this.compileExpression(left, contextualType);
- leftType = this.currentType;
+ let operatorString = operatorTokenToString(operator);
- // check operator overload
- let classReference = leftType.getClassOrWrapper(this.program);
- if (classReference) {
- let overload = classReference.lookupOverload(OperatorKind.Lt);
- if (overload) {
- expr = this.compileBinaryOverload(overload, left, leftExpr, leftType, right, expression);
- break;
- }
- }
-
- rightExpr = this.compileExpression(right, leftType);
- rightType = this.currentType;
- commonType = Type.commonType(leftType, rightType, contextualType, true);
- if (!commonType || !commonType.isNumericValue) {
- this.error(
- DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
- expression.range, "<", leftType.toString(), rightType.toString()
- );
- this.currentType = contextualType;
- return module.unreachable();
- }
-
- leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
- leftType = commonType;
- rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
- rightType = commonType;
-
- expr = this.makeLt(leftExpr, rightExpr, commonType);
- this.currentType = Type.bool;
- break;
- }
- case Token.GreaterThan: {
- leftExpr = this.compileExpression(left, contextualType);
- leftType = this.currentType;
-
- // check operator overload
- let classReference = leftType.getClassOrWrapper(this.program);
- if (classReference) {
- let overload = classReference.lookupOverload(OperatorKind.Gt);
- if (overload) {
- expr = this.compileBinaryOverload(overload, left, leftExpr, leftType, right, expression);
- break;
- }
- }
-
- rightExpr = this.compileExpression(right, leftType);
- rightType = this.currentType;
- commonType = Type.commonType(leftType, rightType, contextualType, true);
- if (!commonType || !commonType.isNumericValue) {
- this.error(
- DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
- expression.range, ">", leftType.toString(), rightType.toString()
- );
- this.currentType = contextualType;
- return module.unreachable();
- }
-
- leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
- leftType = commonType;
- rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
- rightType = commonType;
-
- expr = this.makeGt(leftExpr, rightExpr, commonType);
- this.currentType = Type.bool;
- break;
- }
- case Token.LessThan_Equals: {
- leftExpr = this.compileExpression(left, contextualType);
- leftType = this.currentType;
+ leftExpr = this.compileExpression(left, contextualType);
+ leftType = this.currentType;
+
+ // check operator overload
+ const operatorKind = OperatorKind.fromBinaryToken(operator);
+ const leftOverload = leftType.lookupOverload(operatorKind, this.program);
+ if (leftOverload) return this.compileBinaryOverload(leftOverload, left, leftExpr, leftType, right, expression);
- // check operator overload
- let classReference = leftType.getClassOrWrapper(this.program);
- if (classReference) {
- let overload = classReference.lookupOverload(OperatorKind.Le);
- if (overload) {
- expr = this.compileBinaryOverload(overload, left, leftExpr, leftType, right, expression);
- break;
- }
- }
+ rightExpr = this.compileExpression(right, leftType);
+ rightType = this.currentType;
- rightExpr = this.compileExpression(right, leftType);
- rightType = this.currentType;
- commonType = Type.commonType(leftType, rightType, contextualType, true);
- if (!commonType || !commonType.isNumericValue) {
- this.error(
- DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
- expression.range, "<=", leftType.toString(), rightType.toString()
- );
- this.currentType = contextualType;
- return module.unreachable();
- }
+ const signednessIsRelevant = true;
+ commonType = Type.commonType(leftType, rightType, contextualType, signednessIsRelevant);
+ if (!commonType || !commonType.isNumericValue) {
+ this.error(
+ DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
+ expression.range,
+ operatorString,
+ leftType.toString(),
+ rightType.toString()
+ );
+ this.currentType = contextualType;
+ return module.unreachable();
+ }
- leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
- leftType = commonType;
- rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
- rightType = commonType;
+ leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
+ leftType = commonType;
+ rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
+ rightType = commonType;
- expr = this.makeLe(leftExpr, rightExpr, commonType);
- this.currentType = Type.bool;
- break;
- }
- case Token.GreaterThan_Equals: {
- leftExpr = this.compileExpression(left, contextualType);
- leftType = this.currentType;
+ this.currentType = Type.bool;
+ switch (operator) {
+ case Token.LessThan:
+ return this.makeLt(leftExpr, rightExpr, commonType);
+ case Token.GreaterThan:
+ return this.makeGt(leftExpr, rightExpr, commonType);
+ case Token.LessThan_Equals:
+ return this.makeLe(leftExpr, rightExpr, commonType);
+ case Token.GreaterThan_Equals:
+ return this.makeGe(leftExpr, rightExpr, commonType);
+ default:
+ assert(false);
+ return module.unreachable();
+ }
+ }
- // check operator overload
- let classReference = leftType.getClassOrWrapper(this.program);
- if (classReference) {
- let overload = classReference.lookupOverload(OperatorKind.Ge);
- if (overload) {
- expr = this.compileBinaryOverload(overload, left, leftExpr, leftType, right, expression);
- break;
- }
- }
+ private compileBinaryExpression(
+ expression: BinaryExpression,
+ contextualType: Type,
+ constraints: Constraints
+ ): ExpressionRef {
+ let module = this.module;
+ let left = expression.left;
+ let right = expression.right;
- rightExpr = this.compileExpression(right, leftType);
- rightType = this.currentType;
- commonType = Type.commonType(leftType, rightType, contextualType, true);
- if (!commonType || !commonType.isNumericValue) {
- this.error(
- DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
- expression.range, ">=", leftType.toString(), rightType.toString()
- );
- this.currentType = contextualType;
- return module.unreachable();
- }
+ let leftExpr: ExpressionRef;
+ let leftType: Type;
+ let rightExpr: ExpressionRef;
+ let rightType: Type;
+ let commonType: Type | null;
- leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
- leftType = commonType;
- rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
- rightType = commonType;
+ let expr: ExpressionRef;
+ let compound = false;
- expr = this.makeGe(leftExpr, rightExpr, commonType);
- this.currentType = Type.bool;
- break;
+ let operator = expression.operator;
+ switch (operator) {
+ case Token.LessThan:
+ case Token.GreaterThan:
+ case Token.LessThan_Equals:
+ case Token.GreaterThan_Equals:{
+ return this.compileNonCommutativeCompareBinaryExpression(expression, contextualType);
}
-
case Token.Equals_Equals_Equals:
- case Token.Equals_Equals: {
- leftExpr = this.compileExpression(left, contextualType);
- leftType = this.currentType;
-
- // check operator overload
- let classReference = leftType.getClassOrWrapper(this.program);
- if (classReference) {
- let overload = classReference.lookupOverload(OperatorKind.Eq);
- if (overload) {
- expr = this.compileBinaryOverload(overload, left, leftExpr, leftType, right, expression);
- break;
- }
- }
-
- rightExpr = this.compileExpression(right, leftType);
- rightType = this.currentType;
- commonType = Type.commonType(leftType, rightType, contextualType);
- if (!commonType) {
- this.error(
- DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
- expression.range, operatorTokenToString(expression.operator), leftType.toString(), rightType.toString()
- );
- this.currentType = contextualType;
- return module.unreachable();
- }
- if (commonType.isFloatValue) {
- if (
- isConstExpressionNaN(module, rightExpr) ||
- isConstExpressionNaN(module, leftExpr)
- ) {
- this.warning(
- DiagnosticCode._NaN_does_not_compare_equal_to_any_other_value_including_itself_Use_isNaN_x_instead,
- expression.range
- );
- }
- if (isConstNegZero(rightExpr) || isConstNegZero(leftExpr)) {
- this.warning(
- DiagnosticCode.Comparison_with_0_0_is_sign_insensitive_Use_Object_is_x_0_0_if_the_sign_matters,
- expression.range
- );
- }
- }
- leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
- leftType = commonType;
- rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
- rightType = commonType;
-
- expr = this.makeEq(leftExpr, rightExpr, commonType, expression);
- this.currentType = Type.bool;
- break;
- }
+ case Token.Equals_Equals:
case Token.Exclamation_Equals_Equals:
case Token.Exclamation_Equals: {
- leftExpr = this.compileExpression(left, contextualType);
- leftType = this.currentType;
-
- // check operator overload
- let classReference = leftType.getClass();
- if (classReference) {
- let overload = classReference.lookupOverload(OperatorKind.Ne);
- if (overload) {
- expr = this.compileBinaryOverload(overload, left, leftExpr, leftType, right, expression);
- break;
- }
- }
-
- rightExpr = this.compileExpression(right, leftType);
- rightType = this.currentType;
- commonType = Type.commonType(leftType, rightType, contextualType);
- if (!commonType) {
- this.error(
- DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2,
- expression.range, operatorTokenToString(expression.operator), leftType.toString(), rightType.toString()
- );
- this.currentType = contextualType;
- return module.unreachable();
- }
- if (commonType.isFloatValue) {
- if (
- isConstExpressionNaN(module, rightExpr) ||
- isConstExpressionNaN(module, leftExpr)
- ) {
- this.warning(
- DiagnosticCode._NaN_does_not_compare_equal_to_any_other_value_including_itself_Use_isNaN_x_instead,
- expression.range
- );
- }
- if (isConstNegZero(rightExpr) || isConstNegZero(leftExpr)) {
- this.warning(
- DiagnosticCode.Comparison_with_0_0_is_sign_insensitive_Use_Object_is_x_0_0_if_the_sign_matters,
- expression.range
- );
- }
- }
- leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
- leftType = commonType;
- rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
- rightType = commonType;
-
- expr = this.makeNe(leftExpr, rightExpr, commonType, expression);
- this.currentType = Type.bool;
- break;
+ return this.compileCommutativeCompareBinaryExpression(expression, contextualType);
}
case Token.Equals: {
return this.compileAssignment(left, right, contextualType);
@@ -4559,19 +4616,31 @@ export class Compiler extends DiagnosticEmitter {
}
leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
leftType = commonType;
+
+ // This is sometimes needed to make the left trivial
+ let leftPrecompExpr = module.runExpression(leftExpr, ExpressionRunnerFlags.PreserveSideeffects);
+ if (leftPrecompExpr) leftExpr = leftPrecompExpr;
+
rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
rightType = commonType;
- // simplify if copying left is trivial
- if (expr = module.tryCopyTrivialExpression(leftExpr)) {
+ let condExpr = this.makeIsTrueish(leftExpr, this.currentType, left);
+ let condKind = this.evaluateCondition(condExpr);
+
+ if (condKind != ConditionKind.Unknown) {
+ // simplify if left is a constant
+ expr = condKind == ConditionKind.True
+ ? rightExpr
+ : leftExpr;
+ } else if (expr = module.tryCopyTrivialExpression(leftExpr)) {
+ // simplify if copying left is trivial
expr = module.if(
- this.makeIsTrueish(leftExpr, this.currentType, left),
+ condExpr,
rightExpr,
expr
);
-
- // if not possible, tee left to a temp
} else {
+ // if not possible, tee left to a temp
let tempLocal = flow.getTempLocal(leftType);
if (!flow.canOverflow(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.Wrapped);
if (flow.isNonnull(leftExpr, leftType)) flow.setLocalFlag(tempLocal.index, LocalFlags.NonNull);
@@ -4639,19 +4708,31 @@ export class Compiler extends DiagnosticEmitter {
let possiblyNull = leftType.is(TypeFlags.Nullable) && rightType.is(TypeFlags.Nullable);
leftExpr = this.convertExpression(leftExpr, leftType, commonType, false, left);
leftType = commonType;
+
+ // This is sometimes needed to make the left trivial
+ let leftPrecompExpr = module.runExpression(leftExpr, ExpressionRunnerFlags.PreserveSideeffects);
+ if (leftPrecompExpr) leftExpr = leftPrecompExpr;
+
rightExpr = this.convertExpression(rightExpr, rightType, commonType, false, right);
rightType = commonType;
- // simplify if copying left is trivial
- if (expr = module.tryCopyTrivialExpression(leftExpr)) {
+ let condExpr = this.makeIsTrueish(leftExpr, this.currentType, left);
+ let condKind = this.evaluateCondition(condExpr);
+
+ if (condKind != ConditionKind.Unknown) {
+ // simplify if left is a constant
+ expr = condKind == ConditionKind.True
+ ? leftExpr
+ : rightExpr;
+ } else if (expr = module.tryCopyTrivialExpression(leftExpr)) {
+ // otherwise, simplify if copying left is trivial
expr = module.if(
- this.makeIsTrueish(leftExpr, leftType, left),
+ condExpr,
expr,
rightExpr
);
-
- // if not possible, tee left to a temp. local
} else {
+ // if not possible, tee left to a temp. local
let temp = flow.getTempLocal(leftType);
let tempIndex = temp.index;
if (!flow.canOverflow(leftExpr, leftType)) flow.setLocalFlag(tempIndex, LocalFlags.Wrapped);
@@ -4682,6 +4763,7 @@ export class Compiler extends DiagnosticEmitter {
default: {
assert(false);
expr = this.module.unreachable();
+ break;
}
}
if (!compound) return expr;
@@ -4854,17 +4936,17 @@ export class Compiler extends DiagnosticEmitter {
module.binary(BinaryOp.EqI8x16, leftExpr, rightExpr)
);
}
- case TypeKind.Eqref:
- case TypeKind.Structref:
- case TypeKind.Arrayref:
- case TypeKind.I31ref: return module.ref_eq(leftExpr, rightExpr);
- case TypeKind.Stringref: return module.string_eq(leftExpr, rightExpr);
+ case TypeKind.Eq:
+ case TypeKind.Struct:
+ case TypeKind.Array:
+ case TypeKind.I31: return module.ref_eq(leftExpr, rightExpr);
+ case TypeKind.String: return module.string_eq(leftExpr, rightExpr);
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter:
- case TypeKind.Funcref:
- case TypeKind.Externref:
- case TypeKind.Anyref: {
+ case TypeKind.Func:
+ case TypeKind.Extern:
+ case TypeKind.Any: {
this.error(
DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
reportNode.range,
@@ -4904,15 +4986,15 @@ export class Compiler extends DiagnosticEmitter {
module.binary(BinaryOp.NeI8x16, leftExpr, rightExpr)
);
}
- case TypeKind.Eqref:
- case TypeKind.Structref:
- case TypeKind.Arrayref:
- case TypeKind.I31ref: {
+ case TypeKind.Eq:
+ case TypeKind.Struct:
+ case TypeKind.Array:
+ case TypeKind.I31: {
return module.unary(UnaryOp.EqzI32,
module.ref_eq(leftExpr, rightExpr)
);
}
- case TypeKind.Stringref: {
+ case TypeKind.String: {
return module.unary(UnaryOp.EqzI32,
module.string_eq(leftExpr, rightExpr)
);
@@ -4920,9 +5002,9 @@ export class Compiler extends DiagnosticEmitter {
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter:
- case TypeKind.Funcref:
- case TypeKind.Externref:
- case TypeKind.Anyref: {
+ case TypeKind.Func:
+ case TypeKind.Extern:
+ case TypeKind.Any: {
this.error(
DiagnosticCode.Operation_0_cannot_be_applied_to_type_1,
reportNode.range,
@@ -5010,8 +5092,7 @@ export class Compiler extends DiagnosticEmitter {
return module.select(
module.i32(1),
module.binary(BinaryOp.EqI32, rightExpr, module.i32(0)),
- leftExpr,
- TypeRef.I32
+ leftExpr
);
}
case TypeKind.I8:
@@ -5549,6 +5630,29 @@ export class Compiler extends DiagnosticEmitter {
return this.makeCallDirect(operatorInstance, [ leftExpr, rightExpr ], reportNode);
}
+
+ private compileCommutativeBinaryOverload(
+ operatorInstance: Function,
+ first: Expression,
+ firstExpr: ExpressionRef,
+ firstType: Type,
+ second: Expression,
+ secondExpr: ExpressionRef,
+ secondType: Type,
+ reportNode: Node
+ ): ExpressionRef {
+ let signature = operatorInstance.signature;
+ let parameterTypes = signature.parameterTypes;
+ if (operatorInstance.is(CommonFlags.Instance)) {
+ firstExpr = this.convertExpression(firstExpr, firstType, assert(signature.thisType), false, first);
+ secondExpr = this.convertExpression(secondExpr, secondType, parameterTypes[0], false, second);
+ } else {
+ firstExpr = this.convertExpression(firstExpr, firstType, parameterTypes[0], false, first);
+ secondExpr = this.convertExpression(secondExpr, secondType, parameterTypes[1], false, second);
+ }
+ return this.makeCallDirect(operatorInstance, [ firstExpr, secondExpr ], reportNode);
+ }
+
private compileAssignment(
expression: Expression,
valueExpression: Expression,
@@ -5565,13 +5669,21 @@ export class Compiler extends DiagnosticEmitter {
// to compile just the value, we need to know the target's type
let targetType: Type;
switch (target.kind) {
- case ElementKind.Global: {
- if (!this.compileGlobalLazy(target, expression)) {
+ case ElementKind.Global:
+ case ElementKind.Local: {
+ if (target.kind == ElementKind.Global) {
+ if (!this.compileGlobalLazy(target, expression)) {
+ return this.module.unreachable();
+ }
+ } else if (!(target).declaredByFlow(flow)) {
+ // TODO: closures
+ this.error(
+ DiagnosticCode.Not_implemented_0,
+ expression.range,
+ "Closures"
+ );
return this.module.unreachable();
}
- // fall-through
- }
- case ElementKind.Local: {
if (this.pendingElements.has(target)) {
this.error(
DiagnosticCode.Variable_0_used_before_its_declaration,
@@ -5664,10 +5776,11 @@ export class Compiler extends DiagnosticEmitter {
assert(targetType != Type.void);
let valueExpr = this.compileExpression(valueExpression, targetType);
let valueType = this.currentType;
+ if (targetType.isNullableReference && this.currentFlow.isNonnull(valueExpr, valueType)) targetType = targetType.nonNullableType;
return this.makeAssignment(
target,
this.convertExpression(valueExpr, valueType, targetType, false, valueExpression),
- valueType,
+ targetType,
valueExpression,
thisExpression,
elementExpression,
@@ -5760,6 +5873,7 @@ export class Compiler extends DiagnosticEmitter {
return module.unreachable();
}
assert(setterInstance.signature.parameterTypes.length == 1);
+ assert(setterInstance.signature.returnType == Type.void);
if (propertyInstance.is(CommonFlags.Instance)) {
let thisType = assert(setterInstance.signature.thisType);
let thisExpr = this.compileExpression(
@@ -5768,28 +5882,29 @@ export class Compiler extends DiagnosticEmitter {
Constraints.ConvImplicit | Constraints.IsThis
);
if (!tee) return this.makeCallDirect(setterInstance, [ thisExpr, valueExpr ], valueExpression);
- let getterInstance = assert((target).getterInstance);
- assert(getterInstance.signature.thisType == thisType);
- let returnType = getterInstance.signature.returnType;
- let returnTypeRef = returnType.toRef();
- let tempThis = flow.getTempLocal(returnType);
+ let tempLocal = flow.getTempLocal(valueType);
+ let valueTypeRef = valueType.toRef();
let ret = module.block(null, [
this.makeCallDirect(setterInstance, [
- module.local_tee(tempThis.index, thisExpr, returnType.isManaged),
- valueExpr
+ thisExpr,
+ module.local_tee(tempLocal.index, valueExpr, valueType.isManaged, valueTypeRef)
], valueExpression),
- this.makeCallDirect(getterInstance, [
- module.local_get(tempThis.index, returnTypeRef)
- ], valueExpression)
- ], returnTypeRef);
+ module.local_get(tempLocal.index, valueTypeRef),
+ ], valueTypeRef);
+ this.currentType = valueType;
return ret;
} else {
if (!tee) return this.makeCallDirect(setterInstance, [ valueExpr ], valueExpression);
- let getterInstance = assert((target).getterInstance);
- return module.block(null, [
- this.makeCallDirect(setterInstance, [ valueExpr ], valueExpression),
- this.makeCallDirect(getterInstance, null, valueExpression)
- ], getterInstance.signature.returnType.toRef());
+ let tempLocal = flow.getTempLocal(valueType);
+ let valueTypeRef = valueType.toRef();
+ let ret = module.block(null, [
+ this.makeCallDirect(setterInstance, [
+ module.local_tee(tempLocal.index, valueExpr, valueType.isManaged, valueTypeRef),
+ ], valueExpression),
+ module.local_get(tempLocal.index, valueTypeRef),
+ ], valueTypeRef);
+ this.currentType = valueType;
+ return ret;
}
}
case ElementKind.IndexSignature: {
@@ -6120,6 +6235,7 @@ export class Compiler extends DiagnosticEmitter {
typeArguments = this.resolver.resolveTypeArguments(
assert(typeParameterNodes),
typeArgumentNodes,
+ this.currentFlow,
this.currentFlow.sourceFunction.parent,
cloneMap(this.currentFlow.contextualTypeArguments), // don't update
expression
@@ -6172,16 +6288,7 @@ export class Compiler extends DiagnosticEmitter {
return false;
}
- // not yet implemented (TODO: maybe some sort of an unmanaged/lightweight array?)
let hasRest = signature.hasRest;
- if (hasRest) {
- this.error(
- DiagnosticCode.Not_implemented_0,
- reportNode.range, "Rest parameters"
- );
- return false;
- }
-
let minimum = signature.requiredParameters;
let maximum = signature.parameterTypes.length;
@@ -6226,6 +6333,37 @@ export class Compiler extends DiagnosticEmitter {
}
}
+ private adjustArgumentsForRestParams(
+ argumentExpressions: Expression[],
+ signature: Signature,
+ reportNode: Node
+ ) : Expression[] {
+
+ // if no rest args, return the original args
+ if (!signature.hasRest) {
+ return argumentExpressions;
+ }
+
+ // if there are fewer args than params, then the rest args were not provided
+ // so return the original args
+ const numArguments = argumentExpressions.length;
+ const numParams = signature.parameterTypes.length;
+ if (numArguments < numParams) {
+ return argumentExpressions;
+ }
+
+ // make an array literal expression from the rest args
+ let elements = argumentExpressions.slice(numParams - 1);
+ let range = new Range(elements[0].range.start, elements[elements.length - 1].range.end);
+ range.source = reportNode.range.source;
+ let arrExpr = new ArrayLiteralExpression(elements, range);
+
+ // return the original args, but replace the rest args with the array
+ const exprs = argumentExpressions.slice(0, numParams - 1);
+ exprs.push(arrExpr);
+ return exprs;
+ }
+
/** Compiles a direct call to a concrete function. */
compileCallDirect(
instance: Function,
@@ -6247,6 +6385,9 @@ export class Compiler extends DiagnosticEmitter {
}
if (instance.hasDecorator(DecoratorFlags.Unsafe)) this.checkUnsafe(reportNode);
+ argumentExpressions = this.adjustArgumentsForRestParams(argumentExpressions, signature, reportNode);
+ numArguments = argumentExpressions.length;
+
// handle call on `this` in constructors
let sourceFunction = this.currentFlow.sourceFunction;
if (sourceFunction.is(CommonFlags.Constructor) && reportNode.isAccessOnThis) {
@@ -6256,7 +6397,8 @@ export class Compiler extends DiagnosticEmitter {
}
// Inline if explicitly requested
- if (instance.hasDecorator(DecoratorFlags.Inline) && (!instance.is(CommonFlags.Overridden) || reportNode.isAccessOnSuper)) {
+ let inlineRequested = instance.hasDecorator(DecoratorFlags.Inline) || this.currentFlow.is(FlowFlags.InlineContext);
+ if (inlineRequested && (!instance.is(CommonFlags.Overridden) || reportNode.isAccessOnSuper)) {
assert(!instance.is(CommonFlags.Stub)); // doesn't make sense
let inlineStack = this.inlineStack;
if (inlineStack.includes(instance)) {
@@ -6478,7 +6620,11 @@ export class Compiler extends DiagnosticEmitter {
let declaration = originalParameterDeclarations[minArguments + i];
let initializer = declaration.initializer;
let initExpr: ExpressionRef;
- if (initializer) {
+ if (declaration.parameterKind === ParameterKind.Rest) {
+ const arrExpr = new ArrayLiteralExpression([], declaration.range.atEnd);
+ initExpr = this.compileArrayLiteral(arrExpr, type, Constraints.ConvExplicit);
+ initExpr = module.local_set(operandIndex, initExpr, type.isManaged);
+ } else if (initializer) {
initExpr = this.compileExpression(
initializer,
type,
@@ -6575,20 +6721,22 @@ export class Compiler extends DiagnosticEmitter {
);
let overrideInstances = this.resolver.resolveOverrides(instance);
if (overrideInstances) {
+ let mostRecentInheritanceMapping = new Map();
for (let i = 0, k = overrideInstances.length; i < k; ++i) {
let overrideInstance = overrideInstances[i];
if (!overrideInstance.is(CommonFlags.Compiled)) continue; // errored
- let overrideType = overrideInstance.type;
- let originalType = instance.type;
- if (!overrideType.isAssignableTo(originalType)) {
+
+ let overrideSignature = overrideInstance.signature;
+ let originalSignature = instance.signature;
+
+ if (!overrideSignature.isAssignableTo(originalSignature, true)) {
this.error(
DiagnosticCode.Type_0_is_not_assignable_to_type_1,
- overrideInstance.identifierNode.range, overrideType.toString(), originalType.toString()
+ overrideInstance.identifierNode.range, overrideSignature.toString(), originalSignature.toString()
);
continue;
}
// TODO: additional optional parameters are not permitted by `isAssignableTo` yet
- let overrideSignature = overrideInstance.signature;
let overrideParameterTypes = overrideSignature.parameterTypes;
let overrideNumParameters = overrideParameterTypes.length;
let paramExprs = new Array(1 + overrideNumParameters);
@@ -6636,7 +6784,13 @@ export class Compiler extends DiagnosticEmitter {
if (instanceMembers && instanceMembers.has(instance.declaration.name.text)) {
continue; // skip those not inheriting
}
- builder.addCase(extender.id, stmts);
+ if (
+ !mostRecentInheritanceMapping.has(extender) ||
+ !assert(mostRecentInheritanceMapping.get(extender)).extends(classInstance)
+ ) {
+ mostRecentInheritanceMapping.set(extender, classInstance);
+ builder.addOrReplaceCase(extender.id, stmts);
+ }
}
}
}
@@ -6677,6 +6831,21 @@ export class Compiler extends DiagnosticEmitter {
stub.set(CommonFlags.Compiled);
}
+ private needToStack(expr: ExpressionRef): bool {
+ const precomp = this.module.runExpression(expr, ExpressionRunnerFlags.Default);
+ // cannot precompute, so must go to stack
+ if (precomp == 0) return true;
+ const value = getConstValueInteger(precomp, this.options.isWasm64);
+ // zero constant doesn't need to go to stack
+ if (i64_eq(value, i64_zero)) return false;
+ // static GC objects doesn't need to go to stack
+ let staticGcObjectOffsets = this.staticGcObjectOffsets;
+ if (staticGcObjectOffsets.has(i64_high(value))) {
+ if (assert(staticGcObjectOffsets.get(i64_high(value))).has(i64_low(value))) return false;
+ }
+ return true;
+ }
+
/** Marks managed call operands for the shadow stack. */
private operandsTostack(signature: Signature, operands: ExpressionRef[]): void {
if (!this.options.stackSize) return;
@@ -6686,8 +6855,7 @@ export class Compiler extends DiagnosticEmitter {
if (thisType) {
if (thisType.isManaged) {
let operand = operands[0];
- let precomp = module.runExpression(operand, ExpressionRunnerFlags.Default);
- if (!isConstZero(precomp)) { // otherwise unnecessary
+ if (this.needToStack(operand)) {
operands[operandIndex] = module.tostack(operand);
}
}
@@ -6700,8 +6868,7 @@ export class Compiler extends DiagnosticEmitter {
let paramType = parameterTypes[parameterIndex];
if (paramType.isManaged) {
let operand = operands[operandIndex];
- let precomp = module.runExpression(operand, ExpressionRunnerFlags.Default);
- if (!isConstZero(precomp)) { // otherwise unnecessary
+ if (this.needToStack(operand)) {
operands[operandIndex] = module.tostack(operand);
}
}
@@ -6856,6 +7023,9 @@ export class Compiler extends DiagnosticEmitter {
return this.module.unreachable();
}
+ argumentExpressions = this.adjustArgumentsForRestParams(argumentExpressions, signature, reportNode);
+ numArguments = argumentExpressions.length;
+
let numArgumentsInclThis = thisArg ? numArguments + 1 : numArguments;
let operands = new Array(numArgumentsInclThis);
let index = 0;
@@ -6965,7 +7135,17 @@ export class Compiler extends DiagnosticEmitter {
): ExpressionRef {
let module = this.module;
let targetExpression = expression.expression;
- let targetType = this.resolver.resolveExpression(targetExpression, this.currentFlow); // reports
+ let resolver = this.resolver;
+ let targetElement = resolver.lookupExpression(targetExpression, this.currentFlow, Type.auto, ReportMode.Swallow);
+ if (targetElement && targetElement.kind == ElementKind.Enum) {
+ const elementExpr = this.compileExpression(expression.elementExpression, Type.i32, Constraints.ConvImplicit);
+ const toStringFunctionName = this.ensureEnumToString(targetElement, expression);
+ this.currentType = this.program.stringInstance.type;
+ if (toStringFunctionName == null) return module.unreachable();
+ return module.call(toStringFunctionName, [ elementExpr ], TypeRef.I32);
+ }
+
+ let targetType = resolver.resolveExpression(targetExpression, this.currentFlow);
if (targetType) {
let classReference = targetType.getClassOrWrapper(this.program);
if (classReference) {
@@ -7042,7 +7222,7 @@ export class Compiler extends DiagnosticEmitter {
let parameterNode = parameterNodes[i];
if (!isTypeOmitted(parameterNode.type)) {
let resolvedType = this.resolver.resolveType(
- parameterNode.type,
+ parameterNode.type, flow,
sourceFunction.parent,
contextualTypeArguments
);
@@ -7062,7 +7242,7 @@ export class Compiler extends DiagnosticEmitter {
let returnType = contextualSignature.returnType;
if (!isTypeOmitted(signatureNode.returnType)) {
let resolvedType = this.resolver.resolveType(
- signatureNode.returnType,
+ signatureNode.returnType, flow,
sourceFunction.parent,
contextualTypeArguments
);
@@ -7092,7 +7272,7 @@ export class Compiler extends DiagnosticEmitter {
return module.unreachable();
}
let resolvedType = this.resolver.resolveType(
- thisTypeNode,
+ thisTypeNode, flow,
sourceFunction.parent,
contextualTypeArguments
);
@@ -7332,12 +7512,14 @@ export class Compiler extends DiagnosticEmitter {
);
}
assert(localIndex >= 0);
- if (localType.isNullableReference && flow.isLocalFlag(localIndex, LocalFlags.NonNull, false)) {
- localType = localType.nonNullableType;
+ let isNonNull = flow.isLocalFlag(localIndex, LocalFlags.NonNull, false);
+ if (localType.isNullableReference && isNonNull && (!localType.isExternalReference || this.options.hasFeature(Feature.GC))) {
+ this.currentType = localType.nonNullableType;
+ } else {
+ this.currentType = localType;
}
- this.currentType = localType;
- if (target.parent != flow.targetFunction) {
+ if (!local.declaredByFlow(flow)) {
// TODO: closures
this.error(
DiagnosticCode.Not_implemented_0,
@@ -7346,7 +7528,14 @@ export class Compiler extends DiagnosticEmitter {
);
return module.unreachable();
}
- return module.local_get(localIndex, localType.toRef());
+ let expr = module.local_get(localIndex, localType.toRef());
+ if (isNonNull && localType.isNullableExternalReference && this.options.hasFeature(Feature.GC)) {
+ // If the local's type is nullable, but its value is known to be non-null, propagate
+ // non-nullability info to Binaryen. Only applicable if GC is enabled, since without
+ // GC, here incl. typed function references, there is no nullability dimension.
+ expr = module.ref_as_nonnull(expr);
+ }
+ return expr;
}
case ElementKind.Global: {
let global = target;
@@ -7424,7 +7613,7 @@ export class Compiler extends DiagnosticEmitter {
// TODO: Concrete function types currently map to first class functions implemented in
// linear memory (on top of `usize`), leaving only generic `funcref` for use here. In the
// future, once functions become Wasm GC objects, the actual signature type can be used.
- this.currentType = Type.funcref;
+ this.currentType = Type.func;
return module.ref_func(functionInstance.internalName, ensureType(functionInstance.type));
}
let offset = this.ensureRuntimeFunction(functionInstance);
@@ -7470,7 +7659,7 @@ export class Compiler extends DiagnosticEmitter {
if (isType.kind == NodeKind.NamedType) {
let namedType = isType;
if (!(namedType.isNullable || namedType.hasTypeArguments)) {
- let element = this.resolver.resolveTypeName(namedType.name, flow.sourceFunction, ReportMode.Swallow);
+ let element = this.resolver.resolveTypeName(namedType.name, flow, flow.sourceFunction, ReportMode.Swallow);
if (element && element.kind == ElementKind.ClassPrototype) {
let prototype = element;
if (prototype.is(CommonFlags.Generic)) {
@@ -7482,7 +7671,7 @@ export class Compiler extends DiagnosticEmitter {
// Fall back to `instanceof TYPE`
let expectedType = this.resolver.resolveType(
- expression.isType,
+ expression.isType, flow,
flow.sourceFunction,
cloneMap(flow.contextualTypeArguments)
);
@@ -8139,11 +8328,9 @@ export class Compiler extends DiagnosticEmitter {
let arrayInstance = element;
let arrayType = arrayInstance.type;
let elementType = arrayInstance.getTypeArgumentsTo(program.arrayPrototype)![0];
- let arrayBufferInstance = assert(program.arrayBufferInstance);
// block those here so compiling expressions doesn't conflict
let tempThis = flow.getTempLocal(this.options.usizeType);
- let tempDataStart = flow.getTempLocal(arrayBufferInstance.type);
// compile value expressions and find out whether all are constant
let expressions = expression.elementExpressions;
@@ -8219,16 +8406,6 @@ export class Compiler extends DiagnosticEmitter {
let dataStartProperty = (dataStartMember).instance;
if (!dataStartProperty) return module.unreachable();
assert(dataStartProperty.isField && dataStartProperty.memoryOffset >= 0);
- stmts.push(
- module.local_set(tempDataStart.index,
- module.load(arrayType.byteSize, false,
- module.local_get(tempThis.index, arrayTypeRef),
- arrayTypeRef,
- dataStartProperty.memoryOffset
- ),
- true // ArrayBuffer
- )
- );
for (let i = 0; i < length; ++i) {
// this[i] = value
stmts.push(
@@ -8634,7 +8811,7 @@ export class Compiler extends DiagnosticEmitter {
let flow = this.currentFlow;
// obtain the class being instantiated
- let target = this.resolver.resolveTypeName(expression.typeName, flow.sourceFunction);
+ let target = this.resolver.resolveTypeName(expression.typeName, flow, flow.sourceFunction);
if (!target) return module.unreachable();
if (target.kind != ElementKind.ClassPrototype) {
this.error(
@@ -8670,6 +8847,7 @@ export class Compiler extends DiagnosticEmitter {
classInstance = this.resolver.resolveClassInclTypeArguments(
classPrototype,
typeArguments,
+ flow,
flow.sourceFunction.parent, // relative to caller
cloneMap(flow.contextualTypeArguments),
expression
@@ -8752,7 +8930,7 @@ export class Compiler extends DiagnosticEmitter {
classInstance.constructorInstance = instance;
let members = classInstance.members;
if (!members) classInstance.members = members = new Map();
- members.set("constructor", instance.prototype);
+ members.set(CommonNames.constructor, instance.prototype);
let previousFlow = this.currentFlow;
let flow = instance.flow;
@@ -8995,10 +9173,29 @@ export class Compiler extends DiagnosticEmitter {
}
case ElementKind.FunctionPrototype: {
let functionPrototype = target;
+ let typeParameterNodes = functionPrototype.typeParameterNodes;
+
+ if (typeParameterNodes && typeParameterNodes.length != 0) {
+ this.error(
+ DiagnosticCode.Type_argument_expected,
+ expression.range
+ );
+ break; // also diagnose 'not a value at runtime'
+ }
+
let functionInstance = this.resolver.resolveFunction(functionPrototype, null);
if (!functionInstance) return module.unreachable();
if (!this.compileFunction(functionInstance)) return module.unreachable();
this.currentType = functionInstance.type;
+
+ if (functionInstance.hasDecorator(DecoratorFlags.Builtin)) {
+ this.error(
+ DiagnosticCode.Not_implemented_0,
+ expression.range, "First-class built-ins"
+ );
+ return module.unreachable();
+ }
+
let offset = this.ensureRuntimeFunction(functionInstance);
return this.options.isWasm64
? module.i64(i64_low(offset), i64_high(offset))
@@ -9086,11 +9283,12 @@ export class Compiler extends DiagnosticEmitter {
let flow = this.currentFlow;
// make a getter for the expression (also obtains the type)
- let getValue = this.compileExpression( // reports
+ const getValueOriginal = this.compileExpression( // reports
expression.operand,
contextualType.exceptVoid,
Constraints.None
);
+ let getValue: ExpressionRef;
// if the value isn't dropped, a temp. local is required to remember the original value,
// except if a static overload is found, which reverses the use of a temp. (see below)
@@ -9099,16 +9297,17 @@ export class Compiler extends DiagnosticEmitter {
tempLocal = flow.getTempLocal(this.currentType);
getValue = module.local_tee(
tempLocal.index,
- getValue,
+ getValueOriginal,
this.currentType.isManaged
);
+ } else {
+ getValue = getValueOriginal;
}
let expr: ExpressionRef;
switch (expression.operator) {
case Token.Plus_Plus: {
-
// check operator overload
let classReference = this.currentType.getClassOrWrapper(this.program);
if (classReference) {
@@ -9116,7 +9315,7 @@ export class Compiler extends DiagnosticEmitter {
if (overload) {
let isInstance = overload.is(CommonFlags.Instance);
if (tempLocal && !isInstance) { // revert: static overload simply returns
- getValue = getLocalSetValue(getValue);
+ getValue = getValueOriginal;
tempLocal = null;
}
expr = this.compileUnaryOverload(overload, expression.operand, getValue, expression);
@@ -9192,7 +9391,6 @@ export class Compiler extends DiagnosticEmitter {
break;
}
case Token.Minus_Minus: {
-
// check operator overload
let classReference = this.currentType.getClassOrWrapper(this.program);
if (classReference) {
@@ -9200,11 +9398,11 @@ export class Compiler extends DiagnosticEmitter {
if (overload) {
let isInstance = overload.is(CommonFlags.Instance);
if (tempLocal && !isInstance) { // revert: static overload simply returns
- getValue = getLocalSetValue(getValue);
+ getValue = getValueOriginal;
tempLocal = null;
}
expr = this.compileUnaryOverload(overload, expression.operand, getValue, expression);
- if (overload.is(CommonFlags.Instance)) break;
+ if (isInstance) break;
return expr; // here
}
}
@@ -9830,8 +10028,10 @@ export class Compiler extends DiagnosticEmitter {
let targetFunction = this.currentFlow.targetFunction;
let source = range.source;
if (source.debugInfoIndex < 0) source.debugInfoIndex = this.module.addDebugInfoFile(source.normalizedPath);
- range.debugInfoRef = expr;
- targetFunction.debugLocations.push(range);
+ // It's possible that an `expr` is seen multiple times, for example when
+ // first adding debug information for an inner expression and later on for
+ // an expression supposedly wrapping it, where the wrapping became a noop.
+ targetFunction.debugLocations.set(expr, range);
}
/** Checks whether a particular function signature is supported. */
@@ -9897,20 +10097,21 @@ export class Compiler extends DiagnosticEmitter {
case TypeKind.F32: return module.f32(0);
case TypeKind.F64: return module.f64(0);
case TypeKind.V128: return module.v128(v128_zero);
- case TypeKind.Funcref:
- case TypeKind.Externref:
- case TypeKind.Anyref:
- case TypeKind.Eqref:
- case TypeKind.Structref:
- case TypeKind.Arrayref:
- case TypeKind.Stringref:
+ case TypeKind.Func:
+ case TypeKind.Extern:
+ case TypeKind.Any:
+ case TypeKind.Eq:
+ case TypeKind.Struct:
+ case TypeKind.Array:
+ case TypeKind.String:
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter: {
- // TODO: what if not nullable?
- return module.ref_null(type.toRef());
+ if (type.is(TypeFlags.Nullable)) return module.ref_null(type.toRef());
+ assert(false); // TODO: check that refs are nullable in callers?
+ return module.unreachable();
}
- case TypeKind.I31ref: {
+ case TypeKind.I31: {
if (type.is(TypeFlags.Nullable)) return module.ref_null(type.toRef());
return module.i31_new(module.i32(0));
}
@@ -9935,7 +10136,7 @@ export class Compiler extends DiagnosticEmitter {
case TypeKind.U64: return module.i64(1);
case TypeKind.F32: return module.f32(1);
case TypeKind.F64: return module.f64(1);
- case TypeKind.I31ref: return module.i31_new(module.i32(1));
+ case TypeKind.I31: return module.i31_new(module.i32(1));
}
}
@@ -9957,7 +10158,7 @@ export class Compiler extends DiagnosticEmitter {
case TypeKind.F32: return module.f32(-1);
case TypeKind.F64: return module.f64(-1);
case TypeKind.V128: return module.v128(v128_ones);
- case TypeKind.I31ref: return module.i31_new(module.i32(-1));
+ case TypeKind.I31: return module.i31_new(module.i32(-1));
}
}
@@ -10056,14 +10257,14 @@ export class Compiler extends DiagnosticEmitter {
case TypeKind.V128: {
return module.unary(UnaryOp.AnyTrueV128, expr);
}
- case TypeKind.Funcref:
- case TypeKind.Externref:
- case TypeKind.Anyref:
- case TypeKind.Eqref:
- case TypeKind.Structref:
- case TypeKind.Arrayref:
- case TypeKind.I31ref:
- case TypeKind.Stringref:
+ case TypeKind.Func:
+ case TypeKind.Extern:
+ case TypeKind.Any:
+ case TypeKind.Eq:
+ case TypeKind.Struct:
+ case TypeKind.Array:
+ case TypeKind.I31:
+ case TypeKind.String:
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter: {
@@ -10084,6 +10285,7 @@ export class Compiler extends DiagnosticEmitter {
/** Makes a string conversion of the given expression. */
makeToString(expr: ExpressionRef, type: Type, reportNode: Node): ExpressionRef {
+ let module = this.module;
let stringType = this.program.stringInstance.type;
if (type == stringType) {
return expr;
@@ -10100,15 +10302,30 @@ export class Compiler extends DiagnosticEmitter {
reportNode
)) {
this.currentType = stringType;
- return this.module.unreachable();
+ return module.unreachable();
}
if (!type.isStrictlyAssignableTo(assert(toStringSignature.thisType))) {
- this.errorRelated(
- DiagnosticCode.The_this_types_of_each_signature_are_incompatible,
- reportNode.range, toStringInstance.identifierAndSignatureRange
+ if (!type.is(TypeFlags.Nullable)) {
+ this.errorRelated(
+ DiagnosticCode.The_this_types_of_each_signature_are_incompatible,
+ reportNode.range, toStringInstance.identifierAndSignatureRange
+ );
+ this.currentType = stringType;
+ return module.unreachable();
+ }
+
+ // Attempt to retry on the non-nullable form of the type, wrapped in a ternary:
+ // `expr ? expr.toString() : "null"`
+ const tempLocal = this.currentFlow.getTempLocal(type);
+ return module.if(
+ module.local_tee(tempLocal.index, expr, type.isManaged),
+ this.makeToString(
+ module.local_get(tempLocal.index, type.toRef()),
+ type.nonNullableType,
+ reportNode
+ ),
+ this.ensureStaticString("null")
);
- this.currentType = stringType;
- return this.module.unreachable();
}
let toStringReturnType = toStringSignature.returnType;
if (!toStringReturnType.isStrictlyAssignableTo(stringType)) {
@@ -10117,7 +10334,7 @@ export class Compiler extends DiagnosticEmitter {
reportNode.range, toStringInstance.identifierAndSignatureRange, toStringReturnType.toString(), stringType.toString()
);
this.currentType = stringType;
- return this.module.unreachable();
+ return module.unreachable();
}
return this.makeCallDirect(toStringInstance, [ expr ], reportNode);
}
@@ -10127,7 +10344,7 @@ export class Compiler extends DiagnosticEmitter {
reportNode.range, type.toString(), stringType.toString()
);
this.currentType = stringType;
- return this.module.unreachable();
+ return module.unreachable();
}
/** Makes an allocation suitable to hold the data of an instance of the given class. */
diff --git a/src/diagnosticMessages.json b/src/diagnosticMessages.json
index 752ec4550d..bd12f1f7e3 100644
--- a/src/diagnosticMessages.json
+++ b/src/diagnosticMessages.json
@@ -51,6 +51,7 @@
"Index signature accessors in type '{0}' differ in types.": 237,
"Initializer, definitive assignment or nullable type expected.": 238,
"Definitive assignment has no effect on local variables.": 239,
+ "Ambiguous operator overload '{0}' (conflicting overloads '{1}' and '{2}').": 240,
"Importing the table disables some indirect call optimizations.": 901,
"Exporting the table disables some indirect call optimizations.": 902,
@@ -119,6 +120,7 @@
"Decorators are not valid here.": 1206,
"'abstract' modifier can only appear on a class, method, or property declaration.": 1242,
"Method '{0}' cannot have an implementation because it is marked abstract.": 1245,
+ "An interface property cannot have an initializer.": 1246,
"A definite assignment assertion '!' is not permitted in this context.": 1255,
"A class may only extend another class.": 1311,
"A parameter property cannot be declared using a rest parameter.": 1317,
@@ -150,7 +152,6 @@
"Operator '{0}' cannot be applied to types '{1}' and '{2}'.": 2365,
"A 'super' call must be the first statement in the constructor.": 2376,
"Constructors for derived classes must contain a 'super' call.": 2377,
- "Getter and setter accessors do not agree in visibility.": 2379,
"'get' and 'set' accessor must have the same type.": 2380,
"Overload signatures must all be public, private or protected.": 2385,
"Constructor implementation is missing.": 2390,
@@ -173,6 +174,7 @@
"Type '{0}' has no property '{1}'.": 2460,
"The '{0}' operator cannot be applied to type '{1}'.": 2469,
"In 'const' enum declarations member initializer must be constant expression.": 2474,
+ "A const enum member can only be accessed using a string literal.": 2476,
"Export declaration conflicts with exported declaration of '{0}'.": 2484,
"'{0}' is referenced directly or indirectly in its own base expression.": 2506,
"Cannot create an instance of an abstract class.": 2511,
@@ -194,10 +196,12 @@
"Cannot extend a class '{0}'. Class constructor is marked as private.": 2675,
"The 'this' types of each signature are incompatible.": 2685,
"Namespace '{0}' has no exported member '{1}'.": 2694,
+ "Namespace can only have declarations.": 2695,
"Required type parameters may not follow optional type parameters.": 2706,
"Duplicate property '{0}'.": 2718,
"Property '{0}' is missing in type '{1}' but required in type '{2}'.": 2741,
"Type '{0}' has no call signatures.": 2757,
+ "Get accessor '{0}' must be at least as accessible as the setter.": 2808,
"This member cannot have an 'override' modifier because it is not declared in the base class '{0}'.": 4117,
"File '{0}' not found.": 6054,
diff --git a/src/diagnostics.ts b/src/diagnostics.ts
index 9ca1e3d4e1..963003023b 100644
--- a/src/diagnostics.ts
+++ b/src/diagnostics.ts
@@ -45,7 +45,6 @@ export const enum DiagnosticCategory {
export class Range {
source!: Source;
- debugInfoRef: usize = 0;
constructor(public start: i32, public end: i32) {}
diff --git a/src/flow.ts b/src/flow.ts
index 3f4838ab3d..ddc7941916 100644
--- a/src/flow.ts
+++ b/src/flow.ts
@@ -31,7 +31,8 @@ import {
TypedElement,
mangleInternalName,
Property,
- PropertyPrototype
+ PropertyPrototype,
+ TypeDefinition
} from "./program";
import {
@@ -145,6 +146,8 @@ export const enum FlowFlags {
UncheckedContext = 1 << 15,
/** This is a flow compiling a constructor parameter. */
CtorParamContext = 1 << 16,
+ /** This is a flow where all function calls are inlined if possible. */
+ InlineContext = 1 << 17,
// masks
@@ -250,6 +253,8 @@ export class Flow {
breakLabel: string | null = null;
/** Scoped local variables. */
scopedLocals: Map | null = null;
+ /** Scoped type alias. */
+ scopedTypeAlias: Map | null = null;
/** Local flags. */
localFlags: LocalFlags[] = [];
/** Field flags on `this`. Constructors only. */
@@ -405,6 +410,38 @@ export class Flow {
falseFlows.set(condExpr, falseFlow);
}
+ addScopedTypeAlias(name: string, definition: TypeDefinition): void {
+ let scopedTypeAlias = this.scopedTypeAlias;
+ if (!scopedTypeAlias) this.scopedTypeAlias = scopedTypeAlias = new Map();
+ scopedTypeAlias.set(name, definition);
+ }
+
+ lookupScopedTypeAlias(name: string): TypeDefinition | null {
+ let current: Flow | null = this;
+ do {
+ let scopedTypeAlias = current.scopedTypeAlias;
+ if (scopedTypeAlias && scopedTypeAlias.has(name)) {
+ return assert(scopedTypeAlias.get(name));
+ }
+ current = current.parent;
+ } while (current);
+ return null;
+ }
+
+ lookupTypeAlias(name: string): TypeDefinition | null {
+ let definition: TypeDefinition | null = null;
+ if (definition = this.lookupScopedTypeAlias(name)) return definition;
+
+ let sourceParent = this.sourceFunction.parent;
+ if (sourceParent.kind == ElementKind.Function) {
+ // lookup parent function.
+ let parentFunction = sourceParent;
+ return parentFunction.flow.lookupTypeAlias(name);
+ }
+
+ return null;
+ }
+
/** Gets a free temporary local of the specified type. */
getTempLocal(type: Type): Local {
let local = this.targetFunction.addLocal(type);
diff --git a/src/glue/binaryen.d.ts b/src/glue/binaryen.d.ts
index 466a3fac39..fdc2bd7492 100644
--- a/src/glue/binaryen.d.ts
+++ b/src/glue/binaryen.d.ts
@@ -41,7 +41,6 @@ export type ExpressionRunnerRef = Ref;
export type BinaryenModuleAllocateAndWriteResultRef = Ref;
export type TypeBuilderRef = Ref;
export type TypeBuilderErrorReason = u32;
-export type TypeSystem = u32;
export declare function _BinaryenTypeCreate(types: ArrayRef, numTypes: u32): TypeRef;
export declare function _BinaryenTypeArity(type: TypeRef): u32;
@@ -58,9 +57,6 @@ export declare function _BinaryenTypeStructref(): TypeRef;
export declare function _BinaryenTypeArrayref(): TypeRef;
export declare function _BinaryenTypeI31ref(): TypeRef;
export declare function _BinaryenTypeStringref(): TypeRef;
-export declare function _BinaryenTypeStringviewWTF8(): TypeRef;
-export declare function _BinaryenTypeStringviewWTF16(): TypeRef;
-export declare function _BinaryenTypeStringviewIter(): TypeRef;
export declare function _BinaryenTypeNullref(): TypeRef;
export declare function _BinaryenTypeNullExternref(): TypeRef;
export declare function _BinaryenTypeNullFuncref(): TypeRef;
@@ -73,9 +69,6 @@ export declare function _BinaryenHeapTypeI31(): HeapTypeRef;
export declare function _BinaryenHeapTypeStruct(): HeapTypeRef;
export declare function _BinaryenHeapTypeArray(): HeapTypeRef;
export declare function _BinaryenHeapTypeString(): HeapTypeRef;
-export declare function _BinaryenHeapTypeStringviewWTF8(): HeapTypeRef;
-export declare function _BinaryenHeapTypeStringviewWTF16(): HeapTypeRef;
-export declare function _BinaryenHeapTypeStringviewIter(): HeapTypeRef;
export declare function _BinaryenHeapTypeNone(): HeapTypeRef;
export declare function _BinaryenHeapTypeNoext(): HeapTypeRef;
export declare function _BinaryenHeapTypeNofunc(): HeapTypeRef;
@@ -283,7 +276,7 @@ export declare function _BinaryenBinarySetLeft(expr: ExpressionRef, leftExpr: Ex
export declare function _BinaryenBinaryGetRight(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenBinarySetRight(expr: ExpressionRef, rightExpr: ExpressionRef): void;
-export declare function _BinaryenSelect(module: ModuleRef, conditionExpr: ExpressionRef, ifTrueExpr: ExpressionRef, ifFalseExpr: ExpressionRef, type: TypeRef): ExpressionRef;
+export declare function _BinaryenSelect(module: ModuleRef, conditionExpr: ExpressionRef, ifTrueExpr: ExpressionRef, ifFalseExpr: ExpressionRef): ExpressionRef;
export declare function _BinaryenSelectGetIfTrue(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenSelectSetIfTrue(expr: ExpressionRef, ifTrueExpr: ExpressionRef): void;
export declare function _BinaryenSelectGetIfFalse(expr: ExpressionRef): ExpressionRef;
@@ -416,9 +409,9 @@ export declare function _BinaryenSIMDLoadStoreLaneGetVec(expr: ExpressionRef): E
export declare function _BinaryenSIMDLoadStoreLaneSetVec(expr: ExpressionRef, vecExpr: ExpressionRef): void;
export declare function _BinaryenSIMDLoadStoreLaneIsStore(expr: ExpressionRef): bool;
-export declare function _BinaryenMemoryInit(module: ModuleRef, segmentIndex: u32, destExpr: ExpressionRef, offsetExpr: ExpressionRef, sizeExpr: ExpressionRef, memoryName: StringRef): ExpressionRef;
-export declare function _BinaryenMemoryInitGetSegment(expr: ExpressionRef): u32;
-export declare function _BinaryenMemoryInitSetSegment(expr: ExpressionRef, segmentIndex: u32): void;
+export declare function _BinaryenMemoryInit(module: ModuleRef, segmentName: StringRef, destExpr: ExpressionRef, offsetExpr: ExpressionRef, sizeExpr: ExpressionRef, memoryName: StringRef): ExpressionRef;
+export declare function _BinaryenMemoryInitGetSegment(expr: ExpressionRef): StringRef;
+export declare function _BinaryenMemoryInitSetSegment(expr: ExpressionRef, segmentName: StringRef): void;
export declare function _BinaryenMemoryInitGetDest(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenMemoryInitSetDest(expr: ExpressionRef, destExpr: ExpressionRef): void;
export declare function _BinaryenMemoryInitGetOffset(expr: ExpressionRef): ExpressionRef;
@@ -426,9 +419,9 @@ export declare function _BinaryenMemoryInitSetOffset(expr: ExpressionRef, offset
export declare function _BinaryenMemoryInitGetSize(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenMemoryInitSetSize(expr: ExpressionRef, sizeExpr: ExpressionRef): void;
-export declare function _BinaryenDataDrop(module: ModuleRef, segmentIndex: u32): ExpressionRef;
-export declare function _BinaryenDataDropGetSegment(expr: ExpressionRef): u32;
-export declare function _BinaryenDataDropSetSegment(expr: ExpressionRef, segmentIndex: u32): void;
+export declare function _BinaryenDataDrop(module: ModuleRef, segmentName: StringRef): ExpressionRef;
+export declare function _BinaryenDataDropGetSegment(expr: ExpressionRef): StringRef;
+export declare function _BinaryenDataDropSetSegment(expr: ExpressionRef, segmentName: StringRef): void;
export declare function _BinaryenMemoryCopy(module: ModuleRef, destExpr: ExpressionRef, sourceExpr: ExpressionRef, sizeExpr: ExpressionRef, destMemoryName: StringRef, sourceMemoryName: StringRef): ExpressionRef;
export declare function _BinaryenMemoryCopyGetDest(expr: ExpressionRef): ExpressionRef;
@@ -458,7 +451,7 @@ export declare function _BinaryenRefAsSetOp(expr: ExpressionRef, op: Op): void;
export declare function _BinaryenRefAsGetValue(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenRefAsSetValue(expr: ExpressionRef, valueExpr: ExpressionRef): void;
-export declare function _BinaryenRefFunc(module: ModuleRef, funcName: StringRef, type: TypeRef): ExpressionRef;
+export declare function _BinaryenRefFunc(module: ModuleRef, funcName: StringRef, type: HeapTypeRef): ExpressionRef;
export declare function _BinaryenRefFuncGetFunc(expr: ExpressionRef): StringRef;
export declare function _BinaryenRefFuncSetFunc(expr: ExpressionRef, funcName: StringRef): void;
@@ -546,9 +539,9 @@ export declare function _BinaryenTupleExtractSetIndex(expr: ExpressionRef, index
export declare function _BinaryenPop(module: ModuleRef, type: TypeRef): ExpressionRef;
-export declare function _BinaryenI31New(module: ModuleRef, value: ExpressionRef): ExpressionRef;
-export declare function _BinaryenI31NewGetValue(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenI31NewSetValue(expr: ExpressionRef, valueExpr: ExpressionRef): void;
+export declare function _BinaryenRefI31(module: ModuleRef, value: ExpressionRef): ExpressionRef;
+export declare function _BinaryenRefI31GetValue(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenRefI31SetValue(expr: ExpressionRef, valueExpr: ExpressionRef): void;
export declare function _BinaryenI31Get(module: ModuleRef, i31Expr: ExpressionRef, signed: bool): ExpressionRef;
export declare function _BinaryenI31GetGetI31(expr: ExpressionRef): ExpressionRef;
@@ -618,15 +611,29 @@ export declare function _BinaryenArrayNewSetInit(expr: ExpressionRef, initExpr:
export declare function _BinaryenArrayNewGetSize(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayNewSetSize(expr: ExpressionRef, sizeExpr: ExpressionRef): void;
-// TODO: BinaryenArrayNewSeg
-
-export declare function _BinaryenArrayInit(module: ModuleRef, type: HeapTypeRef, values: ArrayRef, numValues: Index): ExpressionRef;
-export declare function _BinaryenArrayInitGetNumValues(expr: ExpressionRef): Index;
-export declare function _BinaryenArrayInitGetValueAt(expr: ExpressionRef, index: Index): ExpressionRef;
-export declare function _BinaryenArrayInitSetValueAt(expr: ExpressionRef, index: Index, valueExpr: ExpressionRef): void;
-export declare function _BinaryenArrayInitAppendValue(expr: ExpressionRef, valueExpr: ExpressionRef): Index;
-export declare function _BinaryenArrayInitInsertValueAt(expr: ExpressionRef, index: Index, valueExpr: ExpressionRef): void;
-export declare function _BinaryenArrayInitRemoveValueAt(expr: ExpressionRef, index: Index): ExpressionRef;
+export declare function _BinaryenArrayNewFixed(module: ModuleRef, type: HeapTypeRef, values: ArrayRef, numValues: Index): ExpressionRef;
+export declare function _BinaryenArrayNewFixedGetNumValues(expr: ExpressionRef): Index;
+export declare function _BinaryenArrayNewFixedGetValueAt(expr: ExpressionRef, index: Index): ExpressionRef;
+export declare function _BinaryenArrayNewFixedSetValueAt(expr: ExpressionRef, index: Index, valueExpr: ExpressionRef): void;
+export declare function _BinaryenArrayNewFixedAppendValue(expr: ExpressionRef, valueExpr: ExpressionRef): Index;
+export declare function _BinaryenArrayNewFixedInsertValueAt(expr: ExpressionRef, index: Index, valueExpr: ExpressionRef): void;
+export declare function _BinaryenArrayNewFixedRemoveValueAt(expr: ExpressionRef, index: Index): ExpressionRef;
+
+export declare function _BinaryenArrayNewData(module: ModuleRef, type: HeapTypeRef, name: StringRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayNewDataGetSegment(expr: ExpressionRef): StringRef;
+export declare function _BinaryenArrayNewDataSetSegment(expr: ExpressionRef, segment: StringRef): void;
+export declare function _BinaryenArrayNewDataGetOffset(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayNewDataSetOffset(expr: ExpressionRef, offset: ExpressionRef): void;
+export declare function _BinaryenArrayNewDataGetSize(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayNewDataSetSize(expr: ExpressionRef, size: ExpressionRef): void;
+
+export declare function _BinaryenArrayNewElem(module: ModuleRef, type: HeapTypeRef, seg: StringRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayNewElemGetSegment(expr: ExpressionRef): StringRef;
+export declare function _BinaryenArrayNewElemSetSegment(expr: ExpressionRef, segment: StringRef): void;
+export declare function _BinaryenArrayNewElemGetOffset(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayNewElemSetOffset(expr: ExpressionRef, offset: ExpressionRef): void;
+export declare function _BinaryenArrayNewElemGetSize(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayNewElemSetSize(expr: ExpressionRef, size: ExpressionRef): void;
export declare function _BinaryenArrayGet(module: ModuleRef, ref: ExpressionRef, index: ExpressionRef, type: TypeRef, signed: bool): ExpressionRef;
export declare function _BinaryenArrayGetGetRef(expr: ExpressionRef): ExpressionRef;
@@ -648,6 +655,16 @@ export declare function _BinaryenArrayLen(module: ModuleRef, ref: ExpressionRef)
export declare function _BinaryenArrayLenGetRef(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayLenSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
+export declare function _BinaryenArrayFill(module: ModuleRef, ref: ExpressionRef, index: ExpressionRef, value: ExpressionRef, size: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayFillGetRef(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayFillSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
+export declare function _BinaryenArrayFillGetIndex(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayFillSetIndex(expr: ExpressionRef, indexExpr: ExpressionRef): void;
+export declare function _BinaryenArrayFillGetValue(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayFillSetValue(expr: ExpressionRef, valueExpr: ExpressionRef): void;
+export declare function _BinaryenArrayFillGetSize(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayFillSetSize(expr: ExpressionRef, sizeExpr: ExpressionRef): void;
+
export declare function _BinaryenArrayCopy(module: ModuleRef, destRef: ExpressionRef, destIndex: ExpressionRef, srcRef: ExpressionRef, srcIndex: ExpressionRef, length: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayCopyGetDestRef(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayCopySetDestRef(expr: ExpressionRef, destRefExpr: ExpressionRef): void;
@@ -660,19 +677,39 @@ export declare function _BinaryenArrayCopySetSrcIndex(expr: ExpressionRef, srcIn
export declare function _BinaryenArrayCopyGetLength(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenArrayCopySetLength(expr: ExpressionRef, lengthExpr: ExpressionRef): void;
-export declare function _BinaryenStringNew(module: ModuleRef, op: Op, ptr: ExpressionRef, length: ExpressionRef, start: ExpressionRef, end: ExpressionRef, isTry: bool): ExpressionRef;
+export declare function _BinaryenArrayInitData(module: ModuleRef, name: StringRef, ref: ExpressionRef, index: ExpressionRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitDataGetSegment(expr: ExpressionRef): StringRef;
+export declare function _BinaryenArrayInitDataSetSegment(expr: ExpressionRef, segment: StringRef): void;
+export declare function _BinaryenArrayInitDataGetRef(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitDataSetRef(expr: ExpressionRef, ref: ExpressionRef): void;
+export declare function _BinaryenArrayInitDataGetIndex(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitDataSetIndex(expr: ExpressionRef, index: ExpressionRef): void;
+export declare function _BinaryenArrayInitDataGetOffset(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitDataSetOffset(expr: ExpressionRef, offset: ExpressionRef): void;
+export declare function _BinaryenArrayInitDataGetSize(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitDataSetSize(expr: ExpressionRef, size: ExpressionRef): void;
+
+export declare function _BinaryenArrayInitElem(module: ModuleRef, seg: StringRef, ref: ExpressionRef, index: ExpressionRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitElemGetSegment(expr: ExpressionRef): StringRef;
+export declare function _BinaryenArrayInitElemSetSegment(expr: ExpressionRef, segment: StringRef): void;
+export declare function _BinaryenArrayInitElemGetRef(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitElemSetRef(expr: ExpressionRef, ref: ExpressionRef): void;
+export declare function _BinaryenArrayInitElemGetIndex(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitElemSetIndex(expr: ExpressionRef, index: ExpressionRef): void;
+export declare function _BinaryenArrayInitElemGetOffset(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitElemSetOffset(expr: ExpressionRef, offset: ExpressionRef): void;
+export declare function _BinaryenArrayInitElemGetSize(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenArrayInitElemSetSize(expr: ExpressionRef, size: ExpressionRef): void;
+
+export declare function _BinaryenStringNew(module: ModuleRef, op: Op, ref: ExpressionRef, start: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringNewGetOp(expr: ExpressionRef): Op;
export declare function _BinaryenStringNewSetOp(expr: ExpressionRef, op: Op): void;
-export declare function _BinaryenStringNewGetPtr(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringNewSetPtr(expr: ExpressionRef, ptrExpr: ExpressionRef): void;
-export declare function _BinaryenStringNewGetLength(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringNewSetLength(expr: ExpressionRef, lengthExpr: ExpressionRef): void;
+export declare function _BinaryenStringNewGetRef(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenStringNewSetRef(expr: ExpressionRef, ptrExpr: ExpressionRef): void;
export declare function _BinaryenStringNewGetStart(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringNewSetStart(expr: ExpressionRef, startExpr: ExpressionRef): void;
export declare function _BinaryenStringNewGetEnd(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringNewSetEnd(expr: ExpressionRef, endExpr: ExpressionRef): void;
-export declare function _BinaryenStringNewIsTry(expr: ExpressionRef): bool;
-export declare function _BinaryenStringNewSetTry(expr: ExpressionRef, isTry: bool): void;
export declare function _BinaryenStringConst(module: ExpressionRef, name: StringRef): ExpressionRef;
export declare function _BinaryenStringConstGetString(expr: ExpressionRef): StringRef;
@@ -687,10 +724,10 @@ export declare function _BinaryenStringMeasureSetRef(expr: ExpressionRef, refExp
export declare function _BinaryenStringEncode(module: ExpressionRef, op: Op, ref: ExpressionRef, ptr: ExpressionRef, start: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringEncodeGetOp(expr: ExpressionRef): Op;
export declare function _BinaryenStringEncodeSetOp(expr: ExpressionRef, op: Op): void;
-export declare function _BinaryenStringEncodeGetRef(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringEncodeSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
-export declare function _BinaryenStringEncodeGetPtr(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringEncodeSetPtr(expr: ExpressionRef, ptrExpr: ExpressionRef): void;
+export declare function _BinaryenStringEncodeGetStr(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenStringEncodeSetStr(expr: ExpressionRef, refExpr: ExpressionRef): void;
+export declare function _BinaryenStringEncodeGetArray(expr: ExpressionRef): ExpressionRef;
+export declare function _BinaryenStringEncodeSetArray(expr: ExpressionRef, ptrExpr: ExpressionRef): void;
export declare function _BinaryenStringEncodeGetStart(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringEncodeSetStart(expr: ExpressionRef, startExpr: ExpressionRef): void;
@@ -708,41 +745,13 @@ export declare function _BinaryenStringEqSetLeft(expr: ExpressionRef, leftExpr:
export declare function _BinaryenStringEqGetRight(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringEqSetRight(expr: ExpressionRef, rightExpr: ExpressionRef): void;
-export declare function _BinaryenStringAs(module: ExpressionRef, op: Op, ref: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringAsGetOp(expr: ExpressionRef): Op;
-export declare function _BinaryenStringAsSetOp(expr: ExpressionRef, op: Op): void;
-export declare function _BinaryenStringAsGetRef(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringAsSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
-
-export declare function _BinaryenStringWTF8Advance(module: ExpressionRef, ref: ExpressionRef, pos: ExpressionRef, bytes: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringWTF8AdvanceGetRef(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringWTF8AdvanceSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
-export declare function _BinaryenStringWTF8AdvanceGetPos(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringWTF8AdvanceSetPos(expr: ExpressionRef, posExpr: ExpressionRef): void;
-export declare function _BinaryenStringWTF8AdvanceGetBytes(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringWTF8AdvanceSetBytes(expr: ExpressionRef, bytesExpr: ExpressionRef): void;
-
export declare function _BinaryenStringWTF16Get(module: ExpressionRef, ref: ExpressionRef, pos: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringWTF16GetGetRef(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringWTF16GetSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
export declare function _BinaryenStringWTF16GetGetPos(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringWTF16GetSetPos(expr: ExpressionRef, posExpr: ExpressionRef): void;
-export declare function _BinaryenStringIterNext(module: ExpressionRef, ref: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringIterNextGetRef(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringIterNextSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
-
-export declare function _BinaryenStringIterMove(module: ExpressionRef, op: Op, ref: ExpressionRef, num: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringIterMoveGetOp(expr: ExpressionRef): Op;
-export declare function _BinaryenStringIterMoveSetOp(expr: ExpressionRef, op: Op): void;
-export declare function _BinaryenStringIterMoveGetRef(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringIterMoveSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
-export declare function _BinaryenStringIterMoveGetNum(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringIterMoveSetNum(expr: ExpressionRef, numExpr: ExpressionRef): void;
-
-export declare function _BinaryenStringSliceWTF(module: ExpressionRef, op: Op, ref: ExpressionRef, start: ExpressionRef, end: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringSliceWTFGetOp(expr: ExpressionRef): Op;
-export declare function _BinaryenStringSliceWTFSetOp(expr: ExpressionRef, op: Op): void;
+export declare function _BinaryenStringSliceWTF(module: ExpressionRef, ref: ExpressionRef, start: ExpressionRef, end: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringSliceWTFGetRef(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringSliceWTFSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
export declare function _BinaryenStringSliceWTFGetStart(expr: ExpressionRef): ExpressionRef;
@@ -750,12 +759,6 @@ export declare function _BinaryenStringSliceWTFSetStart(expr: ExpressionRef, sta
export declare function _BinaryenStringSliceWTFGetEnd(expr: ExpressionRef): ExpressionRef;
export declare function _BinaryenStringSliceWTFSetEnd(expr: ExpressionRef, endExpr: ExpressionRef): void;
-export declare function _BinaryenStringSliceIter(module: ExpressionRef, ref: ExpressionRef, num: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringSliceIterGetRef(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringSliceIterSetRef(expr: ExpressionRef, refExpr: ExpressionRef): void;
-export declare function _BinaryenStringSliceIterGetNum(expr: ExpressionRef): ExpressionRef;
-export declare function _BinaryenStringSliceIterSetNum(expr: ExpressionRef, numExpr: ExpressionRef): void;
-
export declare function _BinaryenAddFunction(module: ModuleRef, name: StringRef, params: TypeRef, results: TypeRef, varTypes: ArrayRef, numVarTypes: Index, body: ExpressionRef): FunctionRef;
export declare function _BinaryenGetFunction(module: ModuleRef, name: StringRef): FunctionRef;
export declare function _BinaryenRemoveFunction(module: ModuleRef, name: StringRef): void;
@@ -767,12 +770,15 @@ export declare function _BinaryenFunctionGetParams(func: FunctionRef): TypeRef;
export declare function _BinaryenFunctionGetResults(func: FunctionRef): TypeRef;
export declare function _BinaryenFunctionGetNumVars(func: FunctionRef): Index;
export declare function _BinaryenFunctionGetVar(func: FunctionRef, index: Index): TypeRef;
+export declare function _BinaryenFunctionAddVar(func: FunctionRef, type: TypeRef): Index;
export declare function _BinaryenFunctionGetNumLocals(func: FunctionRef): Index;
export declare function _BinaryenFunctionHasLocalName(func: FunctionRef, index: Index): bool;
export declare function _BinaryenFunctionGetLocalName(func: FunctionRef, index: Index): StringRef;
export declare function _BinaryenFunctionSetLocalName(func: FunctionRef, index: Index, name: StringRef): void;
export declare function _BinaryenFunctionGetBody(func: FunctionRef): ExpressionRef;
export declare function _BinaryenFunctionSetBody(func: FunctionRef, bodyExpr: ExpressionRef): void;
+export declare function _BinaryenFunctionGetType(func: FunctionRef): HeapTypeRef;
+export declare function _BinaryenFunctionSetType(func: FunctionRef, type: HeapTypeRef): void;
export declare function _BinaryenFunctionOptimize(func: FunctionRef, module: ModuleRef): void;
export declare function _BinaryenFunctionRunPasses(func: FunctionRef, module: ModuleRef, passes: ArrayRef, numPasses: Index): void;
export declare function _BinaryenFunctionSetDebugLocation(func: FunctionRef, expr: ExpressionRef, fileIndex: Index, lineNumber: Index, columnNumber: Index): void;
@@ -828,6 +834,8 @@ export declare function _BinaryenTableSetInitial(table: TableRef, initial: Index
export declare function _BinaryenTableHasMax(table: TableRef): bool;
export declare function _BinaryenTableGetMax(table: TableRef): Index;
export declare function _BinaryenTableSetMax(table: TableRef, max: Index): void;
+export declare function _BinaryenTableGetType(table: TableRef): TypeRef;
+export declare function _BinaryenTableSetType(table: TableRef, type: TypeRef): void;
export declare function _BinaryenAddActiveElementSegment(module: ModuleRef, table: StringRef, name: StringRef, funcNames: ArrayRef, numFuncNames: Index, offset: ExpressionRef): ElementSegmentRef;
export declare function _BinaryenAddPassiveElementSegment(module: ModuleRef, name: StringRef, funcNames: ArrayRef, numFuncNames: Index): ElementSegmentRef;
@@ -836,13 +844,15 @@ export declare function _BinaryenGetNumElementSegments(module: ModuleRef, name:
export declare function _BinaryenGetElementSegment(module: ModuleRef, name: StringRef): ElementSegmentRef;
export declare function _BinaryenGetElementSegmentByIndex(module: ModuleRef, index: Index): ElementSegmentRef;
-export declare function _BinaryenSetMemory(module: ModuleRef, initial: Index, maximum: Index, exportName: StringRef, segments: ArrayRef>, segmentPassive: ArrayRef, segmentOffsets: ArrayRef, segmentSizes: ArrayRef, numSegments: Index, shared: bool, memory64: bool, name: StringRef): void;
+export declare function _BinaryenSetMemory(module: ModuleRef, initial: Index, maximum: Index, exportName: StringRef, segmentNames: ArrayRef, segmentDatas: ArrayRef>, segmentPassive: ArrayRef, segmentOffsets: ArrayRef, segmentSizes: ArrayRef, numSegments: Index, shared: bool, memory64: bool, name: StringRef): void;
export declare function _BinaryenGetNumMemorySegments(module: ModuleRef): Index;
-export declare function _BinaryenGetMemorySegmentByteOffset(module: ModuleRef, index: Index): u32;
-export declare function _BinaryenGetMemorySegmentByteLength(module: ModuleRef, id: Index): usize;
-export declare function _BinaryenCopyMemorySegmentData(module: ModuleRef, id: Index, buffer: ArrayRef): void;
+export declare function _BinaryenGetMemorySegmentByteOffset(module: ModuleRef, segmentName: StringRef): u32;
+export declare function _BinaryenGetMemorySegmentByteLength(module: ModuleRef, segmentName: StringRef): usize;
+export declare function _BinaryenCopyMemorySegmentData(module: ModuleRef, segmentName: StringRef, buffer: ArrayRef): void;
+export declare function _BinaryenAddDataSegment(module: ModuleRef, segmentName: StringRef, memoryName: StringRef, segmentPassive: bool, segmentOffset: ExpressionRef, segmentData: ArrayRef, segmentSize: Index): void;
export declare function _BinaryenSetStart(module: ModuleRef, start: FunctionRef): void;
+export declare function _BinaryenGetStart(module: ModuleRef): FunctionRef;
export declare function _BinaryenModuleParse(text: StringRef): ModuleRef;
export declare function _BinaryenModulePrint(module: ModuleRef): void;
@@ -850,12 +860,12 @@ export declare function _BinaryenModulePrintAsmjs(module: ModuleRef): void;
export declare function _BinaryenModuleValidate(module: ModuleRef): i32;
export declare function _BinaryenModuleOptimize(module: ModuleRef): void;
export declare function _BinaryenModuleRunPasses(module: ModuleRef, passes: ArrayRef, numPasses: Index): void;
-export declare function _BinaryenModuleAutoDrop(module: ModuleRef): void;
export declare function _BinaryenSizeofAllocateAndWriteResult(): i32;
export declare function _BinaryenModuleAllocateAndWrite(resultOut: BinaryenModuleAllocateAndWriteResultRef, module: ModuleRef, sourceMapUrl: StringRef): void;
export declare function _BinaryenModuleAllocateAndWriteText(module: ModuleRef): StringRef;
-export declare function _BinaryenModuleAllocateAndWriteStackIR(module: ModuleRef, optimize: bool): StringRef;
+export declare function _BinaryenModuleAllocateAndWriteStackIR(module: ModuleRef): StringRef;
export declare function _BinaryenModuleRead(input: ArrayRef, inputSize: usize): ModuleRef;
+export declare function _BinaryenModuleReadWithFeatures(input: ArrayRef, inputSize: usize, featureFlags: FeatureFlags): ModuleRef;
export declare function _BinaryenModuleInterpret(module: ModuleRef): void;
export declare function _BinaryenModuleAddDebugInfoFileName(module: ModuleRef, filename: StringRef): Index;
export declare function _BinaryenModuleGetDebugInfoFileName(module: ModuleRef, index: Index): StringRef;
@@ -881,16 +891,14 @@ export declare function _ExpressionRunnerRunAndDispose(runner: ExpressionRunnerR
export declare function _TypeBuilderCreate(size: Index): TypeBuilderRef;
export declare function _TypeBuilderGrow(builder: TypeBuilderRef, count: Index): void;
export declare function _TypeBuilderGetSize(builder: TypeBuilderRef): Index;
-export declare function _TypeBuilderSetBasicHeapType(builder: TypeBuilderRef, index: Index, basicHeapType: HeapTypeRef): void;
export declare function _TypeBuilderSetSignatureType(builder: TypeBuilderRef, index: Index, paramTypes: TypeRef, resultTypes: TypeRef): void;
export declare function _TypeBuilderSetStructType(builder: TypeBuilderRef, index: Index, fieldTypes: ArrayRef, fieldPackedTypes: ArrayRef, fieldMutables: ArrayRef, numFields: i32): void;
export declare function _TypeBuilderSetArrayType(builder: TypeBuilderRef, index: Index, elementType: TypeRef, elementPackedTyype: PackedType, elementMutable: bool): void;
-export declare function _TypeBuilderIsBasic(builder: TypeBuilderRef, index: Index): bool;
-export declare function _TypeBuilderGetBasic(builder: TypeBuilderRef, index: Index): HeapTypeRef;
export declare function _TypeBuilderGetTempHeapType(builder: TypeBuilderRef, index: Index): HeapTypeRef;
export declare function _TypeBuilderGetTempTupleType(builder: TypeBuilderRef, types: ArrayRef, numTypes: Index): TypeRef;
export declare function _TypeBuilderGetTempRefType(builder: TypeBuilderRef, heapType: HeapTypeRef, nullable: bool): TypeRef;
export declare function _TypeBuilderSetSubType(builder: TypeBuilderRef, index: Index, superType: HeapTypeRef): void;
+export declare function _TypeBuilderSetOpen(builder: TypeBuilderRef, index: Index): void;
export declare function _TypeBuilderCreateRecGroup(builder: TypeBuilderRef, index: Index, length: Index): void;
export declare function _TypeBuilderBuildAndDispose(builder: TypeBuilderRef, heapTypes: ArrayRef, errorIndex: Pointer, errorReason: Pointer): bool;
export declare function _BinaryenModuleSetTypeName(module: ModuleRef, heapType: HeapTypeRef, name: StringRef): void;
@@ -902,15 +910,26 @@ export declare function _BinaryenGetShrinkLevel(): i32;
export declare function _BinaryenSetShrinkLevel(level: i32): void;
export declare function _BinaryenGetDebugInfo(): bool;
export declare function _BinaryenSetDebugInfo(on: bool): void;
+export declare function _BinaryenGetTrapsNeverHappen(): bool;
+export declare function _BinaryenSetTrapsNeverHappen(on: bool): void;
+export declare function _BinaryenGetClosedWorld(): bool;
+export declare function _BinaryenSetClosedWorld(on: bool): void;
export declare function _BinaryenGetLowMemoryUnused(): bool;
export declare function _BinaryenSetLowMemoryUnused(on: bool): void;
export declare function _BinaryenGetZeroFilledMemory(): bool;
export declare function _BinaryenSetZeroFilledMemory(on: bool): void;
export declare function _BinaryenGetFastMath(): bool;
export declare function _BinaryenSetFastMath(on: bool): void;
+export declare function _BinaryenGetGenerateStackIR(): bool;
+export declare function _BinaryenSetGenerateStackIR(on: bool): void;
+export declare function _BinaryenGetOptimizeStackIR(): bool;
+export declare function _BinaryenSetOptimizeStackIR(on: bool): void;
export declare function _BinaryenGetPassArgument(key: StringRef): StringRef;
export declare function _BinaryenSetPassArgument(key: StringRef, value: StringRef): void;
export declare function _BinaryenClearPassArguments(): void;
+export declare function _BinaryenHasPassToSkip(pass: StringRef): bool;
+export declare function _BinaryenAddPassToSkip(pass: StringRef): void;
+export declare function _BinaryenClearPassesToSkip(): void;
export declare function _BinaryenGetAlwaysInlineMaxSize(): Index;
export declare function _BinaryenSetAlwaysInlineMaxSize(size: Index): void;
export declare function _BinaryenGetFlexibleInlineMaxSize(): Index;
@@ -919,8 +938,6 @@ export declare function _BinaryenGetOneCallerInlineMaxSize(): Index;
export declare function _BinaryenSetOneCallerInlineMaxSize(size: Index): void;
export declare function _BinaryenGetAllowInliningFunctionsWithLoops(): bool;
export declare function _BinaryenSetAllowInliningFunctionsWithLoops(enabled: bool): void;
-export declare function _BinaryenGetTypeSystem(): TypeSystem;
-export declare function _BinaryenSetTypeSystem(typeSystem: TypeSystem): void;
// Helpers
diff --git a/src/glue/binaryen.js b/src/glue/binaryen.js
index fe503e6f5c..295afb7635 100644
--- a/src/glue/binaryen.js
+++ b/src/glue/binaryen.js
@@ -21,9 +21,6 @@ export const {
_BinaryenTypeStructref,
_BinaryenTypeArrayref,
_BinaryenTypeStringref,
- _BinaryenTypeStringviewWTF8,
- _BinaryenTypeStringviewWTF16,
- _BinaryenTypeStringviewIter,
_BinaryenTypeNullref,
_BinaryenTypeNullExternref,
_BinaryenTypeNullFuncref,
@@ -35,10 +32,8 @@ export const {
_BinaryenHeapTypeI31,
_BinaryenHeapTypeStruct,
_BinaryenHeapTypeArray,
+ // _BinaryenHeapTypeExn,
_BinaryenHeapTypeString,
- _BinaryenHeapTypeStringviewWTF8,
- _BinaryenHeapTypeStringviewWTF16,
- _BinaryenHeapTypeStringviewIter,
_BinaryenHeapTypeNone,
_BinaryenHeapTypeNoext,
_BinaryenHeapTypeNofunc,
@@ -504,9 +499,9 @@ export const {
_BinaryenPop,
- _BinaryenI31New,
- _BinaryenI31NewGetValue,
- _BinaryenI31NewSetValue,
+ _BinaryenRefI31,
+ _BinaryenRefI31GetValue,
+ _BinaryenRefI31SetValue,
_BinaryenI31Get,
_BinaryenI31GetGetI31,
@@ -576,13 +571,29 @@ export const {
_BinaryenArrayNewGetSize,
_BinaryenArrayNewSetSize,
- _BinaryenArrayInit,
- _BinaryenArrayInitGetNumValues,
- _BinaryenArrayInitGetValueAt,
- _BinaryenArrayInitSetValueAt,
- _BinaryenArrayInitAppendValue,
- _BinaryenArrayInitInsertValueAt,
- _BinaryenArrayInitRemoveValueAt,
+ _BinaryenArrayNewFixed,
+ _BinaryenArrayNewFixedGetNumValues,
+ _BinaryenArrayNewFixedGetValueAt,
+ _BinaryenArrayNewFixedSetValueAt,
+ _BinaryenArrayNewFixedAppendValue,
+ _BinaryenArrayNewFixedInsertValueAt,
+ _BinaryenArrayNewFixedRemoveValueAt,
+
+ _BinaryenArrayNewData,
+ _BinaryenArrayNewDataGetSegment,
+ _BinaryenArrayNewDataSetSegment,
+ _BinaryenArrayNewDataGetOffset,
+ _BinaryenArrayNewDataSetOffset,
+ _BinaryenArrayNewDataGetSize,
+ _BinaryenArrayNewDataSetSize,
+
+ _BinaryenArrayNewElem,
+ _BinaryenArrayNewElemGetSegment,
+ _BinaryenArrayNewElemSetSegment,
+ _BinaryenArrayNewElemGetOffset,
+ _BinaryenArrayNewElemSetOffset,
+ _BinaryenArrayNewElemGetSize,
+ _BinaryenArrayNewElemSetSize,
_BinaryenArrayGet,
_BinaryenArrayGetGetRef,
@@ -604,6 +615,16 @@ export const {
_BinaryenArrayLenGetRef,
_BinaryenArrayLenSetRef,
+ _BinaryenArrayFill,
+ _BinaryenArrayFillGetRef,
+ _BinaryenArrayFillSetRef,
+ _BinaryenArrayFillGetIndex,
+ _BinaryenArrayFillSetIndex,
+ _BinaryenArrayFillGetValue,
+ _BinaryenArrayFillSetValue,
+ _BinaryenArrayFillGetSize,
+ _BinaryenArrayFillSetSize,
+
_BinaryenArrayCopy,
_BinaryenArrayCopyGetDestRef,
_BinaryenArrayCopySetDestRef,
@@ -616,19 +637,39 @@ export const {
_BinaryenArrayCopyGetLength,
_BinaryenArrayCopySetLength,
+ _BinaryenArrayInitData,
+ _BinaryenArrayInitDataGetSegment,
+ _BinaryenArrayInitDataSetSegment,
+ _BinaryenArrayInitDataGetRef,
+ _BinaryenArrayInitDataSetRef,
+ _BinaryenArrayInitDataGetIndex,
+ _BinaryenArrayInitDataSetIndex,
+ _BinaryenArrayInitDataGetOffset,
+ _BinaryenArrayInitDataSetOffset,
+ _BinaryenArrayInitDataGetSize,
+ _BinaryenArrayInitDataSetSize,
+
+ _BinaryenArrayInitElem,
+ _BinaryenArrayInitElemGetSegment,
+ _BinaryenArrayInitElemSetSegment,
+ _BinaryenArrayInitElemGetRef,
+ _BinaryenArrayInitElemSetRef,
+ _BinaryenArrayInitElemGetIndex,
+ _BinaryenArrayInitElemSetIndex,
+ _BinaryenArrayInitElemGetOffset,
+ _BinaryenArrayInitElemSetOffset,
+ _BinaryenArrayInitElemGetSize,
+ _BinaryenArrayInitElemSetSize,
+
_BinaryenStringNew,
_BinaryenStringNewGetOp,
_BinaryenStringNewSetOp,
- _BinaryenStringNewGetPtr,
- _BinaryenStringNewSetPtr,
- _BinaryenStringNewGetLength,
- _BinaryenStringNewSetLength,
+ _BinaryenStringNewGetRef,
+ _BinaryenStringNewSetRef,
_BinaryenStringNewGetStart,
_BinaryenStringNewSetStart,
_BinaryenStringNewGetEnd,
_BinaryenStringNewSetEnd,
- _BinaryenStringNewIsTry,
- _BinaryenStringNewSetTry,
_BinaryenStringConst,
_BinaryenStringConstGetString,
@@ -643,10 +684,10 @@ export const {
_BinaryenStringEncode,
_BinaryenStringEncodeGetOp,
_BinaryenStringEncodeSetOp,
- _BinaryenStringEncodeGetRef,
- _BinaryenStringEncodeSetRef,
- _BinaryenStringEncodeGetPtr,
- _BinaryenStringEncodeSetPtr,
+ _BinaryenStringEncodeGetStr,
+ _BinaryenStringEncodeSetStr,
+ _BinaryenStringEncodeGetArray,
+ _BinaryenStringEncodeSetArray,
_BinaryenStringEncodeGetStart,
_BinaryenStringEncodeSetStart,
@@ -664,41 +705,13 @@ export const {
_BinaryenStringEqGetRight,
_BinaryenStringEqSetRight,
- _BinaryenStringAs,
- _BinaryenStringAsGetOp,
- _BinaryenStringAsSetOp,
- _BinaryenStringAsGetRef,
- _BinaryenStringAsSetRef,
-
- _BinaryenStringWTF8Advance,
- _BinaryenStringWTF8AdvanceGetRef,
- _BinaryenStringWTF8AdvanceSetRef,
- _BinaryenStringWTF8AdvanceGetPos,
- _BinaryenStringWTF8AdvanceSetPos,
- _BinaryenStringWTF8AdvanceGetBytes,
- _BinaryenStringWTF8AdvanceSetBytes,
-
_BinaryenStringWTF16Get,
_BinaryenStringWTF16GetGetRef,
_BinaryenStringWTF16GetSetRef,
_BinaryenStringWTF16GetGetPos,
_BinaryenStringWTF16GetSetPos,
- _BinaryenStringIterNext,
- _BinaryenStringIterNextGetRef,
- _BinaryenStringIterNextSetRef,
-
- _BinaryenStringIterMove,
- _BinaryenStringIterMoveGetOp,
- _BinaryenStringIterMoveSetOp,
- _BinaryenStringIterMoveGetRef,
- _BinaryenStringIterMoveSetRef,
- _BinaryenStringIterMoveGetNum,
- _BinaryenStringIterMoveSetNum,
-
_BinaryenStringSliceWTF,
- _BinaryenStringSliceWTFGetOp,
- _BinaryenStringSliceWTFSetOp,
_BinaryenStringSliceWTFGetRef,
_BinaryenStringSliceWTFSetRef,
_BinaryenStringSliceWTFGetStart,
@@ -706,12 +719,6 @@ export const {
_BinaryenStringSliceWTFGetEnd,
_BinaryenStringSliceWTFSetEnd,
- _BinaryenStringSliceIter,
- _BinaryenStringSliceIterGetRef,
- _BinaryenStringSliceIterSetRef,
- _BinaryenStringSliceIterGetNum,
- _BinaryenStringSliceIterSetNum,
-
_BinaryenAddFunction,
_BinaryenGetFunction,
_BinaryenRemoveFunction,
@@ -723,12 +730,15 @@ export const {
_BinaryenFunctionGetResults,
_BinaryenFunctionGetNumVars,
_BinaryenFunctionGetVar,
+ _BinaryenFunctionAddVar,
_BinaryenFunctionGetNumLocals,
_BinaryenFunctionHasLocalName,
_BinaryenFunctionGetLocalName,
_BinaryenFunctionSetLocalName,
_BinaryenFunctionGetBody,
_BinaryenFunctionSetBody,
+ _BinaryenFunctionGetType,
+ _BinaryenFunctionSetType,
_BinaryenFunctionOptimize,
_BinaryenFunctionRunPasses,
_BinaryenFunctionSetDebugLocation,
@@ -784,6 +794,8 @@ export const {
_BinaryenTableHasMax,
_BinaryenTableGetMax,
_BinaryenTableSetMax,
+ _BinaryenTableGetType,
+ _BinaryenTableSetType,
_BinaryenAddActiveElementSegment,
_BinaryenAddPassiveElementSegment,
@@ -797,8 +809,10 @@ export const {
_BinaryenGetMemorySegmentByteOffset,
_BinaryenGetMemorySegmentByteLength,
_BinaryenCopyMemorySegmentData,
+ _BinaryenAddDataSegment,
_BinaryenSetStart,
+ _BinaryenGetStart,
_BinaryenModuleParse,
_BinaryenModulePrint,
@@ -806,12 +820,12 @@ export const {
_BinaryenModuleValidate,
_BinaryenModuleOptimize,
_BinaryenModuleRunPasses,
- _BinaryenModuleAutoDrop,
_BinaryenSizeofAllocateAndWriteResult,
_BinaryenModuleAllocateAndWrite,
_BinaryenModuleAllocateAndWriteText,
_BinaryenModuleAllocateAndWriteStackIR,
_BinaryenModuleRead,
+ _BinaryenModuleReadWithFeatures,
_BinaryenModuleInterpret,
_BinaryenModuleAddDebugInfoFileName,
_BinaryenModuleGetDebugInfoFileName,
@@ -837,16 +851,14 @@ export const {
_TypeBuilderCreate,
_TypeBuilderGrow,
_TypeBuilderGetSize,
- _TypeBuilderSetBasicHeapType,
_TypeBuilderSetSignatureType,
_TypeBuilderSetStructType,
_TypeBuilderSetArrayType,
- _TypeBuilderIsBasic,
- _TypeBuilderGetBasic,
_TypeBuilderGetTempHeapType,
_TypeBuilderGetTempTupleType,
_TypeBuilderGetTempRefType,
_TypeBuilderSetSubType,
+ _TypeBuilderSetOpen,
_TypeBuilderCreateRecGroup,
_TypeBuilderBuildAndDispose,
_BinaryenModuleSetTypeName,
@@ -858,15 +870,26 @@ export const {
_BinaryenSetShrinkLevel,
_BinaryenGetDebugInfo,
_BinaryenSetDebugInfo,
+ _BinaryenGetTrapsNeverHappen,
+ _BinaryenSetTrapsNeverHappen,
+ _BinaryenGetClosedWorld,
+ _BinaryenSetClosedWorld,
_BinaryenGetLowMemoryUnused,
_BinaryenSetLowMemoryUnused,
_BinaryenGetZeroFilledMemory,
_BinaryenSetZeroFilledMemory,
_BinaryenGetFastMath,
_BinaryenSetFastMath,
+ _BinaryenGetGenerateStackIR,
+ _BinaryenSetGenerateStackIR,
+ _BinaryenGetOptimizeStackIR,
+ _BinaryenSetOptimizeStackIR,
_BinaryenGetPassArgument,
_BinaryenSetPassArgument,
_BinaryenClearPassArguments,
+ _BinaryenHasPassToSkip,
+ _BinaryenAddPassToSkip,
+ _BinaryenClearPassesToSkip,
_BinaryenGetAlwaysInlineMaxSize,
_BinaryenSetAlwaysInlineMaxSize,
_BinaryenGetFlexibleInlineMaxSize,
@@ -875,8 +898,6 @@ export const {
_BinaryenSetOneCallerInlineMaxSize,
_BinaryenGetAllowInliningFunctionsWithLoops,
_BinaryenSetAllowInliningFunctionsWithLoops,
- _BinaryenGetTypeSystem,
- _BinaryenSetTypeSystem,
// Helpers
diff --git a/src/glue/js/float.d.ts b/src/glue/js/float.d.ts
index 8694f03b52..b116ad846c 100644
--- a/src/glue/js/float.d.ts
+++ b/src/glue/js/float.d.ts
@@ -7,3 +7,4 @@ declare function f32_as_i32(value: f32): i32;
declare function i32_as_f32(value: i32): f32;
declare function f64_as_i64(value: f64): i64;
declare function i64_as_f64(value: i64): f64;
+declare function f64_pow(value: f64, exponent: f64): f64;
diff --git a/src/glue/js/float.js b/src/glue/js/float.js
index 090af6cf96..6b68fdfef1 100644
--- a/src/glue/js/float.js
+++ b/src/glue/js/float.js
@@ -3,6 +3,8 @@
* @license Apache-2.0
*/
+import { f64_pow } from "as-float";
+
/* eslint-disable no-undef */
const F64 = new Float64Array(1);
@@ -29,3 +31,5 @@ globalThis.i64_as_f64 = function i64_as_f64(value) {
I32[1] = i64_high(value);
return F64[0];
};
+
+globalThis.f64_pow = f64_pow;
diff --git a/src/index-wasm.ts b/src/index-wasm.ts
index a43202657d..ec51de73da 100644
--- a/src/index-wasm.ts
+++ b/src/index-wasm.ts
@@ -23,7 +23,8 @@ import {
import {
Compiler,
Options,
- UncheckedBehavior
+ UncheckedBehavior,
+ defaultFeatures
} from "./compiler";
import {
@@ -201,15 +202,14 @@ export const FEATURE_RELAXED_SIMD = Feature.RelaxedSimd;
export const FEATURE_EXTENDED_CONST = Feature.ExtendedConst;
/** String references. */
export const FEATURE_STRINGREF = Feature.Stringref;
-
-/** Enables a specific feature. */
-export function enableFeature(options: Options, feature: Feature): void {
- options.features |= feature;
-}
-
-/** Disables a specific feature. */
-export function disableFeature(options: Options, feature: Feature): void {
- options.features &= ~feature;
+/** All features. */
+export const FEATURES_ALL = Feature.All;
+/** Default features. */
+export const FEATURES_DEFAULT = defaultFeatures;
+
+/** Sets whether a specific feature is enabled. */
+export function setFeature(options: Options, feature: Feature, on: bool): void {
+ options.setFeature(feature, on);
}
/** Gives the compiler a hint at the optimize levels that will be used later on. */
diff --git a/src/module.ts b/src/module.ts
index 3beecf5f70..2719f60c50 100644
--- a/src/module.ts
+++ b/src/module.ts
@@ -78,9 +78,6 @@ export namespace TypeRef {
export const Arrayref = binaryen._BinaryenTypeArrayref();
export const I31ref = binaryen._BinaryenTypeI31ref();
export const Stringref = binaryen._BinaryenTypeStringref();
- export const StringviewWTF8 = binaryen._BinaryenTypeStringviewWTF8();
- export const StringviewWTF16 = binaryen._BinaryenTypeStringviewWTF16();
- export const StringviewIter = binaryen._BinaryenTypeStringviewIter();
export const Noneref = binaryen._BinaryenTypeNullref();
export const Nofuncref = binaryen._BinaryenTypeNullFuncref();
export const Noexternref = binaryen._BinaryenTypeNullExternref();
@@ -102,20 +99,18 @@ export namespace HeapTypeRef {
//
// where (...) represents the concrete subtypes
- export const Extern: HeapTypeRef = 0 /* _BinaryenHeapTypeExt */;
- export const Func: HeapTypeRef = 1 /* _BinaryenHeapTypeFunc */;
- export const Any: HeapTypeRef = 2 /* _BinaryenHeapTypeAny */;
- export const Eq: HeapTypeRef = 3 /* _BinaryenHeapTypeEq */;
- export const I31: HeapTypeRef = 4 /* _BinaryenHeapTypeI31 */;
- export const Struct: HeapTypeRef = 5 /* _BinaryenHeapTypeStruct */;
- export const Array: HeapTypeRef = 6 /* _BinaryenHeapTypeArray */;
- export const String: HeapTypeRef = 7 /* _BinaryenHeapTypeString */;
- export const StringviewWTF8: HeapTypeRef = 8 /* _BinaryenHeapTypeStringviewWTF8 */;
- export const StringviewWTF16: HeapTypeRef = 9 /* _BinaryenHeapTypeStringviewWTF16 */;
- export const StringviewIter: HeapTypeRef = 10 /* _BinaryenHeapTypeStringviewIter */;
- export const None: HeapTypeRef = 11 /* _BinaryenHeapTypeNone */;
- export const Noextern: HeapTypeRef = 12 /* _BinaryenHeapTypeNoext */;
- export const Nofunc: HeapTypeRef = 13 /* _BinaryenHeapTypeNofunc */;
+ export const Extern: HeapTypeRef = 8 /* _BinaryenHeapTypeExt */;
+ export const Func: HeapTypeRef = 16 /* _BinaryenHeapTypeFunc */;
+ export const Any: HeapTypeRef = 32 /* _BinaryenHeapTypeAny */;
+ export const Eq: HeapTypeRef = 40 /* _BinaryenHeapTypeEq */;
+ export const I31: HeapTypeRef = 48 /* _BinaryenHeapTypeI31 */;
+ export const Struct: HeapTypeRef = 56 /* _BinaryenHeapTypeStruct */;
+ export const Array: HeapTypeRef = 64 /* _BinaryenHeapTypeArray */;
+ export const Exn: HeapTypeRef = 7 /* TODO: BinaryenHeapTypeExn */;
+ export const String: HeapTypeRef = 80 /* _BinaryenHeapTypeString */;
+ export const None: HeapTypeRef = 88 /* _BinaryenHeapTypeNone */;
+ export const Noextern: HeapTypeRef = 96 /* _BinaryenHeapTypeNoext */;
+ export const Nofunc: HeapTypeRef = 104 /* _BinaryenHeapTypeNofunc */;
export function isBottom(ht: HeapTypeRef): bool {
return binaryen._BinaryenHeapTypeIsBottom(ht);
@@ -141,7 +136,7 @@ export namespace HeapTypeRef {
b = t;
}
switch (a) {
- case HeapTypeRef.Extern:
+ case HeapTypeRef.Extern: return b == HeapTypeRef.String ? a : -1;
case HeapTypeRef.Func: return -1;
case HeapTypeRef.Any: return a;
case HeapTypeRef.Eq: {
@@ -159,11 +154,7 @@ export namespace HeapTypeRef {
? HeapTypeRef.Eq
: HeapTypeRef.Any;
}
- case HeapTypeRef.Array:
- case HeapTypeRef.String:
- case HeapTypeRef.StringviewWTF8:
- case HeapTypeRef.StringviewWTF16:
- case HeapTypeRef.StringviewIter: return HeapTypeRef.Any;
+ case HeapTypeRef.Array: return HeapTypeRef.Any;
}
assert(false);
return -1;
@@ -202,13 +193,6 @@ export namespace TypeBuilderErrorReason {
}
}
-/** Type system constants. */
-export type TypeSystem = binaryen.TypeSystem;
-export namespace TypeSystem {
- export const Isorecursive: TypeSystem = 0 /* _BinaryenTypeSystemIsorecursive */;
- export const Nominal: TypeSystem = 1 /* _BinaryenTypeSystemNominal */;
-}
-
/** Binaryen feature constants. */
export const enum FeatureFlags {
MVP = 0 /* _BinaryenFeatureMVP */,
@@ -224,14 +208,19 @@ export const enum FeatureFlags {
MultiValue = 512 /* _BinaryenFeatureMultivalue */,
GC = 1024 /* _BinaryenFeatureGC */,
Memory64 = 2048 /* _BinaryenFeatureMemory64 */,
- RelaxedSIMD = 8192 /* _BinaryenFeatureRelaxedSIMD */,
- ExtendedConst = 16384 /* _BinaryenFeatureExtendedConst */,
- Stringref = 32768 /* _BinaryenFeatureStrings */,
- MultiMemory = 65536 /* _BinaryenFeatureMultiMemories */,
- All = 126975 /* _BinaryenFeatureAll */
-}
-
-/** Binaryen expression id constants. */
+ RelaxedSIMD = 4096 /* _BinaryenFeatureRelaxedSIMD */,
+ ExtendedConst = 8192 /* _BinaryenFeatureExtendedConst */,
+ Stringref = 16384 /* _BinaryenFeatureStrings */,
+ MultiMemory = 32768 /* _BinaryenFeatureMultiMemory */,
+ StackSwitching = 65536 /* _BinaryenFeatureStackSwitching */,
+ SharedEverything = 131072 /* _BinaryenFeatureSharedEverything */,
+ FP16 = 262144 /* _BinaryenFeatureFP16 */,
+ BulkMemoryOpt = 524288 /* _BinaryenFeatureBulkMemoryOpt */,
+ CallIndirectOverlong = 1048576 /* _BinaryenFeatureCallIndirectOverlong */,
+ All = 4194303 /* _BinaryenFeatureAll */
+}
+
+/** Binaryen expression id constants. See wasm-delegations.def in Binaryen. */
export const enum ExpressionId {
Invalid = 0 /* _BinaryenInvalidId */,
Block = 1 /* _BinaryenBlockId */,
@@ -282,41 +271,54 @@ export const enum ExpressionId {
TableSet = 46 /* _BinaryenTableSetId */,
TableSize = 47 /* _BinaryenTableSizeId */,
TableGrow = 48 /* _BinaryenTableGrowId */,
- Try = 49 /* _BinaryenTryId */,
- Throw = 50 /* _BinaryenThrowId */,
- Rethrow = 51 /* _BinaryenRethrowId */,
- TupleMake = 52 /* _BinaryenTupleMakeId */,
- TupleExtract = 53 /* _BinaryenTupleExtractId */,
- I31New = 54 /* _BinaryenI31NewId */,
- I31Get = 55 /* _BinaryenI31GetId */,
- CallRef = 56 /* _BinaryenCallRefId */,
- RefTest = 57 /* _BinaryenRefTestId */,
- RefCast = 58 /* _BinaryenRefCastId */,
- BrOn = 59 /* _BinaryenBrOnId */,
- StructNew = 60 /* _BinaryenStructNewId */,
- StructGet = 61 /* _BinaryenStructGetId */,
- StructSet = 62 /* _BinaryenStructSetId */,
- ArrayNew = 63 /* _BinaryenArrayNewId */,
- ArrayNewSeg = 64 /* TODO_BinaryenArraySegId */,
- ArrayInit = 65 /* _BinaryenArrayInitId */,
- ArrayGet = 66 /* _BinaryenArrayGetId */,
- ArraySet = 67 /* _BinaryenArraySetId */,
- ArrayLen = 68 /* _BinaryenArrayLenId */,
- ArrayCopy = 69 /* _BinaryenArrayCopyId */,
- RefAs = 70 /* _BinaryenRefAsId */,
- StringNew = 71 /* _BinaryenStringNewId */,
- StringConst = 72 /* _BinaryenStringConstId */,
- StringMeasure = 73 /* _BinaryenStringMeasureId */,
- StringEncode = 74 /* _BinaryenStringEncodeId */,
- StringConcat = 75 /* _BinaryenStringConcatId */,
- StringEq = 76 /* _BinaryenStringEqId */,
- StringAs = 77 /* _BinaryenStringAsId */,
- StringWTF8Advance = 78 /* _BinaryenStringWTF8AdvanceId */,
- StringWTF16Get = 79 /* _BinaryenStringWTF16GetId */,
- StringIterNext = 80 /* _BinaryenStringIterNextId */,
- StringIterMove = 81 /* _BinaryenStringIterMoveId */,
- StringSliceWTF = 82 /* _BinaryenStringSliceWTFId */,
- StringSliceIter = 83 /* _BinaryenStringSliceIterId */
+ TableFill = 49 /* _BinaryenTableFillId */,
+ TableCopy = 50 /* _BinaryenTableCopyId */,
+ TableInit = 51 /* _BinaryenTableInitId */,
+ Try = 52 /* _BinaryenTryId */,
+ TryTable = 53 /* _BinaryenTryTableId */,
+ Throw = 54 /* _BinaryenThrowId */,
+ Rethrow = 55 /* _BinaryenRethrowId */,
+ ThrowRef = 56 /* _BinaryenThrowRefId */,
+ TupleMake = 57 /* _BinaryenTupleMakeId */,
+ TupleExtract = 58 /* _BinaryenTupleExtractId */,
+ RefI31 = 59 /* _BinaryenRefI31Id */,
+ I31Get = 60 /* _BinaryenI31GetId */,
+ CallRef = 61 /* _BinaryenCallRefId */,
+ RefTest = 62 /* _BinaryenRefTestId */,
+ RefCast = 63 /* _BinaryenRefCastId */,
+ RefGetDesc = 64 /* _BinaryenRefGetDescId */,
+ BrOn = 65 /* _BinaryenBrOnId */,
+ StructNew = 66 /* _BinaryenStructNewId */,
+ StructGet = 67 /* _BinaryenStructGetId */,
+ StructSet = 68 /* _BinaryenStructSetId */,
+ StructRMW = 69 /* _BinaryenStructRMWId */,
+ StructCmpxchg = 70 /* _BinaryenStructCmpxchgId */,
+ ArrayNew = 71 /* _BinaryenArrayNewId */,
+ ArrayNewData = 72 /* _BinaryenArrayNewDataId */,
+ ArrayNewElem = 73 /* _BinaryenArrayNewElemId */,
+ ArrayNewFixed = 74 /* _BinaryenArrayNewFixedId */,
+ ArrayGet = 75 /* _BinaryenArrayGetId */,
+ ArraySet = 76 /* _BinaryenArraySetId */,
+ ArrayLen = 77 /* _BinaryenArrayLenId */,
+ ArrayCopy = 78 /* _BinaryenArrayCopyId */,
+ ArrayFill = 79 /* _BinaryenArrayFillId */,
+ ArrayInitData = 80 /* _BinaryenArrayInitDataId */,
+ ArrayInitElem = 81 /* _BinaryenArrayInitElemId */,
+ RefAs = 82 /* _BinaryenRefAsId */,
+ StringNew = 83 /* _BinaryenStringNewId */,
+ StringConst = 84 /* _BinaryenStringConstId */,
+ StringMeasure = 85 /* _BinaryenStringMeasureId */,
+ StringEncode = 86 /* _BinaryenStringEncodeId */,
+ StringConcat = 87 /* _BinaryenStringConcatId */,
+ StringEq = 88 /* _BinaryenStringEqId */,
+ StringWTF16Get = 89 /* _BinaryenStringWTF16GetId */,
+ StringSliceWTF = 90 /* _BinaryenStringSliceWTFId */,
+ ContNew = 91 /* _BinaryenContNewId */,
+ ContBind = 92 /* _BinaryenContBindId */,
+ Suspend = 93 /* _BinaryenSuspendId */,
+ Resume = 94 /* _BinaryenResumeId */,
+ ResumeThrow = 95 /* _BinaryenResumeThrowId */,
+ StackSwitch = 96 /* _BinaryenStackSwitchId */
}
/** Binaryen external kind constants. */
@@ -509,97 +511,95 @@ export const enum UnaryOp {
AllTrueI64x2 = 83 /* _BinaryenAllTrueVecI64x2 */,
/** i64x2.bitmask */
BitmaskI64x2 = 84 /* _BinaryenBitmaskVecI64x2 */,
+ // FIXME FIXME FIXME DONT FORGET TODO: F16 (not in C API yet)
/** f32x4.abs */
- AbsF32x4 = 85 /* _BinaryenAbsVecF32x4 */,
+ AbsF32x4 = 92 /* _BinaryenAbsVecF32x4 */,
/** f32x4.neg */
- NegF32x4 = 86 /* _BinaryenNegVecF32x4 */,
+ NegF32x4 = 93 /* _BinaryenNegVecF32x4 */,
/** f32x4.sqrt */
- SqrtF32x4 = 87 /* _BinaryenSqrtVecF32x4 */,
+ SqrtF32x4 = 94 /* _BinaryenSqrtVecF32x4 */,
/** f32x4.ceil */
- CeilF32x4 = 88 /* _BinaryenCeilVecF32x4 */,
+ CeilF32x4 = 95 /* _BinaryenCeilVecF32x4 */,
/** f32x4.floor */
- FloorF32x4 = 89 /* _BinaryenFloorVecF32x4 */,
+ FloorF32x4 = 96 /* _BinaryenFloorVecF32x4 */,
/** f32x4.trunc */
- TruncF32x4 = 90 /* BinaryenTruncVecF32x4 */,
+ TruncF32x4 = 97 /* _BinaryenTruncVecF32x4 */,
/** f32x4.nearest */
- NearestF32x4 = 91 /* BinaryenNearestVecF32x4 */,
+ NearestF32x4 = 98 /* _BinaryenNearestVecF32x4 */,
/** f64x2.abs */
- AbsF64x2 = 92 /* _BinaryenAbsVecF64x2 */,
+ AbsF64x2 = 99 /* _BinaryenAbsVecF64x2 */,
/** f64x2.neg */
- NegF64x2 = 93 /* _BinaryenNegVecF64x2 */,
+ NegF64x2 = 100 /* _BinaryenNegVecF64x2 */,
/** f64x2.sqrt */
- SqrtF64x2 = 94 /* _BinaryenSqrtVecF64x2 */,
+ SqrtF64x2 = 101 /* _BinaryenSqrtVecF64x2 */,
/** f64x2.ceil */
- CeilF64x2 = 95 /* _BinaryenCeilVecF64x2 */,
+ CeilF64x2 = 102 /* _BinaryenCeilVecF64x2 */,
/** f64x2.floor */
- FloorF64x2 = 96 /* _BinaryenFloorVecF64x2 */,
+ FloorF64x2 = 103 /* _BinaryenFloorVecF64x2 */,
/** f64x2.trunc */
- TruncF64x2 = 97 /* _BinaryenTruncVecF64x2 */,
+ TruncF64x2 = 104 /* _BinaryenTruncVecF64x2 */,
/** f64x2.nearest */
- NearestF64x2 = 98 /* _BinaryenNearestVecF64x2 */,
+ NearestF64x2 = 105 /* _BinaryenNearestVecF64x2 */,
/** i16x8.extadd_pairwise_i8x16_s */
- ExtaddPairwiseI8x16ToI16x8 = 99 /* _BinaryenExtAddPairwiseSVecI8x16ToI16x8 */,
+ ExtaddPairwiseI8x16ToI16x8 = 106 /* _BinaryenExtAddPairwiseSVecI8x16ToI16x8 */,
/** i16x8.extadd_pairwise.i8x16_u */
- ExtaddPairwiseU8x16ToU16x8 = 100 /* _BinaryenExtAddPairwiseUVecI8x16ToI16x8 */,
+ ExtaddPairwiseU8x16ToU16x8 = 107 /* _BinaryenExtAddPairwiseUVecI8x16ToI16x8 */,
/** i32x4.extadd_pairwise.i16x8_s */
- ExtaddPairwiseI16x8ToI32x4 = 101 /* _BinaryenExtAddPairwiseSVecI16x8ToI32x4 */,
+ ExtaddPairwiseI16x8ToI32x4 = 108 /* _BinaryenExtAddPairwiseSVecI16x8ToI32x4 */,
/** i32x4.extadd_pairwise.i64x8_u */
- ExtaddPairwiseU16x8ToU32x4 = 102 /* _BinaryenExtAddPairwiseUVecI16x8ToI32x4 */,
+ ExtaddPairwiseU16x8ToU32x4 = 109 /* _BinaryenExtAddPairwiseUVecI16x8ToI32x4 */,
/** i32x4.trunc_sat_f32x4_s */
- TruncSatF32x4ToI32x4 = 103 /* _BinaryenTruncSatSVecF32x4ToVecI32x4 */,
+ TruncSatF32x4ToI32x4 = 110 /* _BinaryenTruncSatSVecF32x4ToVecI32x4 */,
/** i32x4.trunc_sat_f32x4_u */
- TruncSatF32x4ToU32x4 = 104 /* _BinaryenTruncSatUVecF32x4ToVecI32x4 */,
+ TruncSatF32x4ToU32x4 = 111 /* _BinaryenTruncSatUVecF32x4ToVecI32x4 */,
/** f32x4.convert_i32x4_s */
- ConvertI32x4ToF32x4 = 105 /* _BinaryenConvertSVecI32x4ToVecF32x4 */,
+ ConvertI32x4ToF32x4 = 112 /* _BinaryenConvertSVecI32x4ToVecF32x4 */,
/** f32x4.convert_i32x4_u */
- ConvertU32x4ToF32x4 = 106 /* _BinaryenConvertUVecI32x4ToVecF32x4 */,
+ ConvertU32x4ToF32x4 = 113 /* _BinaryenConvertUVecI32x4ToVecF32x4 */,
/** i16x8.extend_low_i8x16_s */
- ExtendLowI8x16ToI16x8 = 107 /* _BinaryenExtendLowSVecI8x16ToVecI16x8 */,
+ ExtendLowI8x16ToI16x8 = 114 /* _BinaryenExtendLowSVecI8x16ToVecI16x8 */,
/** i16x8.extend_high_i8x16_s */
- ExtendHighI8x16ToI16x8 = 108 /* _BinaryenExtendHighSVecI8x16ToVecI16x8 */,
+ ExtendHighI8x16ToI16x8 = 115 /* _BinaryenExtendHighSVecI8x16ToVecI16x8 */,
/** i16x8.extend_low_i8x16_u */
- ExtendLowU8x16ToU16x8 = 109 /* _BinaryenExtendLowUVecI8x16ToVecI16x8 */,
+ ExtendLowU8x16ToU16x8 = 116 /* _BinaryenExtendLowUVecI8x16ToVecI16x8 */,
/** i16x8.extend_high_i8x16_u */
- ExtendHighU8x16ToU16x8 = 110 /* _BinaryenExtendHighUVecI8x16ToVecI16x8 */,
+ ExtendHighU8x16ToU16x8 = 117 /* _BinaryenExtendHighUVecI8x16ToVecI16x8 */,
/** i32x4.extend_low_i16x8_s */
- ExtendLowI16x8ToI32x4 = 111 /* _BinaryenExtendLowSVecI16x8ToVecI32x4 */,
+ ExtendLowI16x8ToI32x4 = 118 /* _BinaryenExtendLowSVecI16x8ToVecI32x4 */,
/** i32x4.extend_high_i16x8_s */
- ExtendHighI16x8ToI32x4 = 112 /* _BinaryenExtendHighSVecI16x8ToVecI32x4 */,
+ ExtendHighI16x8ToI32x4 = 119 /* _BinaryenExtendHighSVecI16x8ToVecI32x4 */,
/** i32x4.extend_low_i16x8_u */
- ExtendLowU16x8ToU32x4 = 113 /* _BinaryenExtendLowUVecI16x8ToVecI32x4 */,
+ ExtendLowU16x8ToU32x4 = 120 /* _BinaryenExtendLowUVecI16x8ToVecI32x4 */,
/** i32x4.extend_high_i16x8_u */
- ExtendHighU16x8ToU32x4 = 114 /* _BinaryenExtendHighUVecI16x8ToVecI32x4 */,
+ ExtendHighU16x8ToU32x4 = 121 /* _BinaryenExtendHighUVecI16x8ToVecI32x4 */,
/** i64x2.extend_low_i32x4_s */
- ExtendLowI32x4ToI64x2 = 115 /* _BinaryenExtendLowSVecI32x4ToVecI64x2 */,
+ ExtendLowI32x4ToI64x2 = 122 /* _BinaryenExtendLowSVecI32x4ToVecI64x2 */,
/** i64x2.extend_high_i32x4_s */
- ExtendHighI32x4ToI64x2 = 116 /* _BinaryenExtendHighSVecI32x4ToVecI64x2 */,
+ ExtendHighI32x4ToI64x2 = 123 /* _BinaryenExtendHighSVecI32x4ToVecI64x2 */,
/** i64x2.extend_low_i32x4_u */
- ExtendLowU32x4ToU64x2 = 117 /* _BinaryenExtendLowUVecI32x4ToVecI64x2 */,
+ ExtendLowU32x4ToU64x2 = 124 /* _BinaryenExtendLowUVecI32x4ToVecI64x2 */,
/** i64x2.extend_high_i32x4_u */
- ExtendHighU32x4ToU64x2 = 118 /* _BinaryenExtendHighUVecI32x4ToVecI64x2 */,
+ ExtendHighU32x4ToU64x2 = 125 /* _BinaryenExtendHighUVecI32x4ToVecI64x2 */,
/** f32x4.convert_i32x4_s */
- ConvertLowI32x4ToF64x2 = 119 /* _BinaryenConvertLowSVecI32x4ToVecF64x2 */,
+ ConvertLowI32x4ToF64x2 = 126 /* _BinaryenConvertLowSVecI32x4ToVecF64x2 */,
/** f32x4.convert_i32x4_u */
- ConvertLowU32x4ToF64x2 = 120 /* _BinaryenConvertLowUVecI32x4ToVecF64x2 */,
+ ConvertLowU32x4ToF64x2 = 127 /* _BinaryenConvertLowUVecI32x4ToVecF64x2 */,
/** i32x4.trunc_sat_f64x2_s_zero */
- TruncSatF64x2ToI32x4Zero = 121 /* _BinaryenTruncSatZeroSVecF64x2ToVecI32x4 */,
+ TruncSatF64x2ToI32x4Zero = 128 /* _BinaryenTruncSatZeroSVecF64x2ToVecI32x4 */,
/** i32x4.trunc_sat_f64x2_u_zero */
- TruncSatF64x2ToU32x4Zero = 122 /* _BinaryenTruncSatZeroUVecF64x2ToVecI32x4 */,
+ TruncSatF64x2ToU32x4Zero = 129 /* _BinaryenTruncSatZeroUVecF64x2ToVecI32x4 */,
/** f32x4.demote_f64x2_zero */
- DemoteZeroF64x2ToF32x4 = 123 /* _BinaryenDemoteZeroVecF64x2ToVecF32x4 */,
+ DemoteZeroF64x2ToF32x4 = 130 /* _BinaryenDemoteZeroVecF64x2ToVecF32x4 */,
/** f64x2.promote_low_f32x4 */
- PromoteLowF32x4ToF64x2 = 124 /* _BinaryenPromoteLowVecF32x4ToVecF64x2 */,
-
- // see: https://github.com/WebAssembly/relaxed-simd
-
+ PromoteLowF32x4ToF64x2 = 131 /* _BinaryenPromoteLowVecF32x4ToVecF64x2 */,
/** i32x4.relaxed_trunc_f32x4_s */
- RelaxedTruncF32x4ToI32x4 = 125 /* TODO_BinaryenRelaxedTruncSVecF32x4ToVecI32x4 */,
+ RelaxedTruncF32x4ToI32x4 = 132 /* _BinaryenRelaxedTruncSVecF32x4ToVecI32x4 */,
/** i32x4.relaxed_trunc_f32x4_u */
- RelaxedTruncF32x4ToU32x4 = 126 /* TODO_BinaryenRelaxedTruncUVecF32x4ToVecI32x4 */,
+ RelaxedTruncF32x4ToU32x4 = 133 /* _BinaryenRelaxedTruncUVecF32x4ToVecI32x4 */,
/** i32x4.relaxed_trunc_f64x2_s_zero */
- RelaxedTruncF64x2ToI32x4Zero = 127 /* TODO_BinaryenRelaxedTruncZeroSVecF64x2ToVecI32x4 */,
+ RelaxedTruncF64x2ToI32x4Zero = 134 /* _BinaryenRelaxedTruncZeroSVecF64x2ToVecI32x4 */,
/** i32x4.relaxed_trunc_f64x2_u_zero */
- RelaxedTruncF64x2ToU32x4Zero = 128 /* TODO_BinaryenRelaxedTruncZeroUVecF64x2ToVecI32x4 */,
+ RelaxedTruncF64x2ToU32x4Zero = 135 /* _BinaryenRelaxedTruncZeroUVecF64x2ToVecI32x4 */,
_last = RelaxedTruncF64x2ToU32x4Zero,
@@ -845,190 +845,187 @@ export const enum BinaryOp {
/** i64x2.ge_s */
GeI64x2 = 111 /* _BinaryenGeSVecI64x2 */,
/** f32x4.eq */
- EqF32x4 = 112 /* _BinaryenEqVecF32x4 */,
+ EqF32x4 = 118 /* _BinaryenEqVecF32x4 */,
/** f32x4.ne */
- NeF32x4 = 113 /* _BinaryenNeVecF32x4 */,
+ NeF32x4 = 119 /* _BinaryenNeVecF32x4 */,
/** f32x4.lt */
- LtF32x4 = 114 /* _BinaryenLtVecF32x4 */,
+ LtF32x4 = 120 /* _BinaryenLtVecF32x4 */,
/** f32x4.gt */
- GtF32x4 = 115 /* _BinaryenGtVecF32x4 */,
+ GtF32x4 = 121 /* _BinaryenGtVecF32x4 */,
/** f32x4.le */
- LeF32x4 = 116 /* _BinaryenLeVecF32x4 */,
+ LeF32x4 = 122 /* _BinaryenLeVecF32x4 */,
/** f32x4.ge */
- GeF32x4 = 117 /* _BinaryenGeVecF32x4 */,
+ GeF32x4 = 123 /* _BinaryenGeVecF32x4 */,
/** f64x2.eq */
- EqF64x2 = 118 /* _BinaryenEqVecF64x2 */,
+ EqF64x2 = 124 /* _BinaryenEqVecF64x2 */,
/** f64x2.ne */
- NeF64x2 = 119 /* _BinaryenNeVecF64x2 */,
+ NeF64x2 = 125 /* _BinaryenNeVecF64x2 */,
/** f64x2.lt */
- LtF64x2 = 120 /* _BinaryenLtVecF64x2 */,
+ LtF64x2 = 126 /* _BinaryenLtVecF64x2 */,
/** f64x2.gt */
- GtF64x2 = 121 /* _BinaryenGtVecF64x2 */,
+ GtF64x2 = 127 /* _BinaryenGtVecF64x2 */,
/** f64x2.le */
- LeF64x2 = 122 /* _BinaryenLeVecF64x2 */,
+ LeF64x2 = 128 /* _BinaryenLeVecF64x2 */,
/** f64x2.ge */
- GeF64x2 = 123 /* _BinaryenGeVecF64x2 */,
+ GeF64x2 = 129 /* _BinaryenGeVecF64x2 */,
/** v128.and */
- AndV128 = 124 /* _BinaryenAndVec128 */,
+ AndV128 = 130 /* _BinaryenAndVec128 */,
/** v128.or */
- OrV128 = 125 /* _BinaryenOrVec128 */,
+ OrV128 = 131 /* _BinaryenOrVec128 */,
/** v128.xor */
- XorV128 = 126 /* _BinaryenXorVec128 */,
+ XorV128 = 132 /* _BinaryenXorVec128 */,
/** v128.andnot */
- AndnotV128 = 127 /* _BinaryenAndNotVec128 */,
+ AndnotV128 = 133 /* _BinaryenAndNotVec128 */,
/** i8x16.add */
- AddI8x16 = 128 /* _BinaryenAddVecI8x16 */,
+ AddI8x16 = 134 /* _BinaryenAddVecI8x16 */,
/** i8x16.add_sat_s */
- AddSatI8x16 = 129 /* _BinaryenAddSatSVecI8x16 */,
+ AddSatI8x16 = 135 /* _BinaryenAddSatSVecI8x16 */,
/** i8x16.add_sat_u */
- AddSatU8x16 = 130 /* _BinaryenAddSatUVecI8x16 */,
+ AddSatU8x16 = 136 /* _BinaryenAddSatUVecI8x16 */,
/** i8x16.sub */
- SubI8x16 = 131 /* _BinaryenSubVecI8x16 */,
+ SubI8x16 = 137 /* _BinaryenSubVecI8x16 */,
/** i8x16.sub_sat_s */
- SubSatI8x16 = 132 /* _BinaryenSubSatSVecI8x16 */,
+ SubSatI8x16 = 138 /* _BinaryenSubSatSVecI8x16 */,
/** i8x16.sub_sat_u */
- SubSatU8x16 = 133 /* _BinaryenSubSatUVecI8x16 */,
+ SubSatU8x16 = 139 /* _BinaryenSubSatUVecI8x16 */,
/** i8x16.min_s */
- MinI8x16 = 134 /* _BinaryenMinSVecI8x16 */,
+ MinI8x16 = 140 /* _BinaryenMinSVecI8x16 */,
/** i8x16.min_u */
- MinU8x16 = 135 /* _BinaryenMinUVecI8x16 */,
+ MinU8x16 = 141 /* _BinaryenMinUVecI8x16 */,
/** i8x16.max_s */
- MaxI8x16 = 136 /* _BinaryenMaxSVecI8x16 */,
+ MaxI8x16 = 142 /* _BinaryenMaxSVecI8x16 */,
/** i8x16.max_u */
- MaxU8x16 = 137 /* _BinaryenMaxUVecI8x16 */,
+ MaxU8x16 = 143 /* _BinaryenMaxUVecI8x16 */,
/** i8x16.avgr_u */
- AvgrU8x16 = 138 /* _BinaryenAvgrUVecI8x16 */,
+ AvgrU8x16 = 144 /* _BinaryenAvgrUVecI8x16 */,
/** i16x8.add */
- AddI16x8 = 139 /* _BinaryenAddVecI16x8 */,
+ AddI16x8 = 145 /* _BinaryenAddVecI16x8 */,
/** i16x8.add_sat_s */
- AddSatI16x8 = 140 /* _BinaryenAddSatSVecI16x8 */,
+ AddSatI16x8 = 146 /* _BinaryenAddSatSVecI16x8 */,
/** i16x8.add_sat_u */
- AddSatU16x8 = 141 /* _BinaryenAddSatUVecI16x8 */,
+ AddSatU16x8 = 147 /* _BinaryenAddSatUVecI16x8 */,
/** i16x8.sub */
- SubI16x8 = 142 /* _BinaryenSubVecI16x8 */,
+ SubI16x8 = 148 /* _BinaryenSubVecI16x8 */,
/** i16x8.sub_sat_s */
- SubSatI16x8 = 143 /* _BinaryenSubSatSVecI16x8 */,
+ SubSatI16x8 = 149 /* _BinaryenSubSatSVecI16x8 */,
/** i16x8.sub_sat_u */
- SubSatU16x8 = 144 /* _BinaryenSubSatUVecI16x8 */,
+ SubSatU16x8 = 150 /* _BinaryenSubSatUVecI16x8 */,
/** i16x8.mul */
- MulI16x8 = 145 /* _BinaryenMulVecI16x8 */,
+ MulI16x8 = 151 /* _BinaryenMulVecI16x8 */,
/** i16x8.min_s */
- MinI16x8 = 146 /* _BinaryenMinSVecI16x8 */,
+ MinI16x8 = 152 /* _BinaryenMinSVecI16x8 */,
/** i16x8.min_u */
- MinU16x8 = 147 /* _BinaryenMinUVecI16x8 */,
+ MinU16x8 = 153 /* _BinaryenMinUVecI16x8 */,
/** i16x8.max_s */
- MaxI16x8 = 148 /* _BinaryenMaxSVecI16x8 */,
+ MaxI16x8 = 154 /* _BinaryenMaxSVecI16x8 */,
/** i16x8.max_u */
- MaxU16x8 = 149 /* _BinaryenMaxUVecI16x8 */,
+ MaxU16x8 = 155 /* _BinaryenMaxUVecI16x8 */,
/** i16x8.avgr_u */
- AvgrU16x8 = 150 /* _BinaryenAvgrUVecI16x8 */,
+ AvgrU16x8 = 156 /* _BinaryenAvgrUVecI16x8 */,
/** i16x8.q15mulr_sat_s */
- Q15mulrSatI16x8 = 151 /* _BinaryenQ15MulrSatSVecI16x8 */,
+ Q15mulrSatI16x8 = 157 /* _BinaryenQ15MulrSatSVecI16x8 */,
/** i16x8.extmul_low_i8x16_s */
- ExtmulLowI16x8 = 152 /* _BinaryenExtMulLowSVecI16x8 */,
+ ExtmulLowI16x8 = 158 /* _BinaryenExtMulLowSVecI16x8 */,
/** i16x8.extmul_high_i8x16_s */
- ExtmulHighI16x8 = 153 /* _BinaryenExtMulHighSVecI16x8 */,
+ ExtmulHighI16x8 = 159 /* _BinaryenExtMulHighSVecI16x8 */,
/** i16x8.extmul_low_i8x16_u */
- ExtmulLowU16x8 = 154 /* _BinaryenExtMulLowUVecI16x8 */,
+ ExtmulLowU16x8 = 160 /* _BinaryenExtMulLowUVecI16x8 */,
/** i16x8.extmul_high_i8x16_u */
- ExtmulHighU16x8 = 155 /* _BinaryenExtMulHighUVecI16x8 */,
+ ExtmulHighU16x8 = 161 /* _BinaryenExtMulHighUVecI16x8 */,
/** i32x4.add */
- AddI32x4 = 156 /* _BinaryenAddVecI32x4 */,
+ AddI32x4 = 162 /* _BinaryenAddVecI32x4 */,
/** i32x4.sub */
- SubI32x4 = 157 /* _BinaryenSubVecI32x4 */,
+ SubI32x4 = 163 /* _BinaryenSubVecI32x4 */,
/** i32x4.mul */
- MulI32x4 = 158 /* _BinaryenMulVecI32x4 */,
+ MulI32x4 = 164 /* _BinaryenMulVecI32x4 */,
/** i32x4.min_s */
- MinI32x4 = 159 /* _BinaryenMinSVecI32x4 */,
+ MinI32x4 = 165 /* _BinaryenMinSVecI32x4 */,
/** i32x4.min_u */
- MinU32x4 = 160 /* _BinaryenMinUVecI32x4 */,
+ MinU32x4 = 166 /* _BinaryenMinUVecI32x4 */,
/** i32x4.max_s */
- MaxI32x4 = 161 /* _BinaryenMaxSVecI32x4 */,
+ MaxI32x4 = 167 /* _BinaryenMaxSVecI32x4 */,
/** i32x4.max_u */
- MaxU32x4 = 162 /* _BinaryenMaxUVecI32x4 */,
+ MaxU32x4 = 168 /* _BinaryenMaxUVecI32x4 */,
/** i32x4.dot_i16x8_s */
- DotI16x8 = 163 /* _BinaryenDotSVecI16x8ToVecI32x4 */,
+ DotI16x8 = 169 /* _BinaryenDotSVecI16x8ToVecI32x4 */,
/** i32x4.extmul_low_i16x8_s */
- ExtmulLowI32x4 = 164 /* _BinaryenExtMulLowSVecI32x4 */,
+ ExtmulLowI32x4 = 170 /* _BinaryenExtMulLowSVecI32x4 */,
/** i32x4.extmul_high_i16x8_s */
- ExtmulHighI32x4 = 165 /* _BinaryenExtMulHighSVecI32x4 */,
+ ExtmulHighI32x4 = 171 /* _BinaryenExtMulHighSVecI32x4 */,
/** i32x4.extmul_low_i16x8_u */
- ExtmulLowU32x4 = 166 /* _BinaryenExtMulLowUVecI32x4 */,
+ ExtmulLowU32x4 = 172 /* _BinaryenExtMulLowUVecI32x4 */,
/** i32x4.extmul_high_i16x8_u */
- ExtmulHighU32x4 = 167 /* _BinaryenExtMulHighUVecI32x4 */,
+ ExtmulHighU32x4 = 173 /* _BinaryenExtMulHighUVecI32x4 */,
/** i64x2.add */
- AddI64x2 = 168 /* _BinaryenAddVecI64x2 */,
+ AddI64x2 = 174 /* _BinaryenAddVecI64x2 */,
/** i64x2.sub */
- SubI64x2 = 169 /* _BinaryenSubVecI64x2 */,
+ SubI64x2 = 175 /* _BinaryenSubVecI64x2 */,
/** i64x2.mul */
- MulI64x2 = 170 /* _BinaryenMulVecI64x2 */,
+ MulI64x2 = 176 /* _BinaryenMulVecI64x2 */,
/** i64x2.extmul_low_i32x4_s */
- ExtmulLowI64x2 = 171 /* _BinaryenExtMulLowSVecI64x2 */,
+ ExtmulLowI64x2 = 177 /* _BinaryenExtMulLowSVecI64x2 */,
/** i64x2.extmul_high_i32x4_s */
- ExtmulHighI64x2 = 172 /* _BinaryenExtMulHighSVecI64x2 */,
+ ExtmulHighI64x2 = 178 /* _BinaryenExtMulHighSVecI64x2 */,
/** i64x2.extmul_low_i32x4_u */
- ExtmulLowU64x2 = 173 /* _BinaryenExtMulLowUVecI64x2 */,
+ ExtmulLowU64x2 = 179 /* _BinaryenExtMulLowUVecI64x2 */,
/** i64x2.extmul_high_i32x4_u */
- ExtmulHighU64x2 = 174 /* _BinaryenExtMulHighUVecI64x2 */,
+ ExtmulHighU64x2 = 180 /* _BinaryenExtMulHighUVecI64x2 */,
/** f32x4.add */
- AddF32x4 = 175 /* _BinaryenAddVecF32x4 */,
+ AddF32x4 = 189 /* _BinaryenAddVecF32x4 */,
/** f32x4.sub */
- SubF32x4 = 176 /* _BinaryenSubVecF32x4 */,
+ SubF32x4 = 190 /* _BinaryenSubVecF32x4 */,
/** f32x4.mul */
- MulF32x4 = 177 /* _BinaryenMulVecF32x4 */,
+ MulF32x4 = 191 /* _BinaryenMulVecF32x4 */,
/** f32x4.div */
- DivF32x4 = 178 /* _BinaryenDivVecF32x4 */,
+ DivF32x4 = 192 /* _BinaryenDivVecF32x4 */,
/** f32x4.min */
- MinF32x4 = 179 /* _BinaryenMinVecF32x4 */,
+ MinF32x4 = 193 /* _BinaryenMinVecF32x4 */,
/** f32x4.max */
- MaxF32x4 = 180 /* _BinaryenMaxVecF32x4 */,
+ MaxF32x4 = 194 /* _BinaryenMaxVecF32x4 */,
/** f32x4.pmin */
- PminF32x4 = 181 /* _BinaryenPMinVecF32x4 */,
+ PminF32x4 = 195 /* _BinaryenPMinVecF32x4 */,
/** f32x4.pmax */
- PmaxF32x4 = 182 /* _BinaryenPMaxVecF32x4 */,
+ PmaxF32x4 = 196 /* _BinaryenPMaxVecF32x4 */,
/** f64x2.add */
- AddF64x2 = 183 /* _BinaryenAddVecF64x2 */,
+ AddF64x2 = 197 /* _BinaryenAddVecF64x2 */,
/** f64x2.sub */
- SubF64x2 = 184 /* _BinaryenSubVecF64x2 */,
+ SubF64x2 = 198 /* _BinaryenSubVecF64x2 */,
/** f64x2.mul */
- MulF64x2 = 185 /* _BinaryenMulVecF64x2 */,
+ MulF64x2 = 199 /* _BinaryenMulVecF64x2 */,
/** f64x2.div */
- DivF64x2 = 186 /* _BinaryenDivVecF64x2 */,
+ DivF64x2 = 200 /* _BinaryenDivVecF64x2 */,
/** f64x2.min */
- MinF64x2 = 187 /* _BinaryenMinVecF64x2 */,
+ MinF64x2 = 201 /* _BinaryenMinVecF64x2 */,
/** f64x2.max */
- MaxF64x2 = 188 /* _BinaryenMaxVecF64x2 */,
+ MaxF64x2 = 202 /* _BinaryenMaxVecF64x2 */,
/** f64x2.pmin */
- PminF64x2 = 189 /* _BinaryenPMinVecF64x2 */,
+ PminF64x2 = 203 /* _BinaryenPMinVecF64x2 */,
/** f64x2.pmax */
- PmaxF64x2 = 190 /* _BinaryenPMaxVecF64x2 */,
+ PmaxF64x2 = 204 /* _BinaryenPMaxVecF64x2 */,
/** i8x16.narrow_i16x8_s */
- NarrowI16x8ToI8x16 = 191 /* _BinaryenNarrowSVecI16x8ToVecI8x16 */,
+ NarrowI16x8ToI8x16 = 205 /* _BinaryenNarrowSVecI16x8ToVecI8x16 */,
/** i8x16.narrow_i16x8_u */
- NarrowU16x8ToU8x16 = 192 /* _BinaryenNarrowUVecI16x8ToVecI8x16 */,
+ NarrowU16x8ToU8x16 = 206 /* _BinaryenNarrowUVecI16x8ToVecI8x16 */,
/** i16x8.narrow_i32x4_s */
- NarrowI32x4ToI16x8 = 193 /* _BinaryenNarrowSVecI32x4ToVecI16x8 */,
+ NarrowI32x4ToI16x8 = 207 /* _BinaryenNarrowSVecI32x4ToVecI16x8 */,
/** i16x8.narrow_i32x4_u */
- NarrowU32x4ToU16x8 = 194 /* _BinaryenNarrowUVecI32x4ToVecI16x8 */,
+ NarrowU32x4ToU16x8 = 208 /* _BinaryenNarrowUVecI32x4ToVecI16x8 */,
/** i8x16.swizzle */
- SwizzleI8x16 = 195 /* _BinaryenSwizzleVecI8x16 */,
-
- // see: https://github.com/WebAssembly/relaxed-simd
-
+ SwizzleI8x16 = 209 /* _BinaryenSwizzleVecI8x16 */,
/** i8x16.relaxed_swizzle */
- RelaxedSwizzleI8x16 = 196 /* TODO_BinaryenRelaxedSwizzleVecI8x16 */,
+ RelaxedSwizzleI8x16 = 210 /* _BinaryenRelaxedSwizzleVecI8x16 */,
/** f32x4.relaxed_min */
- RelaxedMinF32x4 = 197 /* TODO_BinaryenRelaxedMinVecF32x4 */,
+ RelaxedMinF32x4 = 211 /* _BinaryenRelaxedMinVecF32x4 */,
/** f32x4.relaxed_max */
- RelaxedMaxF32x4 = 198 /* TODO_BinaryenRelaxedMaxVecF32x4 */,
+ RelaxedMaxF32x4 = 212 /* _BinaryenRelaxedMaxVecF32x4 */,
/** f64x2.relaxed_min */
- RelaxedMinF64x2 = 199 /* TODO_BinaryenRelaxedMinVecF64x2 */,
+ RelaxedMinF64x2 = 213 /* _BinaryenRelaxedMinVecF64x2 */,
/** f64x2.relaxed_max */
- RelaxedMaxF64x2 = 200 /* TODO_BinaryenRelaxedMaxVecF64x2 */,
+ RelaxedMaxF64x2 = 214 /* _BinaryenRelaxedMaxVecF64x2 */,
/** i16x8.relaxed_q15mulr_s */
- RelaxedQ15MulrI16x8 = 201 /* TODO_BinaryenRelaxedQ15MulrSVecI16x8 */,
+ RelaxedQ15MulrI16x8 = 215 /* _BinaryenRelaxedQ15MulrSVecI16x8 */,
/** i16x8.relaxed_dot_i8x16_i7x16_s */
- RelaxedDotI8x16I7x16ToI16x8 = 202 /* TODO_BinaryenDotI8x16I7x16SToVecI16x8 */,
+ RelaxedDotI8x16I7x16ToI16x8 = 216 /* _BinaryenDotI8x16I7x16SToVecI16x8 */,
_last = RelaxedDotI8x16I7x16ToI16x8,
@@ -1117,9 +1114,9 @@ export const enum SIMDExtractOp {
/** i32x4.extract_lane_u */
ExtractLaneI64x2 = 5 /* _BinaryenExtractLaneVecI64x2 */,
/** i64x2.extract_lane_s */
- ExtractLaneF32x4 = 6 /* _BinaryenExtractLaneVecF32x4 */,
+ ExtractLaneF32x4 = 7 /* _BinaryenExtractLaneVecF32x4 */,
/** i64x2.extract_lane_u */
- ExtractLaneF64x2 = 7 /* _BinaryenExtractLaneVecF64x2 */,
+ ExtractLaneF64x2 = 8 /* _BinaryenExtractLaneVecF64x2 */,
}
/** Binaryen SIMD replace operation constants. */
@@ -1133,9 +1130,9 @@ export const enum SIMDReplaceOp {
/** i64x2.replace_lane */
ReplaceLaneI64x2 = 3 /* _BinaryenReplaceLaneVecI64x2 */,
/** f32x4.replace_lane */
- ReplaceLaneF32x4 = 4 /* _BinaryenReplaceLaneVecF32x4 */,
+ ReplaceLaneF32x4 = 5 /* _BinaryenReplaceLaneVecF32x4 */,
/** f64x2.replace_lane */
- ReplaceLaneF64x2 = 5 /* _BinaryenReplaceLaneVecF64x2 */
+ ReplaceLaneF64x2 = 6 /* _BinaryenReplaceLaneVecF64x2 */
}
/** Binaryen SIMD shift operation constants. */
@@ -1219,36 +1216,40 @@ export const enum SIMDTernaryOp {
/** v128.bitselect */
Bitselect = 0 /* _BinaryenBitselectVec128 */,
- // see: https://github.com/WebAssembly/relaxed-simd
+ // Relaxed SIMD for F16
+ /** f16x8.relaxed_madd */
+ RelaxedMaddVecF16x8 = 1 /* TODO_BinaryenRelaxedMaddVecF16x8 */,
+ /** f16x8.relaxed_nmadd */
+ RelaxedNmaddVecF16x8 = 2 /* TODO_BinaryenRelaxedNmaddVecF16x8 */,
/** f32x4.relaxed_madd */
- RelaxedMaddF32x4 = 1 /* TODO_BinaryenRelaxedFmaVecF32x4 */,
+ RelaxedMaddF32x4 = 3 /* _BinaryenRelaxedMaddVecF32x4 */,
/** f32x4.relaxed_nmadd */
- RelaxedNmaddF32x4 = 2 /* TODO_BinaryenRelaxedFmsVecF32x4 */,
+ RelaxedNmaddF32x4 = 4 /* _BinaryenRelaxedNmaddVecF32x4 */,
/** f64x2.relaxed_madd */
- RelaxedMaddF64x2 = 3 /* TODO_BinaryenRelaxedFmaVecF64x2 */,
+ RelaxedMaddF64x2 = 5 /* _BinaryenRelaxedMaddVecF64x2 */,
/** f64x2.relaxed_nmadd */
- RelaxedNmaddF64x2 = 4 /* TODO_BinaryenRelaxedFmsVecF64x2 */,
+ RelaxedNmaddF64x2 = 6 /* _BinaryenRelaxedNmaddVecF64x2 */,
/** i8x16.relaxed_laneselect */
- RelaxedLaneselectI8x16 = 5 /* TODO_BinaryenLaneselectI8x16 */,
+ RelaxedLaneselectI8x16 = 7 /* _BinaryenLaneselectI8x16 */,
/** i16x8.relaxed_laneselect */
- RelaxedLaneselectI16x8 = 6 /* TODO_BinaryenLaneselectI16x8 */,
+ RelaxedLaneselectI16x8 = 8 /* _BinaryenLaneselectI16x8 */,
/** i32x4.relaxed_laneselect */
- RelaxedLaneselectI32x4 = 7 /* TODO_BinaryenLaneselectI32x4 */,
+ RelaxedLaneselectI32x4 = 9 /* _BinaryenLaneselectI32x4 */,
/** i64x2.relaxed_laneselect */
- RelaxedLaneselectI64x2 = 8 /* TODO_BinaryenLaneselectI64x2 */,
+ RelaxedLaneselectI64x2 = 10 /* _BinaryenLaneselectI64x2 */,
/** i32x4.relaxed_dot_i8x16_i7x16_add_s */
- RelaxedDotI8x16I7x16AddToI32x4 = 9 /* TODO_BinaryenDotI8x16I7x16AddSToVecI32x4 */,
+ RelaxedDotI8x16I7x16AddToI32x4 = 11 /* _BinaryenDotI8x16I7x16AddSToVecI32x4 */,
}
/** Binaryen RefAs operation constants. */
export const enum RefAsOp {
/** ref.as_non_null */
NonNull = 0 /* _BinaryenRefAsNonNull */,
- /** extern.internalize */
- ExternInternalize = 1 /* _BinaryenRefAsExternInternalize */,
- /** extern.externalize */
- ExternExternalize = 2 /* _BinaryenRefAsExternExternalize */
+ /** any.convert_extern */
+ ExternInternalize = 1 /* _BinaryenRefAsAnyConvertExtern */,
+ /** extern.convert_any */
+ ExternExternalize = 2 /* _BinaryenRefAsExternConvertAny */
}
/** Binaryen BrOn operation constants. */
@@ -1265,54 +1266,28 @@ export const enum BrOnOp {
/** Binaryen StringNew operation constants. */
export const enum StringNewOp {
- /** string.new_wtf8 utf8 */
- UTF8 = 0 /* _BinaryenStringNewUTF8 */,
- /** string.new_wtf8 wtf8 */
- WTF8 = 1 /* _BinaryenStringNewWTF8 */,
- /** string.new_wtf8 replace */
- Replace = 2 /* _BinaryenStringNewReplace */,
- /** string.new_wtf16 */
- WTF16 = 3 /* _BinaryenStringNewWTF16 */,
- /** string.new_wtf8_array utf8 */
- UTF8Array = 4 /* _BinaryenStringNewUTF8Array */,
- /** string.new_wtf8_array wtf8 */
- WTF8Array = 5 /* _BinaryenStringNewWTF8Array */,
/** string.new_wtf8_array replace */
- ReplaceArray = 6 /* _BinaryenStringNewReplaceArray */,
+ LossyUTF8Array = 0 /* _BinaryenStringNewLossyUTF8Array */,
/** string.new_wtf16_array */
- WTF16Array = 7 /* _BinaryenStringNewWTF16Array */,
+ WTF16Array = 1 /* _BinaryenStringNewWTF16Array */,
/** string.from_code_point */
- FromCodePoint = 8 /* _BinaryenStringNewFromCodePoint */
+ FromCodePoint = 2 /* _BinaryenStringNewFromCodePoint */
}
/** Binaryen StringMeasure operation constants. */
export const enum StringMeasureOp {
/** string.measure_wtf8 utf8 */
UTF8 = 0 /* _BinaryenStringMeasureUTF8 */,
- /** string.measure_wtf8 wtf8 */
- WTF8 = 1 /* _BinaryenStringMeasureWTF8 */,
/** string.measure_wtf16 */
- WTF16 = 2 /* _BinaryenStringMeasureWTF16 */,
- /** string.is_usv_sequence */
- IsUSV = 3 /* _BinaryenStringMeasureIsUSV */,
- /** stringview_wtf16.length */
- WTF16View = 4 /* _BinaryenStringMeasureWTF16View */
+ WTF16 = 1 /* _BinaryenStringMeasureWTF16 */,
}
/** Binaryen StringEncode operation constants. */
export const enum StringEncodeOp {
- /** string.encode_wtf8 utf8 */
- UTF8 = 0 /* _BinaryenStringEncodeUTF8 */,
- /** string.encode_wtf8 wtf8 */
- WTF8 = 1 /* _BinaryenStringEncodeWTF8 */,
- /** string.encode_wtf16 */
- WTF16 = 2 /* _BinaryenStringEncodeWTF16 */,
- /** string.encode_wtf8_array utf8 */
- UTF8Array = 3 /* _BinaryenStringEncodeUTF8Array */,
- /** string.encode_wtf8_array wtf8 */
- WTF8Array = 4 /* _BinaryenStringEncodeWTF8Array */,
+ /** string.encode_lossy_utf8_array utf8 */
+ LossyUTF8Array = 0 /* _BinaryenStringEncodeLossyUTF8Array */,
/** string.encode_wtf16_array */
- WTF16Array = 5 /* _BinaryenStringEncodeWTF16Array */
+ WTF16Array = 1 /* _BinaryenStringEncodeWTF16Array */
}
/** Binaryen StringEq operation constants. */
@@ -1323,37 +1298,10 @@ export const enum StringEqOp {
Compare = 1 /* _BinaryenStringEqCompare */
}
-/** Binaryen StringAs operation constants. */
-export const enum StringAsOp {
- /** string.as_wtf8 */
- WTF8 = 0 /* _BinaryenStringAsWTF8 */,
- /** string.as_wtf16 */
- WTF16 = 1 /* _BinaryenStringAsWTF16 */,
- /** string.as_iter */
- Iter = 2 /* _BinaryenStringAsIter */
-}
-
-/** Binaryen StringIterMove operation constants. */
-export const enum StringIterMoveOp {
- /** stringview_iter.advance */
- Advance = 0 /* _BinaryenStringIterMoveAdvance */,
- /** stringview_iter.rewind */
- Rewind = 1 /* _BinaryenStringIterMoveRewind */
-}
-
-/** Binaryen StringSlice operation constants. */
-export const enum StringSliceWTFOp {
- /** stringview_wtf8.slice */
- WTF8 = 0 /* _BinaryenStringSliceWTF8 */,
- /** stringview_wtf16.slice */
- WTF16 = 1 /* _BinaryenStringSliceWTF16 */
-}
-
/** Binaryen expression runner flags. */
export const enum ExpressionRunnerFlags {
Default = 0 /* _ExpressionRunnerFlagsDefault */,
- PreserveSideeffects = 1 /* _ExpressionRunnerFlagsPreserveSideeffects */,
- TraverseCalls = 2 /* _ExpressionRunnerFlagsTraverseCalls */
+ PreserveSideeffects = 1 /* _ExpressionRunnerFlagsPreserveSideeffects */
}
export class MemorySegment {
@@ -1376,7 +1324,6 @@ export class Module {
) {
assert(sizeType == TypeRef.I32 || sizeType == TypeRef.I64);
this.lit = binaryen._malloc(binaryen._BinaryenSizeofLiteral());
- binaryen._BinaryenSetTypeSystem(TypeSystem.Nominal);
}
private lit: usize;
@@ -1840,10 +1787,9 @@ export class Module {
select(
ifTrue: ExpressionRef,
ifFalse: ExpressionRef,
- condition: ExpressionRef,
- type: TypeRef
+ condition: ExpressionRef
): ExpressionRef {
- return binaryen._BinaryenSelect(this.ref, condition, ifTrue, ifFalse, type);
+ return binaryen._BinaryenSelect(this.ref, condition, ifTrue, ifFalse);
}
switch(
@@ -2118,13 +2064,13 @@ export class Module {
type: TypeRef
): ExpressionRef {
let cStr = this.allocStringCached(name);
- return binaryen._BinaryenRefFunc(this.ref, cStr, type);
+ return binaryen._BinaryenRefFunc(this.ref, cStr, binaryen._BinaryenTypeGetHeapType(type));
}
i31_new(
value: ExpressionRef
): ExpressionRef {
- return binaryen._BinaryenI31New(this.ref, value);
+ return binaryen._BinaryenRefI31(this.ref, value);
}
i31_get(
@@ -2400,36 +2346,43 @@ export class Module {
name: string = CommonNames.DefaultMemory,
shared: bool = false
): void {
- let cStr1 = this.allocStringCached(exportName);
- let cStr2 = this.allocStringCached(name);
+ let cExportName = this.allocStringCached(exportName);
+ let cName = this.allocStringCached(name);
let k = segments.length;
let segs = new Array(k);
- let psvs = new Uint8Array(k);
- let offs = new Array(k);
- let sizs = new Array(k);
+ let isPassive = new Uint8Array(k);
+ let offsets = new Array(k);
+ let sizes = new Array(k);
for (let i = 0; i < k; ++i) {
let segment = unchecked(segments[i]);
let buffer = segment.buffer;
let offset = segment.offset;
unchecked(segs[i] = allocU8Array(buffer));
- unchecked(psvs[i] = 0); // no passive segments currently
- unchecked(offs[i] = target == Target.Wasm64
+ unchecked(isPassive[i] = 0); // no passive segments currently
+ unchecked(offsets[i] = target == Target.Wasm64
? this.i64(i64_low(offset), i64_high(offset))
: this.i32(i64_low(offset))
);
- unchecked(sizs[i] = buffer.length);
+ unchecked(sizes[i] = buffer.length);
}
- let cArr1 = allocPtrArray(segs);
- let cArr2 = allocU8Array(psvs);
- let cArr3 = allocPtrArray(offs);
- let cArr4 = allocU32Array(sizs);
+ let cSegs = allocPtrArray(segs);
+ let cIsPassive = allocU8Array(isPassive);
+ let cOffsets = allocPtrArray(offsets);
+ let cSizes = allocU32Array(sizes);
binaryen._BinaryenSetMemory(
- this.ref, initial, maximum, cStr1, cArr1, cArr2, cArr3, cArr4, k, shared, false, cStr2
+ this.ref,
+ initial, maximum,
+ cExportName,
+ 0, cSegs, cIsPassive,
+ cOffsets, cSizes,
+ k,
+ shared, false,
+ cName
);
- binaryen._free(cArr4);
- binaryen._free(cArr3);
- binaryen._free(cArr2);
- binaryen._free(cArr1);
+ binaryen._free(cSizes);
+ binaryen._free(cOffsets);
+ binaryen._free(cIsPassive);
+ binaryen._free(cSegs);
for (let i = k - 1; i >= 0; --i) {
binaryen._free(unchecked(segs[i]));
}
@@ -2518,6 +2471,14 @@ export class Module {
binaryen._BinaryenSetDebugInfo(on);
}
+ getClosedWorld(): bool {
+ return binaryen._BinaryenGetClosedWorld();
+ }
+
+ setClosedWorld(on: bool): void {
+ binaryen._BinaryenSetClosedWorld(on);
+ }
+
getLowMemoryUnused(): bool {
return binaryen._BinaryenGetLowMemoryUnused();
}
@@ -2542,6 +2503,22 @@ export class Module {
binaryen._BinaryenSetFastMath(on);
}
+ getGenerateStackIR(): bool {
+ return binaryen._BinaryenGetGenerateStackIR();
+ }
+
+ setGenerateStackIR(on: bool): void {
+ binaryen._BinaryenSetGenerateStackIR(on);
+ }
+
+ getOptimizeStackIR(): bool {
+ return binaryen._BinaryenGetOptimizeStackIR();
+ }
+
+ setOptimizeStackIR(on: bool): void {
+ binaryen._BinaryenSetOptimizeStackIR(on);
+ }
+
getPassArgument(key: string): string | null {
let cStr = this.allocStringCached(key);
let ptr = binaryen._BinaryenGetPassArgument(cStr);
@@ -2597,6 +2574,7 @@ export class Module {
}
setFeatures(featureFlags: FeatureFlags): void {
+ if (featureFlags & FeatureFlags.BulkMemory) featureFlags |= FeatureFlags.BulkMemoryOpt;
binaryen._BinaryenModuleSetFeatures(this.ref, featureFlags);
}
@@ -2632,6 +2610,11 @@ export class Module {
this.setFastMath(true);
this.clearPassArguments();
+ // OptimizationOptions#parse in src/tools/optimization-options.h
+ const stackIR = optimizeLevel >= 2 || shrinkLevel >= 1;
+ this.setGenerateStackIR(stackIR);
+ this.setOptimizeStackIR(stackIR);
+
// Tweak inlining limits based on optimization levels
if (optimizeLevel >= 2 && shrinkLevel == 0) {
this.setAlwaysInlineMaxSize(12);
@@ -2868,7 +2851,7 @@ export class Module {
toText(watFormat: bool = true): string {
let textPtr = watFormat
- ? binaryen._BinaryenModuleAllocateAndWriteStackIR(this.ref, true)
+ ? binaryen._BinaryenModuleAllocateAndWriteStackIR(this.ref)
: binaryen._BinaryenModuleAllocateAndWriteText(this.ref);
let text = readString(textPtr);
if (textPtr) binaryen._free(textPtr);
@@ -2957,7 +2940,7 @@ export class Module {
case ExpressionId.Const:
case ExpressionId.RefNull:
case ExpressionId.RefFunc:
- case ExpressionId.I31New: return true;
+ case ExpressionId.RefI31: return true;
case ExpressionId.Binary: {
if (this.getFeatures() & FeatureFlags.ExtendedConst) {
switch (getBinaryOp(expr)) {
@@ -3055,6 +3038,18 @@ export function getConstValueI64High(expr: ExpressionRef): i32 {
return binaryen._BinaryenConstGetValueI64High(expr);
}
+export function getConstValueInteger(expr: ExpressionRef, isWasm64: bool): i64 {
+ let lo: i32 = 0;
+ let hi: i32 = 0;
+ if (isWasm64) {
+ lo = getConstValueI64Low(expr);
+ hi = getConstValueI64High(expr);
+ } else {
+ lo = getConstValueI32(expr);
+ }
+ return i64_new(lo, hi);
+}
+
export function getConstValueF32(expr: ExpressionRef): f32 {
return binaryen._BinaryenConstGetValueF32(expr);
}
@@ -3412,16 +3407,32 @@ export class SwitchBuilder {
this.condition = condition;
}
+ /** Links a case to the specified branch, replace old case if it is linked. */
+ addOrReplaceCase(value: i32, code: ExpressionRef[]): void {
+ const valueIndex = this.values.indexOf(value);
+ const codeIndex = this.addCode(code);
+ if (valueIndex >= 0) {
+ this.indexes[valueIndex] = codeIndex;
+ } else {
+ this.values.push(value);
+ this.indexes.push(codeIndex);
+ }
+ }
+
/** Links a case to the specified branch. */
addCase(value: i32, code: ExpressionRef[]): void {
+ this.values.push(value);
+ this.indexes.push(this.addCode(code));
+ }
+
+ private addCode(code: ExpressionRef[]): i32 {
let cases = this.cases;
let index = cases.indexOf(code);
if (index < 0) {
index = cases.length;
cases.push(code);
}
- this.values.push(value);
- this.indexes.push(index);
+ return index;
}
/** Links the default branch. */
@@ -3711,7 +3722,6 @@ export function ensureType(type: Type): TypeRef {
// @ts-ignore: Wasm only
assert(sizeof() == 4); // ABI code below assumes 32-bit pointers
}
- assert(binaryen._BinaryenGetTypeSystem() == TypeSystem.Nominal);
let builder = binaryen._TypeBuilderCreate(0);
let seen = new Map();
prepareType(builder, seen, type); // drop temp return
@@ -3788,39 +3798,30 @@ function tryEnsureBasicType(type: Type): TypeRef {
case TypeKind.F32: return TypeRef.F32;
case TypeKind.F64: return TypeRef.F64;
case TypeKind.V128: return TypeRef.V128;
- case TypeKind.Funcref: {
+ case TypeKind.Func: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Func, type.is(TypeFlags.Nullable));
}
- case TypeKind.Externref: {
+ case TypeKind.Extern: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Extern, type.is(TypeFlags.Nullable));
}
- case TypeKind.Anyref: {
+ case TypeKind.Any: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Any, type.is(TypeFlags.Nullable));
}
- case TypeKind.Eqref: {
+ case TypeKind.Eq: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Eq, type.is(TypeFlags.Nullable));
}
- case TypeKind.Structref: {
+ case TypeKind.Struct: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Struct, type.is(TypeFlags.Nullable));
}
- case TypeKind.Arrayref: {
+ case TypeKind.Array: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Array, type.is(TypeFlags.Nullable));
}
- case TypeKind.I31ref: {
+ case TypeKind.I31: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.I31, type.is(TypeFlags.Nullable));
}
- case TypeKind.Stringref: {
+ case TypeKind.String: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.String, type.is(TypeFlags.Nullable));
}
- case TypeKind.StringviewWTF8: {
- return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.StringviewWTF8, type.is(TypeFlags.Nullable));
- }
- case TypeKind.StringviewWTF16: {
- return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.StringviewWTF16, type.is(TypeFlags.Nullable));
- }
- case TypeKind.StringviewIter: {
- return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.StringviewIter, type.is(TypeFlags.Nullable));
- }
case TypeKind.Void: assert(false); // invalid here
}
return 0; // non-basic
diff --git a/src/parser.ts b/src/parser.ts
index 3bcee57681..7c69843973 100644
--- a/src/parser.ts
+++ b/src/parser.ts
@@ -398,9 +398,14 @@ export class Parser extends DiagnosticEmitter {
tn.range(declareStart, declareEnd), "declare"
); // recoverable
}
- if (!namespace) {
+ if (namespace) {
+ this.error(
+ DiagnosticCode.Namespace_can_only_have_declarations,
+ tn.range(startPos)
+ );
+ } else {
statement = this.parseStatement(tn, true);
- } // TODO: else?
+ }
}
break;
}
@@ -626,7 +631,7 @@ export class Parser extends DiagnosticEmitter {
}
// ... | type
while (tn.skip(Token.Bar)) {
- let nextType = this.parseType(tn, false, true);
+ let nextType = this.parseType(tn, true, false);
if (!nextType) return null;
let typeIsNull = type.kind == NodeKind.NamedType && (type).isNull;
let nextTypeIsNull = nextType.kind == NodeKind.NamedType && (nextType).isNull;
diff --git a/src/passes/pass.ts b/src/passes/pass.ts
index 8272fbd967..b61e17f1e8 100644
--- a/src/passes/pass.ts
+++ b/src/passes/pass.ts
@@ -175,9 +175,9 @@ import {
_BinaryenRefEqSetLeft,
_BinaryenRefEqSetRight,
_BinaryenFunctionSetBody,
- _BinaryenI31NewGetValue,
+ _BinaryenRefI31GetValue,
_BinaryenI31GetGetI31,
- _BinaryenI31NewSetValue,
+ _BinaryenRefI31SetValue,
_BinaryenI31GetSetI31,
_BinaryenCallRefGetNumOperands,
_BinaryenCallRefGetOperandAt,
@@ -195,8 +195,8 @@ import {
_BinaryenStructGetGetIndex,
_BinaryenArrayNewGetSize,
_BinaryenArrayNewGetInit,
- _BinaryenArrayInitGetNumValues,
- _BinaryenArrayInitGetValueAt,
+ _BinaryenArrayNewFixedGetNumValues,
+ _BinaryenArrayNewFixedGetValueAt,
_BinaryenArrayGetGetRef,
_BinaryenArrayGetGetIndex,
_BinaryenArraySetGetRef,
@@ -208,32 +208,22 @@ import {
_BinaryenArrayCopyGetSrcRef,
_BinaryenArrayCopyGetSrcIndex,
_BinaryenArrayCopyGetLength,
- _BinaryenStringNewGetPtr,
- _BinaryenStringNewGetLength,
+ _BinaryenStringNewGetRef,
_BinaryenStringNewGetStart,
_BinaryenStringNewGetEnd,
_BinaryenStringMeasureGetRef,
- _BinaryenStringEncodeGetPtr,
- _BinaryenStringEncodeGetRef,
+ _BinaryenStringEncodeGetArray,
+ _BinaryenStringEncodeGetStr,
_BinaryenStringEncodeGetStart,
_BinaryenStringConcatGetLeft,
_BinaryenStringConcatGetRight,
_BinaryenStringEqGetLeft,
_BinaryenStringEqGetRight,
- _BinaryenStringAsGetRef,
- _BinaryenStringWTF8AdvanceGetRef,
- _BinaryenStringWTF8AdvanceGetPos,
- _BinaryenStringWTF8AdvanceGetBytes,
_BinaryenStringWTF16GetGetRef,
_BinaryenStringWTF16GetGetPos,
- _BinaryenStringIterNextGetRef,
- _BinaryenStringIterMoveGetRef,
- _BinaryenStringIterMoveGetNum,
_BinaryenStringSliceWTFGetRef,
_BinaryenStringSliceWTFGetStart,
_BinaryenStringSliceWTFGetEnd,
- _BinaryenStringSliceIterGetRef,
- _BinaryenStringSliceIterGetNum,
_BinaryenCallRefSetOperandAt,
_BinaryenCallRefSetTarget,
_BinaryenRefTestSetRef,
@@ -257,33 +247,23 @@ import {
_BinaryenArrayCopySetSrcIndex,
_BinaryenArrayCopySetLength,
_BinaryenRefAsSetValue,
- _BinaryenStringNewSetPtr,
- _BinaryenStringNewSetLength,
+ _BinaryenStringNewSetRef,
_BinaryenStringNewSetStart,
_BinaryenStringNewSetEnd,
_BinaryenStringMeasureSetRef,
- _BinaryenStringEncodeSetRef,
- _BinaryenStringEncodeSetPtr,
+ _BinaryenStringEncodeSetStr,
+ _BinaryenStringEncodeSetArray,
_BinaryenStringEncodeSetStart,
_BinaryenStringConcatSetLeft,
_BinaryenStringConcatSetRight,
_BinaryenStringEqSetLeft,
_BinaryenStringEqSetRight,
- _BinaryenStringAsSetRef,
- _BinaryenStringWTF8AdvanceSetRef,
- _BinaryenStringWTF8AdvanceSetPos,
- _BinaryenStringWTF8AdvanceSetBytes,
_BinaryenStringWTF16GetSetRef,
_BinaryenStringWTF16GetSetPos,
- _BinaryenStringIterNextSetRef,
- _BinaryenStringIterMoveSetRef,
- _BinaryenStringIterMoveSetNum,
_BinaryenStringSliceWTFSetRef,
_BinaryenStringSliceWTFSetStart,
_BinaryenStringSliceWTFSetEnd,
- _BinaryenStringSliceIterSetRef,
- _BinaryenStringSliceIterSetNum,
- _BinaryenArrayInitSetValueAt
+ _BinaryenArrayNewFixedSetValueAt
} from "../glue/binaryen";
/** Base class of custom Binaryen visitors. */
@@ -512,7 +492,7 @@ export abstract class Visitor {
// unimp
}
- visitI31New(expr: ExpressionRef): void {
+ visitRefI31(expr: ExpressionRef): void {
// unimp
}
@@ -552,7 +532,7 @@ export abstract class Visitor {
// unimp
}
- visitArrayInit(expr: ExpressionRef): void {
+ visitArrayNewFixed(expr: ExpressionRef): void {
// unimp
}
@@ -1040,11 +1020,11 @@ export abstract class Visitor {
this.visitTupleExtract(expr);
break;
}
- case ExpressionId.I31New: {
+ case ExpressionId.RefI31: {
this.stack.push(expr);
- this.visit(_BinaryenI31NewGetValue(expr));
+ this.visit(_BinaryenRefI31GetValue(expr));
assert(this.stack.pop() == expr);
- this.visitI31New(expr);
+ this.visitRefI31(expr);
break;
}
case ExpressionId.I31Get: {
@@ -1127,16 +1107,16 @@ export abstract class Visitor {
this.visitArrayNew(expr);
break;
}
- case ExpressionId.ArrayInit: {
- let numValues = _BinaryenArrayInitGetNumValues(expr);
+ case ExpressionId.ArrayNewFixed: {
+ let numValues = _BinaryenArrayNewFixedGetNumValues(expr);
if (numValues) {
this.stack.push(expr);
for (let i: Index = 0; i < numValues; ++i) {
- this.visit(_BinaryenArrayInitGetValueAt(expr, i));
+ this.visit(_BinaryenArrayNewFixedGetValueAt(expr, i));
}
assert(this.stack.pop() == expr);
}
- this.visitArrayInit(expr);
+ this.visitArrayNewFixed(expr);
break;
}
case ExpressionId.ArrayGet: {
@@ -1183,9 +1163,7 @@ export abstract class Visitor {
}
case ExpressionId.StringNew: {
this.stack.push(expr);
- this.visit(_BinaryenStringNewGetPtr(expr));
- let length = _BinaryenStringNewGetLength(expr); // LM only
- if (length) this.visit(length);
+ this.visit(_BinaryenStringNewGetRef(expr));
let start = _BinaryenStringNewGetStart(expr); // GC only
if (start) this.visit(start);
let end = _BinaryenStringNewGetEnd(expr); // GC only
@@ -1209,8 +1187,8 @@ export abstract class Visitor {
}
case ExpressionId.StringEncode: {
this.stack.push(expr);
- this.visit(_BinaryenStringEncodeGetRef(expr));
- this.visit(_BinaryenStringEncodeGetPtr(expr));
+ this.visit(_BinaryenStringEncodeGetStr(expr));
+ this.visit(_BinaryenStringEncodeGetArray(expr));
let start = _BinaryenStringEncodeGetStart(expr); // GC only
if (start) this.visit(start);
assert(this.stack.pop() == expr);
@@ -1233,22 +1211,6 @@ export abstract class Visitor {
this.visitStringEq(expr);
break;
}
- case ExpressionId.StringAs: {
- this.stack.push(expr);
- this.visit(_BinaryenStringAsGetRef(expr));
- assert(this.stack.pop() == expr);
- this.visitStringAs(expr);
- break;
- }
- case ExpressionId.StringWTF8Advance: {
- this.stack.push(expr);
- this.visit(_BinaryenStringWTF8AdvanceGetRef(expr));
- this.visit(_BinaryenStringWTF8AdvanceGetPos(expr));
- this.visit(_BinaryenStringWTF8AdvanceGetBytes(expr));
- assert(this.stack.pop() == expr);
- this.visitStringWTF8Advance(expr);
- break;
- }
case ExpressionId.StringWTF16Get: {
this.stack.push(expr);
this.visit(_BinaryenStringWTF16GetGetRef(expr));
@@ -1257,21 +1219,6 @@ export abstract class Visitor {
this.visitStringWTF16Get(expr);
break;
}
- case ExpressionId.StringIterNext: {
- this.stack.push(expr);
- this.visit(_BinaryenStringIterNextGetRef(expr));
- assert(this.stack.pop() == expr);
- this.visitStringIterNext(expr);
- break;
- }
- case ExpressionId.StringIterMove: {
- this.stack.push(expr);
- this.visit(_BinaryenStringIterMoveGetRef(expr));
- this.visit(_BinaryenStringIterMoveGetNum(expr));
- assert(this.stack.pop() == expr);
- this.visitStringIterMove(expr);
- break;
- }
case ExpressionId.StringSliceWTF: {
this.stack.push(expr);
this.visit(_BinaryenStringSliceWTFGetRef(expr));
@@ -1281,14 +1228,6 @@ export abstract class Visitor {
this.visitStringSliceWTF(expr);
break;
}
- case ExpressionId.StringSliceIter: {
- this.stack.push(expr);
- this.visit(_BinaryenStringSliceIterGetRef(expr));
- this.visit(_BinaryenStringSliceIterGetNum(expr));
- assert(this.stack.pop() == expr);
- this.visitStringSliceIter(expr);
- break;
- }
default: throw new Error("unexpected expression kind");
}
this._currentExpression = previousExpression;
@@ -1884,10 +1823,10 @@ export function replaceChild(
}
break;
}
- case ExpressionId.I31New: {
- let value = _BinaryenI31NewGetValue(parent);
+ case ExpressionId.RefI31: {
+ let value = _BinaryenRefI31GetValue(parent);
if (value == search) {
- _BinaryenI31NewSetValue(parent, replacement);
+ _BinaryenRefI31SetValue(parent, replacement);
return value;
}
break;
@@ -1985,12 +1924,12 @@ export function replaceChild(
}
break;
}
- case ExpressionId.ArrayInit: {
- let numValues = _BinaryenArrayInitGetNumValues(parent);
+ case ExpressionId.ArrayNewFixed: {
+ let numValues = _BinaryenArrayNewFixedGetNumValues(parent);
for (let i: Index = 0; i < numValues; ++i) {
- let value = _BinaryenArrayInitGetValueAt(parent, i);
+ let value = _BinaryenArrayNewFixedGetValueAt(parent, i);
if (value == search) {
- _BinaryenArrayInitSetValueAt(parent, i, replacement);
+ _BinaryenArrayNewFixedSetValueAt(parent, i, replacement);
return value;
}
}
@@ -2072,16 +2011,11 @@ export function replaceChild(
break;
}
case ExpressionId.StringNew: {
- let ptr = _BinaryenStringNewGetPtr(parent);
+ let ptr = _BinaryenStringNewGetRef(parent);
if (ptr == search) {
- _BinaryenStringNewSetPtr(parent, replacement);
+ _BinaryenStringNewSetRef(parent, replacement);
return ptr;
}
- let length = _BinaryenStringNewGetLength(parent);
- if (length == search) {
- _BinaryenStringNewSetLength(parent, replacement);
- return length;
- }
let start = _BinaryenStringNewGetStart(parent);
if (start == search) {
_BinaryenStringNewSetStart(parent, replacement);
@@ -2106,14 +2040,14 @@ export function replaceChild(
break;
}
case ExpressionId.StringEncode: {
- let ref = _BinaryenStringEncodeGetRef(parent);
+ let ref = _BinaryenStringEncodeGetStr(parent);
if (ref == search) {
- _BinaryenStringEncodeSetRef(parent, replacement);
+ _BinaryenStringEncodeSetStr(parent, replacement);
return ref;
}
- let ptr = _BinaryenStringEncodeGetPtr(parent);
+ let ptr = _BinaryenStringEncodeGetArray(parent);
if (ptr == search) {
- _BinaryenStringEncodeSetPtr(parent, replacement);
+ _BinaryenStringEncodeSetArray(parent, replacement);
return ptr;
}
let start = _BinaryenStringEncodeGetStart(parent);
@@ -2149,32 +2083,6 @@ export function replaceChild(
}
break;
}
- case ExpressionId.StringAs: {
- let ref = _BinaryenStringAsGetRef(parent);
- if (ref == search) {
- _BinaryenStringAsSetRef(parent, replacement);
- return ref;
- }
- break;
- }
- case ExpressionId.StringWTF8Advance: {
- let ref = _BinaryenStringWTF8AdvanceGetRef(parent);
- if (ref == search) {
- _BinaryenStringWTF8AdvanceSetRef(parent, replacement);
- return ref;
- }
- let pos = _BinaryenStringWTF8AdvanceGetPos(parent);
- if (pos == search) {
- _BinaryenStringWTF8AdvanceSetPos(parent, replacement);
- return pos;
- }
- let bytes = _BinaryenStringWTF8AdvanceGetBytes(parent);
- if (bytes == search) {
- _BinaryenStringWTF8AdvanceSetBytes(parent, replacement);
- return bytes;
- }
- break;
- }
case ExpressionId.StringWTF16Get: {
let ref = _BinaryenStringWTF16GetGetRef(parent);
if (ref == search) {
@@ -2188,27 +2096,6 @@ export function replaceChild(
}
break;
}
- case ExpressionId.StringIterNext: {
- let ref = _BinaryenStringIterNextGetRef(parent);
- if (ref == search) {
- _BinaryenStringIterNextSetRef(parent, replacement);
- return ref;
- }
- break;
- }
- case ExpressionId.StringIterMove: {
- let ref = _BinaryenStringIterMoveGetRef(parent);
- if (ref == search) {
- _BinaryenStringIterMoveSetRef(parent, replacement);
- return ref;
- }
- let num = _BinaryenStringIterMoveGetNum(parent);
- if (num == search) {
- _BinaryenStringIterMoveSetNum(parent, replacement);
- return num;
- }
- break;
- }
case ExpressionId.StringSliceWTF: {
let ref = _BinaryenStringSliceWTFGetRef(parent);
if (ref == search) {
@@ -2227,19 +2114,6 @@ export function replaceChild(
}
break;
}
- case ExpressionId.StringSliceIter: {
- let ref = _BinaryenStringSliceIterGetRef(parent);
- if (ref == search) {
- _BinaryenStringSliceIterSetRef(parent, replacement);
- return ref;
- }
- let num = _BinaryenStringSliceIterGetNum(parent);
- if (num == search) {
- _BinaryenStringSliceIterSetNum(parent, replacement);
- return num;
- }
- break;
- }
default: throw new Error("unexpected expression id");
}
return 0;
diff --git a/src/passes/shadowstack.ts b/src/passes/shadowstack.ts
index 468009202e..d34997ed08 100644
--- a/src/passes/shadowstack.ts
+++ b/src/passes/shadowstack.ts
@@ -159,18 +159,21 @@ type TempMap = Map;
/** Attempts to match the `__tostack(value)` pattern. Returns `value` if a match, otherwise `0`. */
function matchPattern(module: Module, expr: ExpressionRef): ExpressionRef {
- if (
+ let isFound = false;
+ while (
_BinaryenExpressionGetId(expr) == ExpressionId.Call &&
module.readStringCached(_BinaryenCallGetTarget(expr)) == BuiltinNames.tostack
) {
assert(_BinaryenCallGetNumOperands(expr) == 1);
- return _BinaryenCallGetOperandAt(expr, 0);
+ expr = _BinaryenCallGetOperandAt(expr, 0);
+ isFound = true;
}
- return 0;
+ if (!isFound) return 0;
+ return expr;
}
/** Tests whether a `value` matched by `matchTostack` needs a slot. */
-function needsSlot(module: Module, value: ExpressionRef): bool {
+function needsSlot(value: ExpressionRef): bool {
switch (_BinaryenExpressionGetId(value)) {
// no need to stack null pointers
case ExpressionId.Const: return !isConstZero(value);
@@ -344,13 +347,13 @@ export class ShadowStackPass extends Pass {
let operand = operands[i];
let match = matchPattern(module, operand);
if (!match) continue;
- if (!needsSlot(module, match)) {
+ if (!needsSlot(match)) {
operands[i] = match;
continue;
}
let currentFunction = this.currentFunction;
let numLocals = _BinaryenFunctionGetNumLocals(currentFunction);
- let slotIndex = this.noteSlot(currentFunction, numLocals + this.callSlotOffset + i);
+ let slotIndex = this.noteSlot(currentFunction, numLocals + this.callSlotOffset + numSlots);
let temp = this.getSharedTemp(currentFunction, this.ptrType);
let stmts = new Array();
// t = value
@@ -434,7 +437,7 @@ export class ShadowStackPass extends Pass {
let value = _BinaryenLocalSetGetValue(localSet);
let match = matchPattern(module, value);
if (!match) return;
- if (!needsSlot(module, match)) {
+ if (!needsSlot(match)) {
_BinaryenLocalSetSetValue(localSet, match);
return;
}
diff --git a/src/program.ts b/src/program.ts
index 18ebd57a6d..8bcf1bfa19 100644
--- a/src/program.ts
+++ b/src/program.ts
@@ -116,6 +116,7 @@ import {
import {
Module,
+ ExpressionRef,
FunctionRef,
MemorySegment,
getFunctionName
@@ -389,8 +390,10 @@ export namespace OperatorKind {
case Token.GreaterThan_GreaterThan_Equals: return OperatorKind.BitwiseShr;
case Token.GreaterThan_GreaterThan_GreaterThan:
case Token.GreaterThan_GreaterThan_GreaterThan_Equals: return OperatorKind.BitwiseShrU;
- case Token.Equals_Equals: return OperatorKind.Eq;
- case Token.Exclamation_Equals: return OperatorKind.Ne;
+ case Token.Equals_Equals:
+ case Token.Equals_Equals_Equals: return OperatorKind.Eq;
+ case Token.Exclamation_Equals:
+ case Token.Exclamation_Equals_Equals: return OperatorKind.Ne;
case Token.GreaterThan: return OperatorKind.Gt;
case Token.GreaterThan_Equals: return OperatorKind.Ge;
case Token.LessThan: return OperatorKind.Lt;
@@ -1014,17 +1017,17 @@ export class Program extends DiagnosticEmitter {
// compiler needs to check this condition whenever such a value is created
// respectively stored or loaded.
this.registerNativeType(CommonNames.v128, Type.v128);
- this.registerNativeType(CommonNames.funcref, Type.funcref);
- this.registerNativeType(CommonNames.externref, Type.externref);
- this.registerNativeType(CommonNames.anyref, Type.anyref);
- this.registerNativeType(CommonNames.eqref, Type.eqref);
- this.registerNativeType(CommonNames.structref, Type.structref);
- this.registerNativeType(CommonNames.arrayref, Type.arrayref);
- this.registerNativeType(CommonNames.i31ref, Type.i31ref);
- this.registerNativeType(CommonNames.stringref, Type.stringref);
- this.registerNativeType(CommonNames.stringview_wtf8, Type.stringview_wtf8);
- this.registerNativeType(CommonNames.stringview_wtf16, Type.stringview_wtf16);
- this.registerNativeType(CommonNames.stringview_iter, Type.stringview_iter);
+ this.registerNativeType(CommonNames.ref_func, Type.func);
+ this.registerNativeType(CommonNames.ref_extern, Type.extern);
+ this.registerNativeType(CommonNames.ref_any, Type.any);
+ this.registerNativeType(CommonNames.ref_eq, Type.eq);
+ this.registerNativeType(CommonNames.ref_struct, Type.struct);
+ this.registerNativeType(CommonNames.ref_array, Type.array);
+ this.registerNativeType(CommonNames.ref_i31, Type.i31);
+ this.registerNativeType(CommonNames.ref_string, Type.string);
+ this.registerNativeType(CommonNames.ref_stringview_wtf8, Type.stringview_wtf8);
+ this.registerNativeType(CommonNames.ref_stringview_wtf16, Type.stringview_wtf16);
+ this.registerNativeType(CommonNames.ref_stringview_iter, Type.stringview_iter);
// register compiler hints
this.registerConstantInteger(CommonNames.ASC_TARGET, Type.i32,
@@ -1288,14 +1291,17 @@ export class Program extends DiagnosticEmitter {
this.registerWrapperClass(Type.f64, CommonNames.F64);
if (options.hasFeature(Feature.Simd)) this.registerWrapperClass(Type.v128, CommonNames.V128);
if (options.hasFeature(Feature.ReferenceTypes)) {
- this.registerWrapperClass(Type.funcref, CommonNames.Funcref);
- this.registerWrapperClass(Type.externref, CommonNames.Externref);
+ this.registerWrapperClass(Type.func, CommonNames.RefFunc);
+ this.registerWrapperClass(Type.extern, CommonNames.RefExtern);
if (options.hasFeature(Feature.GC)) {
- this.registerWrapperClass(Type.anyref, CommonNames.Anyref);
- this.registerWrapperClass(Type.eqref, CommonNames.Eqref);
- this.registerWrapperClass(Type.structref, CommonNames.Structref);
- this.registerWrapperClass(Type.arrayref, CommonNames.Arrayref);
- this.registerWrapperClass(Type.i31ref, CommonNames.I31ref);
+ this.registerWrapperClass(Type.any, CommonNames.RefAny);
+ this.registerWrapperClass(Type.eq, CommonNames.RefEq);
+ this.registerWrapperClass(Type.struct, CommonNames.RefStruct);
+ this.registerWrapperClass(Type.array, CommonNames.RefArray);
+ this.registerWrapperClass(Type.i31, CommonNames.RefI31);
+ }
+ if (options.hasFeature(Feature.Stringref)) {
+ this.registerWrapperClass(Type.string, CommonNames.RefString);
}
}
@@ -1304,7 +1310,7 @@ export class Program extends DiagnosticEmitter {
for (let i = 0, k = queuedExtends.length; i < k; ++i) {
let thisPrototype = queuedExtends[i];
let extendsNode = assert(thisPrototype.extendsNode); // must be present if in queuedExtends
- let baseElement = resolver.resolveTypeName(extendsNode.name, thisPrototype.parent);
+ let baseElement = resolver.resolveTypeName(extendsNode.name, null, thisPrototype.parent);
if (!baseElement) continue;
if (thisPrototype.kind == ElementKind.ClassPrototype) {
if (baseElement.kind == ElementKind.ClassPrototype) {
@@ -1401,7 +1407,7 @@ export class Program extends DiagnosticEmitter {
let implementsNodes = assert(thisPrototype.implementsNodes); // must be present if in queuedImplements
for (let j = 0, l = implementsNodes.length; j < l; ++j) {
let implementsNode = implementsNodes[j];
- let interfaceElement = resolver.resolveTypeName(implementsNode.name, thisPrototype.parent);
+ let interfaceElement = resolver.resolveTypeName(implementsNode.name, null, thisPrototype.parent);
if (!interfaceElement) continue;
if (interfaceElement.kind == ElementKind.InterfacePrototype) {
let interfacePrototype = interfaceElement;
@@ -1950,18 +1956,20 @@ export class Program extends DiagnosticEmitter {
checkTypeSupported(type: Type, reportNode: Node): bool {
switch (type.kind) {
case TypeKind.V128: return this.checkFeatureEnabled(Feature.Simd, reportNode);
- case TypeKind.Funcref:
- case TypeKind.Externref:
+ case TypeKind.Func:
+ case TypeKind.Extern:
+ // Non-nullability is introduced by typed function references (here part of GC)
+ if (!type.is(TypeFlags.Nullable)) return this.checkFeatureEnabled(Feature.GC, reportNode);
return this.checkFeatureEnabled(Feature.ReferenceTypes, reportNode);
- case TypeKind.Anyref:
- case TypeKind.Eqref:
- case TypeKind.Structref:
- case TypeKind.Arrayref:
- case TypeKind.I31ref: {
+ case TypeKind.Any:
+ case TypeKind.Eq:
+ case TypeKind.Struct:
+ case TypeKind.Array:
+ case TypeKind.I31: {
return this.checkFeatureEnabled(Feature.ReferenceTypes, reportNode)
&& this.checkFeatureEnabled(Feature.GC, reportNode);
}
- case TypeKind.Stringref:
+ case TypeKind.String:
case TypeKind.StringviewWTF8:
case TypeKind.StringviewWTF16:
case TypeKind.StringviewIter: {
@@ -2665,6 +2673,10 @@ export class Program extends DiagnosticEmitter {
/** Parent interface. */
parent: InterfacePrototype
): void {
+ let initializer = declaration.initializer;
+ if (initializer) {
+ this.error(DiagnosticCode.An_interface_property_cannot_have_an_initializer, initializer.range);
+ }
let typeNode = declaration.type;
if (!typeNode) typeNode = Node.createOmittedType(declaration.name.range.atEnd);
this.initializeProperty(
@@ -3078,6 +3090,13 @@ export abstract class Element {
return (this.flags & vis) == (other.flags & vis);
}
+ visibilityNoLessThan(other: Element): bool {
+ if (this.isPublic) return true; // public is a most frequent case
+ if (this.is(CommonFlags.Private)) return other.is(CommonFlags.Private);
+ if (this.is(CommonFlags.Protected)) return other.isAny(CommonFlags.Private | CommonFlags.Protected);
+ return assert(false);
+ }
+
/** Tests if this element is bound to a class. */
get isBound(): bool {
let parent = this.parent;
@@ -3366,7 +3385,7 @@ export class TypeDefinition extends TypedElement {
constructor(
/** Simple name. */
name: string,
- /** Parent element, usually a file or namespace. */
+ /** Parent element. */
parent: Element,
/** Declaration reference. */
declaration: TypeDeclaration,
@@ -3430,7 +3449,7 @@ export class Namespace extends DeclaredElement {
/** An enum. */
export class Enum extends TypedElement {
-
+ toStringFunctionName: string | null = null;
/** Constructs a new enum. */
constructor(
/** Simple name. */
@@ -3633,6 +3652,10 @@ export class Local extends VariableLikeElement {
assert(type != Type.void);
this.setType(type);
}
+
+ declaredByFlow(flow: Flow): bool {
+ return this.parent == flow.targetFunction;
+ }
}
/** A yet unresolved function prototype. */
@@ -3744,8 +3767,8 @@ export class Function extends TypedElement {
contextualTypeArguments: Map | null;
/** Default control flow. */
flow!: Flow;
- /** Remembered debug locations. */
- debugLocations: Range[] = [];
+ /** Ordered debug locations by Binaryen expression reference. */
+ debugLocations: Map = new Map();
/** Function reference, if compiled. */
ref: FunctionRef = 0;
/** Varargs stub for calling with omitted arguments. */
@@ -3913,12 +3936,13 @@ export class Function extends TypedElement {
addDebugInfo(module: Module, ref: FunctionRef): void {
if (this.program.options.sourceMap) {
let debugLocations = this.debugLocations;
- for (let i = 0, k = debugLocations.length; i < k; ++i) {
- let range = debugLocations[i];
+ for (let _keys = Map_keys(debugLocations), i = 0, k = _keys.length; i < k; ++i) {
+ let expressionRef = _keys[i];
+ let range = assert(debugLocations.get(expressionRef));
let source = range.source;
module.setDebugLocation(
ref,
- range.debugInfoRef,
+ expressionRef,
source.debugInfoIndex,
source.lineAt(range.start),
source.columnAt() - 1 // source maps are 0-based
@@ -4159,6 +4183,17 @@ export class Property extends VariableLikeElement {
get isField(): bool {
return this.prototype.isField;
}
+
+ checkVisibility(diag: DiagnosticEmitter): void {
+ let propertyGetter = this.getterInstance;
+ let propertySetter = this.setterInstance;
+ if (propertyGetter && propertySetter && !propertyGetter.visibilityNoLessThan(propertySetter)) {
+ diag.errorRelated(
+ DiagnosticCode.Get_accessor_0_must_be_at_least_as_accessible_as_the_setter,
+ propertyGetter.identifierNode.range, propertySetter.identifierNode.range, propertyGetter.identifierNode.text
+ );
+ }
+ }
}
/** A resolved index signature. */
diff --git a/src/resolver.ts b/src/resolver.ts
index c54f555993..0823838fa2 100644
--- a/src/resolver.ts
+++ b/src/resolver.ts
@@ -103,7 +103,9 @@ import {
} from "./tokenizer";
import {
- BuiltinNames
+ BuiltinNames,
+ builtinTypes,
+ BuiltinTypesContext
} from "./builtins";
/** Indicates whether errors are reported or not. */
@@ -142,6 +144,8 @@ export class Resolver extends DiagnosticEmitter {
resolveType(
/** The type to resolve. */
node: TypeNode,
+ /** The flow */
+ flow: Flow | null,
/** Contextual element. */
ctxElement: Element,
/** Contextual types, i.e. `T`. */
@@ -160,21 +164,11 @@ export class Resolver extends DiagnosticEmitter {
let resolved: Type | null = null;
switch (node.kind) {
case NodeKind.NamedType: {
- resolved = this.resolveNamedType(
- node,
- ctxElement,
- ctxTypes,
- reportMode
- );
+ resolved = this.resolveNamedType(node, flow, ctxElement, ctxTypes, reportMode);
break;
}
case NodeKind.FunctionType: {
- resolved = this.resolveFunctionType(
- node,
- ctxElement,
- ctxTypes,
- reportMode
- );
+ resolved = this.resolveFunctionType(node, flow, ctxElement, ctxTypes, reportMode);
break;
}
default: assert(false);
@@ -187,6 +181,8 @@ export class Resolver extends DiagnosticEmitter {
private resolveNamedType(
/** The type to resolve. */
node: NamedTypeNode,
+ /** The flow */
+ flow: Flow | null,
/** Contextual element. */
ctxElement: Element,
/** Contextual types, i.e. `T`. */
@@ -212,7 +208,7 @@ export class Resolver extends DiagnosticEmitter {
}
}
if (node.isNullable) {
- if (type.isInternalReference) return type.asNullable();
+ if (type.isReference) return type.asNullable();
if (reportMode == ReportMode.Report) {
this.error(
DiagnosticCode.Type_0_cannot_be_nullable,
@@ -225,7 +221,7 @@ export class Resolver extends DiagnosticEmitter {
}
// Look up in context
- let element = this.resolveTypeName(nameNode, ctxElement, reportMode);
+ let element = this.resolveTypeName(nameNode, flow, ctxElement, reportMode);
if (!element) return null;
// Use shadow type if present (i.e. namespace sharing a type)
@@ -264,6 +260,7 @@ export class Resolver extends DiagnosticEmitter {
let instance = this.resolveClassInclTypeArguments(
element,
typeArgumentNodes,
+ flow,
ctxElement,
cloneMap(ctxTypes), // don't inherit
node,
@@ -290,7 +287,7 @@ export class Resolver extends DiagnosticEmitter {
}
let type = typeDefinition.type;
if (node.isNullable) {
- if (type.isInternalReference) return type.asNullable();
+ if (type.isReference) return type.asNullable();
if (reportMode == ReportMode.Report) {
this.error(
DiagnosticCode.Type_0_cannot_be_nullable,
@@ -304,11 +301,11 @@ export class Resolver extends DiagnosticEmitter {
// Handle special built-in types
if (isSimpleType) {
let text = nameNode.identifier.text;
- if (text == CommonNames.native) return this.resolveBuiltinNativeType(node, ctxElement, ctxTypes, reportMode);
- if (text == CommonNames.indexof) return this.resolveBuiltinIndexofType(node, ctxElement, ctxTypes, reportMode);
- if (text == CommonNames.valueof) return this.resolveBuiltinValueofType(node, ctxElement, ctxTypes, reportMode);
- if (text == CommonNames.returnof) return this.resolveBuiltinReturnTypeType(node, ctxElement, ctxTypes, reportMode);
- if (text == CommonNames.nonnull) return this.resolveBuiltinNotNullableType(node, ctxElement, ctxTypes, reportMode);
+ if (builtinTypes.has(text)) {
+ let fn = assert(builtinTypes.get(text));
+ let ctx = new BuiltinTypesContext(this, node, ctxElement, ctxTypes, reportMode);
+ return fn(ctx);
+ }
}
// Resolve normally
@@ -318,6 +315,7 @@ export class Resolver extends DiagnosticEmitter {
typeArguments = this.resolveTypeArguments(
typeParameterNodes,
typeArgumentNodes,
+ flow,
ctxElement,
ctxTypes = cloneMap(ctxTypes), // update
node,
@@ -332,13 +330,14 @@ export class Resolver extends DiagnosticEmitter {
}
let type = this.resolveType(
typeDefinition.typeNode,
+ flow,
element,
ctxTypes,
reportMode
);
if (!type) return null;
if (node.isNullable) {
- if (type.isInternalReference) return type.asNullable();
+ if (type.isReference) return type.asNullable();
if (reportMode == ReportMode.Report) {
this.error(
DiagnosticCode.Type_0_cannot_be_nullable,
@@ -361,6 +360,8 @@ export class Resolver extends DiagnosticEmitter {
private resolveFunctionType(
/** The type to resolve. */
node: FunctionTypeNode,
+ /** The flow */
+ flow: Flow | null,
/** Contextual element. */
ctxElement: Element,
/** Contextual types, i.e. `T`. */
@@ -373,6 +374,7 @@ export class Resolver extends DiagnosticEmitter {
if (explicitThisType) {
thisType = this.resolveType(
explicitThisType,
+ flow,
ctxElement,
ctxTypes,
reportMode
@@ -392,7 +394,7 @@ export class Resolver extends DiagnosticEmitter {
break;
}
case ParameterKind.Rest: {
- assert(i == numParameters);
+ assert(i == numParameters - 1);
hasRest = true;
break;
}
@@ -409,6 +411,7 @@ export class Resolver extends DiagnosticEmitter {
}
let parameterType = this.resolveType(
parameterTypeNode,
+ flow,
ctxElement,
ctxTypes,
reportMode
@@ -429,6 +432,7 @@ export class Resolver extends DiagnosticEmitter {
} else {
returnType = this.resolveType(
returnTypeNode,
+ flow,
ctxElement,
ctxTypes,
reportMode
@@ -439,138 +443,6 @@ export class Resolver extends DiagnosticEmitter {
return node.isNullable ? signature.type.asNullable() : signature.type;
}
- private resolveBuiltinNativeType(
- /** The type to resolve. */
- node: NamedTypeNode,
- /** Contextual element. */
- ctxElement: Element,
- /** Contextual types, i.e. `T`. */
- ctxTypes: Map | null = null,
- /** How to proceed with eventual diagnostics. */
- reportMode: ReportMode = ReportMode.Report
- ): Type | null {
- const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode);
- if (!typeArgumentNode) return null;
- let typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode);
- if (!typeArgument) return null;
- switch (typeArgument.kind) {
- case TypeKind.I8:
- case TypeKind.I16:
- case TypeKind.I32: return Type.i32;
- case TypeKind.Isize: if (!this.program.options.isWasm64) return Type.i32;
- case TypeKind.I64: return Type.i64;
- case TypeKind.U8:
- case TypeKind.U16:
- case TypeKind.U32:
- case TypeKind.Bool: return Type.u32;
- case TypeKind.Usize: if (!this.program.options.isWasm64) return Type.u32;
- case TypeKind.U64: return Type.u64;
- case TypeKind.F32: return Type.f32;
- case TypeKind.F64: return Type.f64;
- case TypeKind.V128: return Type.v128;
- case TypeKind.Void: return Type.void;
- default: assert(false);
- }
- return null;
- }
-
- private resolveBuiltinIndexofType(
- /** The type to resolve. */
- node: NamedTypeNode,
- /** Contextual element. */
- ctxElement: Element,
- /** Contextual types, i.e. `T`. */
- ctxTypes: Map | null = null,
- /** How to proceed with eventual diagnostics. */
- reportMode: ReportMode = ReportMode.Report
- ): Type | null {
- const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode);
- if (!typeArgumentNode) return null;
- let typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode);
- if (!typeArgument) return null;
- let classReference = typeArgument.classReference;
- if (!classReference) {
- if (reportMode == ReportMode.Report) {
- this.error(
- DiagnosticCode.Index_signature_is_missing_in_type_0,
- typeArgumentNode.range, typeArgument.toString()
- );
- }
- return null;
- }
- let overload = classReference.lookupOverload(OperatorKind.IndexedGet);
- if (overload) {
- let parameterTypes = overload.signature.parameterTypes;
- if (overload.is(CommonFlags.Static)) {
- assert(parameterTypes.length == 2);
- return parameterTypes[1];
- } else {
- assert(parameterTypes.length == 1);
- return parameterTypes[0];
- }
- }
- if (reportMode == ReportMode.Report) {
- this.error(
- DiagnosticCode.Index_signature_is_missing_in_type_0,
- typeArgumentNode.range, typeArgument.toString()
- );
- }
- return null;
- }
-
- private resolveBuiltinValueofType(
- /** The type to resolve. */
- node: NamedTypeNode,
- /** Contextual element. */
- ctxElement: Element,
- /** Contextual types, i.e. `T`. */
- ctxTypes: Map | null = null,
- /** How to proceed with eventual diagnostics. */
- reportMode: ReportMode = ReportMode.Report
- ): Type | null {
- const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode);
- if (!typeArgumentNode) return null;
- let typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode);
- if (!typeArgument) return null;
- let classReference = typeArgument.getClassOrWrapper(this.program);
- if (classReference) {
- let overload = classReference.lookupOverload(OperatorKind.IndexedGet);
- if (overload) return overload.signature.returnType;
- }
- if (reportMode == ReportMode.Report) {
- this.error(
- DiagnosticCode.Index_signature_is_missing_in_type_0,
- typeArgumentNode.range, typeArgument.toString()
- );
- }
- return null;
- }
-
- private resolveBuiltinReturnTypeType(
- /** The type to resolve. */
- node: NamedTypeNode,
- /** Contextual element. */
- ctxElement: Element,
- /** Contextual types, i.e. `T`. */
- ctxTypes: Map | null = null,
- /** How to proceed with eventualy diagnostics. */
- reportMode: ReportMode = ReportMode.Report
- ): Type | null {
- const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode);
- if (!typeArgumentNode) return null;
- let typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode);
- if (!typeArgument) return null;
- let signatureReference = typeArgument.getSignature();
- if (signatureReference) return signatureReference.returnType;
- if (reportMode == ReportMode.Report) {
- this.error(
- DiagnosticCode.Type_0_has_no_call_signatures,
- typeArgumentNode.range, typeArgument.toString()
- );
- }
- return null;
- }
-
private resolveBuiltinNotNullableType(
/** The type to resolve. */
node: NamedTypeNode,
@@ -583,7 +455,7 @@ export class Resolver extends DiagnosticEmitter {
): Type | null {
const typeArgumentNode = this.ensureOneTypeArgument(node, reportMode);
if (!typeArgumentNode) return null;
- let typeArgument = this.resolveType(typeArgumentNode, ctxElement, ctxTypes, reportMode);
+ let typeArgument = this.resolveType(typeArgumentNode, null, ctxElement, ctxTypes, reportMode);
if (!typeArgument) return null;
if (!typeArgument.isNullableReference) return typeArgument;
return typeArgument.nonNullableType;
@@ -593,12 +465,16 @@ export class Resolver extends DiagnosticEmitter {
resolveTypeName(
/** The type name to resolve. */
node: TypeName,
+ /** The flow */
+ flow: Flow | null,
/** Contextual element. */
ctxElement: Element,
/** How to proceed with eventual diagnostics. */
reportMode: ReportMode = ReportMode.Report
): Element | null {
- let element = ctxElement.lookup(node.identifier.text, true);
+ let element: Element | null = null;
+ if (flow) element = flow.lookupTypeAlias(node.identifier.text);
+ if (!element) element = ctxElement.lookup(node.identifier.text, true);
if (!element) {
if (reportMode == ReportMode.Report) {
this.error(
@@ -632,6 +508,8 @@ export class Resolver extends DiagnosticEmitter {
typeParameters: TypeParameterNode[],
/** Type argument nodes provided. */
typeArgumentNodes: TypeNode[] | null,
+ /** Flow */
+ flow: Flow | null,
/** Contextual element. */
ctxElement: Element,
/** Contextual types, i.e. `T`. Updated in place with the new set of contextual types. */
@@ -641,9 +519,8 @@ export class Resolver extends DiagnosticEmitter {
/** How to proceed with eventual diagnostics. */
reportMode: ReportMode = ReportMode.Report
): Type[] | null {
- var
- minParameterCount = 0,
- maxParameterCount = 0;
+ let minParameterCount = 0;
+ let maxParameterCount = 0;
for (let i = 0, k = typeParameters.length; i < k; ++i) {
if (!typeParameters[i].defaultType) ++minParameterCount;
++maxParameterCount;
@@ -672,12 +549,14 @@ export class Resolver extends DiagnosticEmitter {
let type = i < argumentCount
? this.resolveType( // reports
typeArgumentNodes![i],
+ flow,
ctxElement,
oldCtxTypes, // update
reportMode
)
: this.resolveType( // reports
assert(typeParameters[i].defaultType),
+ flow,
ctxElement,
cloneMap(ctxTypes), // don't update
reportMode
@@ -722,109 +601,179 @@ export class Resolver extends DiagnosticEmitter {
// infer generic call if type arguments have been omitted
if (prototype.is(CommonFlags.Generic)) {
- let contextualTypeArguments = cloneMap(ctxFlow.contextualTypeArguments);
+ let resolvedTypeArguments = this.inferGenericTypeArguments(
+ node,
+ prototype,
+ prototype.typeParameterNodes,
+ ctxFlow,
+ reportMode,
+ );
+ if (!resolvedTypeArguments) {
+ return null;
+ }
+ return this.resolveFunction(
+ prototype,
+ resolvedTypeArguments,
+ cloneMap(ctxFlow.contextualTypeArguments),
+ reportMode
+ );
+ }
- // fill up contextual types with auto for each generic component
- let typeParameterNodes = assert(prototype.typeParameterNodes);
- let numTypeParameters = typeParameterNodes.length;
- let typeParameterNames = new Set();
- for (let i = 0; i < numTypeParameters; ++i) {
- let name = typeParameterNodes[i].name.text;
- contextualTypeArguments.set(name, Type.auto);
- typeParameterNames.add(name);
- }
-
- let parameterNodes = prototype.functionTypeNode.parameters;
- let numParameters = parameterNodes.length;
- let argumentNodes = node.args;
- let numArguments = argumentNodes.length;
-
- // infer types with generic components while updating contextual types
- for (let i = 0; i < numParameters; ++i) {
- let argumentExpression = i < numArguments
- ? argumentNodes[i]
- : parameterNodes[i].initializer;
- if (!argumentExpression) {
- // optional but not have initializer should be handled in the other place
- if (parameterNodes[i].parameterKind == ParameterKind.Optional) {
- continue;
- }
- // missing initializer -> too few arguments
- if (reportMode == ReportMode.Report) {
+ // otherwise resolve the non-generic call as usual
+ return this.resolveFunction(prototype, null, new Map(), reportMode);
+ }
+
+ private inferGenericTypeArguments(
+ node: Expression,
+ prototype: FunctionPrototype,
+ typeParameterNodes: TypeParameterNode[] | null,
+ ctxFlow: Flow,
+ reportMode: ReportMode = ReportMode.Report,
+ ): Type[] | null {
+
+ if (!typeParameterNodes) {
+ return null;
+ }
+
+ let contextualTypeArguments = cloneMap(ctxFlow.contextualTypeArguments);
+
+ // fill up contextual types with auto for each generic component
+ let numTypeParameters = typeParameterNodes.length;
+ let typeParameterNames = new Set();
+ for (let i = 0; i < numTypeParameters; ++i) {
+ let name = typeParameterNodes[i].name.text;
+ contextualTypeArguments.set(name, Type.auto);
+ typeParameterNames.add(name);
+ }
+
+ let parameterNodes = prototype.functionTypeNode.parameters;
+ let numParameters = parameterNodes.length;
+
+ let argumentNodes: Expression[];
+ let argumentsRange: Range;
+ switch (node.kind) {
+ case NodeKind.Call: {
+ const expr = node as CallExpression;
+ argumentNodes = expr.args;
+ argumentsRange = expr.argumentsRange;
+ break;
+ }
+ case NodeKind.New: {
+ const expr = node as NewExpression;
+ argumentNodes = expr.args;
+ argumentsRange = expr.argumentsRange;
+ break;
+ }
+ default: {
+ assert(false);
+ return null;
+ }
+ }
+
+ let numArguments = argumentNodes.length;
+
+ // infer types with generic components while updating contextual types
+ for (let i = 0; i < numParameters; ++i) {
+ let argumentExpression = i < numArguments
+ ? argumentNodes[i]
+ : parameterNodes[i].initializer;
+ if (!argumentExpression) {
+ // optional but not have initializer should be handled in the other place
+ if (parameterNodes[i].parameterKind == ParameterKind.Optional) {
+ continue;
+ }
+ if (reportMode == ReportMode.Report) {
+ if (parameterNodes[i].parameterKind == ParameterKind.Rest) {
+ // rest params are optional, but one element is needed for type inference
+ this.error(
+ DiagnosticCode.Type_argument_expected,
+ argumentsRange.atEnd
+ );
+ } else {
+ // missing initializer -> too few arguments
this.error(
DiagnosticCode.Expected_0_arguments_but_got_1,
node.range, numParameters.toString(), numArguments.toString()
);
}
- return null;
}
- let typeNode = parameterNodes[i].type;
- if (typeNode.hasGenericComponent(typeParameterNodes)) {
- let type = this.resolveExpression(argumentExpression, ctxFlow, Type.auto, ReportMode.Swallow);
- if (type) {
- this.propagateInferredGenericTypes(
- typeNode,
- type,
- prototype,
- contextualTypeArguments,
- typeParameterNames
- );
- }
+ return null;
+ }
+ let typeNode = parameterNodes[i].type;
+ if (parameterNodes[i].parameterKind == ParameterKind.Rest) {
+ typeNode = ( typeNode).typeArguments![0];
+ }
+ if (typeNode.hasGenericComponent(typeParameterNodes)) {
+ let type = this.resolveExpression(argumentExpression, ctxFlow, Type.auto, ReportMode.Swallow);
+ if (type) {
+ this.propagateInferredGenericTypes(
+ typeNode,
+ type,
+ prototype,
+ contextualTypeArguments,
+ typeParameterNames
+ );
}
}
+ }
- // apply concrete types to the generic function signature
- let resolvedTypeArguments = new Array(numTypeParameters);
- for (let i = 0; i < numTypeParameters; ++i) {
- let typeParameterNode = typeParameterNodes[i];
- let name = typeParameterNode.name.text;
- if (contextualTypeArguments.has(name)) {
- let inferredType = assert(contextualTypeArguments.get(name));
- if (inferredType != Type.auto) {
- resolvedTypeArguments[i] = inferredType;
- continue;
+ // apply concrete types to the generic function signature
+ let resolvedTypeArguments = new Array(numTypeParameters);
+ for (let i = 0; i < numTypeParameters; ++i) {
+ let typeParameterNode = typeParameterNodes[i];
+ let name = typeParameterNode.name.text;
+ if (contextualTypeArguments.has(name)) {
+ let inferredType = assert(contextualTypeArguments.get(name));
+ if (inferredType != Type.auto) {
+ resolvedTypeArguments[i] = inferredType;
+ continue;
+ }
+ let defaultType = typeParameterNode.defaultType;
+ if (defaultType) {
+ // Default parameters are resolved in context of the called function, not the calling function
+ let parent = prototype.parent;
+ let defaultTypeContextualTypeArguments: Map | null = null;
+ if (parent.kind == ElementKind.Class) {
+ defaultTypeContextualTypeArguments = (parent).contextualTypeArguments;
+ } else if (parent.kind == ElementKind.Function) {
+ defaultTypeContextualTypeArguments = (parent).contextualTypeArguments;
}
- let defaultType = typeParameterNode.defaultType;
- if (defaultType) {
- // Default parameters are resolved in context of the called function, not the calling function
- let parent = prototype.parent;
- let defaultTypeContextualTypeArguments: Map | null = null;
- if (parent.kind == ElementKind.Class) {
- defaultTypeContextualTypeArguments = (parent).contextualTypeArguments;
- } else if (parent.kind == ElementKind.Function) {
- defaultTypeContextualTypeArguments = (parent).contextualTypeArguments;
- }
- let resolvedDefaultType = this.resolveType(
- defaultType,
- prototype,
- defaultTypeContextualTypeArguments,
- reportMode
- );
- if (!resolvedDefaultType) return null;
- resolvedTypeArguments[i] = resolvedDefaultType;
- continue;
- }
- }
- // unused template, e.g. `function test(): void {...}` called as `test()`
- // invalid because the type is effectively unknown inside the function body
- if (reportMode == ReportMode.Report) {
- this.error(
- DiagnosticCode.Type_argument_expected,
- node.expression.range.atEnd
+ let resolvedDefaultType = this.resolveType(
+ defaultType,
+ null,
+ prototype,
+ defaultTypeContextualTypeArguments,
+ reportMode
);
+ if (!resolvedDefaultType) return null;
+ resolvedTypeArguments[i] = resolvedDefaultType;
+ continue;
}
- return null;
}
- return this.resolveFunction(
- prototype,
- resolvedTypeArguments,
- cloneMap(ctxFlow.contextualTypeArguments),
- reportMode
- );
+ // unused template, e.g. `function test(): void {...}` called as `test()`
+ // invalid because the type is effectively unknown inside the function body
+ if (reportMode == ReportMode.Report) {
+ let range: Range;
+ switch (node.kind) {
+ case NodeKind.Call:
+ range = (node).expression.range;
+ break;
+ case NodeKind.New:
+ range = (node).typeName.range;
+ break;
+ default:
+ assert(false);
+ return null;
+ }
+ this.error(
+ DiagnosticCode.Type_argument_expected,
+ range.atEnd
+ );
+ }
+ return null;
}
- // otherwise resolve the non-generic call as usual
- return this.resolveFunction(prototype, null, new Map(), reportMode);
+ return resolvedTypeArguments;
}
/** Updates contextual types with a possibly encapsulated inferred type. */
@@ -846,7 +795,7 @@ export class Resolver extends DiagnosticEmitter {
if (typeArgumentNodes && typeArgumentNodes.length > 0) { // foo(bar: Array)
let classReference = type.classReference;
if (classReference) {
- let classPrototype = this.resolveTypeName(namedTypeNode.name, ctxElement);
+ let classPrototype = this.resolveTypeName(namedTypeNode.name, null, ctxElement);
if (!classPrototype || classPrototype.kind != ElementKind.ClassPrototype) return;
if (classReference.prototype == classPrototype) {
let typeArguments = classReference.typeArguments;
@@ -1306,7 +1255,7 @@ export class Resolver extends DiagnosticEmitter {
if (global.is(CommonFlags.Resolved)) return true;
let typeNode = global.typeNode;
let type = typeNode
- ? this.resolveType(typeNode, global.parent, null, reportMode)
+ ? this.resolveType(typeNode, null, global.parent, null, reportMode)
: this.resolveExpression(
assert(global.initializerNode),
global.file.startFunction.flow,
@@ -1363,7 +1312,18 @@ export class Resolver extends DiagnosticEmitter {
}
case ElementKind.Property: { // someInstance.prop
let propertyInstance = target;
- let getterInstance = assert(propertyInstance.getterInstance); // must have a getter
+ let getterInstance = propertyInstance.getterInstance;
+ if (!getterInstance) {
+ // In TS, getters without setters return `undefined`. Since AS doesn't have
+ // undefined, we instead diagnose it at compile time, but this isn't
+ // compatible with TS.
+ let setterInstance = assert(propertyInstance.setterInstance);
+ this.errorRelated(
+ DiagnosticCode.Property_0_only_has_a_setter_and_is_missing_a_getter,
+ targetNode.range, setterInstance.declaration.range, propertyInstance.name
+ );
+ return null;
+ }
let type = getterInstance.signature.returnType;
let classReference = type.getClassOrWrapper(this.program);
if (!classReference) {
@@ -1413,7 +1373,7 @@ export class Resolver extends DiagnosticEmitter {
let shadowType = target.shadowType;
if (shadowType) {
if (!shadowType.is(CommonFlags.Resolved)) {
- let resolvedType = this.resolveType(shadowType.typeNode, shadowType.parent, null, reportMode);
+ let resolvedType = this.resolveType(shadowType.typeNode, null, shadowType.parent, null, reportMode);
if (resolvedType) shadowType.setType(resolvedType);
}
let classReference = shadowType.type.classReference;
@@ -1440,8 +1400,10 @@ export class Resolver extends DiagnosticEmitter {
case ElementKind.InterfacePrototype:
case ElementKind.Class:
case ElementKind.Interface: {
+ let classLikeTarget = target;
+ let findBase = false;
do {
- let member = target.getMember(propertyName);
+ let member = classLikeTarget.getMember(propertyName);
if (member) {
if (member.kind == ElementKind.PropertyPrototype) {
let propertyInstance = this.resolveProperty(member, reportMode);
@@ -1458,34 +1420,32 @@ export class Resolver extends DiagnosticEmitter {
this.currentElementExpression = null;
return member; // instance FIELD, static GLOBAL, FUNCTION_PROTOTYPE, PROPERTY...
}
- // traverse inherited static members on the base prototype if target is a class prototype
- if (
- target.kind == ElementKind.ClassPrototype ||
- target.kind == ElementKind.InterfacePrototype
- ) {
- let classPrototype = target;
- let basePrototype = classPrototype.basePrototype;
- if (basePrototype) {
- target = basePrototype;
- } else {
+ findBase = false;
+ switch (classLikeTarget.kind) {
+ case ElementKind.ClassPrototype:
+ case ElementKind.InterfacePrototype: {
+ // traverse inherited static members on the base prototype if target is a class prototype
+ let classPrototype = classLikeTarget;
+ let basePrototype = classPrototype.basePrototype;
+ if (basePrototype) {
+ findBase = true;
+ classLikeTarget = basePrototype;
+ }
break;
}
- // traverse inherited instance members on the base class if target is a class instance
- } else if (
- target.kind == ElementKind.Class ||
- target.kind == ElementKind.Interface
- ) {
- let classInstance = target;
- let baseInstance = classInstance.base;
- if (baseInstance) {
- target = baseInstance;
- } else {
+ case ElementKind.Class:
+ case ElementKind.Interface: {
+ // traverse inherited instance members on the base class if target is a class instance
+ let classInstance = classLikeTarget;
+ let baseInstance = classInstance.base;
+ if (baseInstance) {
+ findBase = true;
+ classLikeTarget = baseInstance;
+ }
break;
}
- } else {
- break;
}
- } while (true);
+ } while (findBase);
break;
}
default: { // enums or other namespace-like elements
@@ -1697,6 +1657,7 @@ export class Resolver extends DiagnosticEmitter {
case AssertionKind.Prefix: {
let type = this.resolveType(
assert(node.toType), // must be set if not NONNULL
+ null,
ctxFlow.sourceFunction,
ctxFlow.contextualTypeArguments,
reportMode
@@ -1753,6 +1714,7 @@ export class Resolver extends DiagnosticEmitter {
case AssertionKind.Prefix: {
return this.resolveType(
assert(node.toType),
+ null,
ctxFlow.sourceFunction,
ctxFlow.contextualTypeArguments,
reportMode
@@ -2648,12 +2610,13 @@ export class Resolver extends DiagnosticEmitter {
/** How to proceed with eventual diagnostics. */
reportMode: ReportMode = ReportMode.Report
): Element | null {
- let element = this.resolveTypeName(node.typeName, ctxFlow.sourceFunction, reportMode);
+ let element = this.resolveTypeName(node.typeName, ctxFlow, ctxFlow.sourceFunction, reportMode);
if (!element) return null;
if (element.kind == ElementKind.ClassPrototype) {
return this.resolveClassInclTypeArguments(
element,
node.typeArguments,
+ ctxFlow,
ctxFlow.sourceFunction,
cloneMap(ctxFlow.contextualTypeArguments),
node,
@@ -2733,7 +2696,7 @@ export class Resolver extends DiagnosticEmitter {
const declaration = node.declaration;
const signature = declaration.signature;
const body = declaration.body;
- let functionType = this.resolveType(signature, ctxFlow.sourceFunction, ctxFlow.contextualTypeArguments, reportMode);
+ let functionType = this.resolveType(signature, null, ctxFlow.sourceFunction, ctxFlow.contextualTypeArguments, reportMode);
if (
functionType &&
declaration.arrowKind != ArrowKind.None &&
@@ -2832,6 +2795,7 @@ export class Resolver extends DiagnosticEmitter {
if (explicitThisType) {
thisType = this.resolveType(
explicitThisType,
+ null,
prototype.parent, // relative to function
ctxTypes,
reportMode
@@ -2848,10 +2812,13 @@ export class Resolver extends DiagnosticEmitter {
let numSignatureParameters = signatureParameters.length;
let parameterTypes = new Array(numSignatureParameters);
let requiredParameters = 0;
+ let hasRest = false;
for (let i = 0; i < numSignatureParameters; ++i) {
let parameterDeclaration = signatureParameters[i];
if (parameterDeclaration.parameterKind == ParameterKind.Default) {
requiredParameters = i + 1;
+ } else if (parameterDeclaration.parameterKind == ParameterKind.Rest) {
+ hasRest = true;
}
let typeNode = parameterDeclaration.type;
if (isTypeOmitted(typeNode)) {
@@ -2865,6 +2832,7 @@ export class Resolver extends DiagnosticEmitter {
}
let parameterType = this.resolveType(
typeNode,
+ null,
prototype.parent, // relative to function
ctxTypes,
reportMode
@@ -2901,6 +2869,7 @@ export class Resolver extends DiagnosticEmitter {
}
let type = this.resolveType(
typeNode,
+ null,
prototype.parent, // relative to function
ctxTypes,
reportMode
@@ -2909,7 +2878,7 @@ export class Resolver extends DiagnosticEmitter {
returnType = type;
}
- let signature = Signature.create(this.program, parameterTypes, returnType, thisType, requiredParameters);
+ let signature = Signature.create(this.program, parameterTypes, returnType, thisType, requiredParameters, hasRest);
let nameInclTypeParameters = prototype.name;
if (instanceKey.length) nameInclTypeParameters += `<${instanceKey}>`;
@@ -3015,6 +2984,7 @@ export class Resolver extends DiagnosticEmitter {
resolvedTypeArguments = this.resolveTypeArguments( // reports
assert(prototype.typeParameterNodes),
typeArgumentNodes,
+ null,
ctxElement,
ctxTypes, // update
reportNode,
@@ -3060,7 +3030,7 @@ export class Resolver extends DiagnosticEmitter {
assert(!unboundOverridePrototype.isBound);
let unboundOverrideParent = unboundOverridePrototype.parent;
let classInstances: Map | null;
- assert(unboundOverrideParent.kind == ElementKind.ClassPrototype);
+ assert(unboundOverrideParent.kind == ElementKind.ClassPrototype || unboundOverrideParent.kind == ElementKind.InterfacePrototype);
classInstances = (unboundOverrideParent).instances;
if (!classInstances) continue;
for (let _values = Map_values(classInstances), j = 0, l = _values.length; j < l; ++j) {
@@ -3163,6 +3133,7 @@ export class Resolver extends DiagnosticEmitter {
let base = this.resolveClassInclTypeArguments(
basePrototype,
extendsNode.typeArguments,
+ null,
prototype.parent, // relative to derived class
cloneMap(ctxTypes), // don't inherit
extendsNode,
@@ -3203,6 +3174,7 @@ export class Resolver extends DiagnosticEmitter {
let iface = this.resolveClassInclTypeArguments(
interfacePrototype,
implementsNode.typeArguments,
+ null,
prototype.parent,
cloneMap(ctxTypes),
implementsNode,
@@ -3384,7 +3356,6 @@ export class Resolver extends DiagnosticEmitter {
// Resolve instance members
let prototype = instance.prototype;
let instanceMemberPrototypes = prototype.instanceMembers;
- let properties = new Array();
if (instanceMemberPrototypes) {
// TODO: for (let member of instanceMemberPrototypes.values()) {
for (let _values = Map_values(instanceMemberPrototypes), i = 0, k = _values.length; i < k; ++i) {
@@ -3407,6 +3378,14 @@ export class Resolver extends DiagnosticEmitter {
if (boundInstance) {
let fieldType = boundInstance.type;
if (fieldType == Type.void) break; // failed to resolve earlier
+ if (fieldType.isExternalReference) {
+ this.error(
+ DiagnosticCode.Not_implemented_0,
+ assert(boundPrototype.typeNode).range,
+ "Reference typed fields"
+ );
+ break;
+ }
let needsLayout = true;
if (base) {
let existingMember = base.getMember(boundPrototype.name);
@@ -3456,26 +3435,6 @@ export class Resolver extends DiagnosticEmitter {
}
}
- // Check that property getters and setters match
- for (let i = 0, k = properties.length; i < k; ++i) {
- let property = properties[i];
- let propertyGetter = property.getterInstance;
- if (!propertyGetter) {
- this.error(
- DiagnosticCode.Property_0_only_has_a_setter_and_is_missing_a_getter,
- property.identifierNode.range, property.name
- );
- } else {
- let propertySetter = property.setterInstance;
- if (propertySetter && !propertyGetter.visibilityEquals(propertySetter)) {
- this.errorRelated(
- DiagnosticCode.Getter_and_setter_accessors_do_not_agree_in_visibility,
- propertyGetter.identifierNode.range, propertySetter.identifierNode.range
- );
- }
- }
- }
-
if (instance.kind != ElementKind.Interface) {
// Check that all required members are implemented
@@ -3612,6 +3571,8 @@ export class Resolver extends DiagnosticEmitter {
prototype: ClassPrototype,
/** Type arguments provided to be resolved. */
typeArgumentNodes: TypeNode[] | null,
+ /** Flow of {@link typeArgumentNodes} */
+ flow: Flow | null,
/** Contextual element. */
ctxElement: Element,
/** Contextual types, i.e. `T`. */
@@ -3625,14 +3586,34 @@ export class Resolver extends DiagnosticEmitter {
// Resolve type arguments if generic
if (prototype.is(CommonFlags.Generic)) {
- resolvedTypeArguments = this.resolveTypeArguments( // reports
- assert(prototype.typeParameterNodes), // must be present if generic
- typeArgumentNodes,
- ctxElement,
- ctxTypes, // update
- reportNode,
- reportMode
- );
+
+ // find the constructor prototype, which may be on a base class
+ let constructorPrototype: FunctionPrototype | null = null;
+ for (let p: ClassPrototype | null = prototype; p && !constructorPrototype; p = p.basePrototype) {
+ constructorPrototype = p.constructorPrototype;
+ }
+
+ // if no type arguments are provided, try to infer them from the constructor call
+ if (!typeArgumentNodes && constructorPrototype && flow && ctxTypes.size == 0) {
+ resolvedTypeArguments = this.inferGenericTypeArguments(
+ reportNode as NewExpression,
+ constructorPrototype,
+ prototype.typeParameterNodes,
+ flow,
+ );
+ } else {
+ // resolve them from the provided type argument nodes
+ resolvedTypeArguments = this.resolveTypeArguments( // reports
+ assert(prototype.typeParameterNodes), // must be present if generic
+ typeArgumentNodes,
+ flow,
+ ctxElement,
+ ctxTypes, // update
+ reportNode,
+ reportMode
+ );
+ }
+
if (!resolvedTypeArguments) return null;
// Otherwise make sure that no type arguments have been specified
@@ -3699,10 +3680,11 @@ export class Resolver extends DiagnosticEmitter {
}
}
}
+ instance.checkVisibility(this);
return instance;
}
- private ensureOneTypeArgument(
+ ensureOneTypeArgument(
/** The type to resolve. */
node: NamedTypeNode,
/** How to proceed with eventual diagnostics. */
diff --git a/src/tokenizer.ts b/src/tokenizer.ts
index a4bf9e9aa4..08a9e10dec 100644
--- a/src/tokenizer.ts
+++ b/src/tokenizer.ts
@@ -463,9 +463,11 @@ export class Tokenizer extends DiagnosticEmitter {
end: i32 = 0;
pos: i32 = 0;
+ // @ts-expect-error
token: Token = -1;
tokenPos: i32 = 0;
+ // @ts-expect-error
nextToken: Token = -1;
nextTokenPos: i32 = 0;
nextTokenOnNewLine: OnNewLine = OnNewLine.Unknown;
@@ -1055,6 +1057,7 @@ export class Tokenizer extends DiagnosticEmitter {
}
clearNextToken(): void {
+ // @ts-expect-error
this.nextToken = -1;
this.nextTokenPos = 0;
this.nextTokenOnNewLine = OnNewLine.Unknown;
diff --git a/src/tsconfig.json b/src/tsconfig.json
index 082bb02ec8..a6acaae80a 100644
--- a/src/tsconfig.json
+++ b/src/tsconfig.json
@@ -3,7 +3,6 @@
"compilerOptions": {
"target": "esnext",
"outDir": "../build",
- "types" : ["node"],
"allowJs": false,
"sourceMap": true,
"skipLibCheck": true,
diff --git a/src/types.ts b/src/types.ts
index cf97538bf6..6a07f6fbc8 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -10,7 +10,9 @@ import {
import {
Class,
Program,
- DecoratorFlags
+ DecoratorFlags,
+ OperatorKind,
+ Function
} from "./program";
import {
@@ -68,21 +70,21 @@ export const enum TypeKind {
// references (keep in same order as in Binaryen)
/** External reference. */
- Externref,
+ Extern,
/** Function reference. */
- Funcref,
+ Func,
/** Any reference. */
- Anyref,
+ Any,
/** Equatable reference. */
- Eqref,
+ Eq,
/** Struct reference. */
- Structref,
+ Struct,
/** Array reference. */
- Arrayref,
+ Array,
/** 31-bit integer reference. */
- I31ref,
+ I31,
/** String reference. */
- Stringref,
+ String,
/** WTF8 string view. */
StringviewWTF8,
/** WTF16 string view. */
@@ -278,6 +280,11 @@ export class Type {
return this.is(TypeFlags.External | TypeFlags.Reference);
}
+ /** Tests if this type represents a nullable external object. */
+ get isNullableExternalReference(): bool {
+ return this.is(TypeFlags.Nullable | TypeFlags.External | TypeFlags.Reference);
+ }
+
/** Gets the underlying class of this type, if any. */
getClass(): Class | null {
return this.isInternalReference
@@ -315,6 +322,14 @@ export class Type {
return null;
}
+ lookupOverload(kind: OperatorKind, program: Program): Function | null {
+ let classReference = this.getClassOrWrapper(program);
+ if (classReference) {
+ return classReference.lookupOverload(kind);
+ }
+ return null;
+ }
+
/** Gets the underlying function signature of this type, if any. */
getSignature(): Signature | null {
return this.isInternalReference
@@ -365,15 +380,15 @@ export class Type {
/** Gets the corresponding non-nullable type. */
get nonNullableType(): Type {
- if (this.isExternalReference) {
- return this; // TODO
- }
- return assert(this._nonNullableType); // set either in ctor or asNullable
+ // Every type has a corresponding non-nullable type
+ return assert(this._nonNullableType);
}
/** Gets the corresponding nullable type, if applicable. */
get nullableType(): Type | null {
- return this._nullableType; // set either in ctor or asNullable
+ return this.isReference
+ ? this.asNullable() // Every reference type has a corresponding nullable type
+ : null; // Other types do not have a nullable type
}
/** Computes the sign-extending shift in the target type. */
@@ -395,13 +410,13 @@ export class Type {
/** Composes the respective nullable type of this type. */
asNullable(): Type {
- assert(this.isInternalReference);
+ assert(this.isReference);
let nullableType = this._nullableType;
if (!nullableType) {
assert(!this.isNullableReference);
this._nullableType = nullableType = new Type(this.kind, this.flags | TypeFlags.Nullable, this.size);
- nullableType.classReference = this.classReference; // either a class reference
- nullableType.signatureReference = this.signatureReference; // or a function reference
+ nullableType.classReference = this.classReference;
+ nullableType.signatureReference = this.signatureReference;
nullableType._nonNullableType = this;
}
return nullableType;
@@ -457,7 +472,7 @@ export class Type {
} else if (this.isExternalReference) {
if (
this.kind == target.kind ||
- (target.kind == TypeKind.Anyref && this.kind != TypeKind.Externref)
+ (target.kind == TypeKind.Any && this.kind != TypeKind.Extern)
) {
return true;
}
@@ -583,6 +598,39 @@ export class Type {
return null;
}
+ /** Converts this type's kind to a string. */
+ kindToString(): string {
+ switch (this.kind) {
+ case TypeKind.Bool: return CommonNames.bool;
+ case TypeKind.I8: return CommonNames.i8;
+ case TypeKind.I16: return CommonNames.i16;
+ case TypeKind.I32: return CommonNames.i32;
+ case TypeKind.I64: return CommonNames.i64;
+ case TypeKind.Isize: return CommonNames.isize;
+ case TypeKind.U8: return CommonNames.u8;
+ case TypeKind.U16: return CommonNames.u16;
+ case TypeKind.U32: return CommonNames.u32;
+ case TypeKind.U64: return CommonNames.u64;
+ case TypeKind.Usize: return CommonNames.usize;
+ case TypeKind.F32: return CommonNames.f32;
+ case TypeKind.F64: return CommonNames.f64;
+ case TypeKind.V128: return CommonNames.v128;
+ case TypeKind.Func: return CommonNames.ref_func;
+ case TypeKind.Extern: return CommonNames.ref_extern;
+ case TypeKind.Any: return CommonNames.ref_any;
+ case TypeKind.Eq: return CommonNames.ref_eq;
+ case TypeKind.Struct: return CommonNames.ref_struct;
+ case TypeKind.Array: return CommonNames.ref_array;
+ case TypeKind.I31: return CommonNames.ref_i31;
+ case TypeKind.String: return CommonNames.ref_string;
+ case TypeKind.StringviewWTF8: return CommonNames.ref_stringview_wtf8;
+ case TypeKind.StringviewWTF16: return CommonNames.ref_stringview_wtf16;
+ case TypeKind.StringviewIter: return CommonNames.ref_stringview_iter;
+ default: assert(false);
+ case TypeKind.Void: return CommonNames.void_;
+ }
+ }
+
/** Converts this type to a string. */
toString(validWat: bool = false): string {
const nullablePostfix = validWat ? "|null" : " | null";
@@ -598,38 +646,17 @@ export class Type {
return this.isNullableReference
? `(${signatureReference.toString(validWat)})${nullablePostfix}`
: signatureReference.toString(validWat);
+ } else {
+ return this.isNullableReference
+ ? `${this.kindToString()}${nullablePostfix}`
+ : this.kindToString();
}
}
}
- switch (this.kind) {
- case TypeKind.Bool: return CommonNames.bool;
- case TypeKind.I8: return CommonNames.i8;
- case TypeKind.I16: return CommonNames.i16;
- case TypeKind.I32: return CommonNames.i32;
- case TypeKind.I64: return CommonNames.i64;
- case TypeKind.Isize: return CommonNames.isize;
- case TypeKind.U8: return CommonNames.u8;
- case TypeKind.U16: return CommonNames.u16;
- case TypeKind.U32: return CommonNames.u32;
- case TypeKind.U64: return CommonNames.u64;
- case TypeKind.Usize: return CommonNames.usize;
- case TypeKind.F32: return CommonNames.f32;
- case TypeKind.F64: return CommonNames.f64;
- case TypeKind.V128: return CommonNames.v128;
- case TypeKind.Funcref: return CommonNames.funcref;
- case TypeKind.Externref: return CommonNames.externref;
- case TypeKind.Anyref: return CommonNames.anyref;
- case TypeKind.Eqref: return CommonNames.eqref;
- case TypeKind.Structref: return CommonNames.structref;
- case TypeKind.Arrayref: return CommonNames.arrayref;
- case TypeKind.I31ref: return CommonNames.i31ref;
- case TypeKind.Stringref: return CommonNames.stringref;
- case TypeKind.StringviewWTF8: return CommonNames.stringview_wtf8;
- case TypeKind.StringviewWTF16: return CommonNames.stringview_wtf16;
- case TypeKind.StringviewIter: return CommonNames.stringview_iter;
- default: assert(false);
- case TypeKind.Void: return CommonNames.void_;
+ if (this == Type.auto) {
+ return "auto";
}
+ return this.kindToString();
}
// Binaryen specific
@@ -651,39 +678,30 @@ export class Type {
case TypeKind.F32: return TypeRef.F32;
case TypeKind.F64: return TypeRef.F64;
case TypeKind.V128: return TypeRef.V128;
- case TypeKind.Funcref: {
+ case TypeKind.Func: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Func, this.is(TypeFlags.Nullable));
}
- case TypeKind.Externref: {
+ case TypeKind.Extern: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Extern, this.is(TypeFlags.Nullable));
}
- case TypeKind.Anyref: {
+ case TypeKind.Any: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Any, this.is(TypeFlags.Nullable));
}
- case TypeKind.Eqref: {
+ case TypeKind.Eq: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Eq, this.is(TypeFlags.Nullable));
}
- case TypeKind.Structref: {
+ case TypeKind.Struct: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Struct, this.is(TypeFlags.Nullable));
}
- case TypeKind.Arrayref: {
+ case TypeKind.Array: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.Array, this.is(TypeFlags.Nullable));
}
- case TypeKind.I31ref: {
+ case TypeKind.I31: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.I31, this.is(TypeFlags.Nullable));
}
- case TypeKind.Stringref: {
+ case TypeKind.String: {
return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.String, this.is(TypeFlags.Nullable));
}
- case TypeKind.StringviewWTF8: {
- return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.StringviewWTF8, this.is(TypeFlags.Nullable));
- }
- case TypeKind.StringviewWTF16: {
- return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.StringviewWTF16, this.is(TypeFlags.Nullable));
- }
- case TypeKind.StringviewIter: {
- return binaryen._BinaryenTypeFromHeapType(HeapTypeRef.StringviewIter, this.is(TypeFlags.Nullable));
- }
case TypeKind.Void: return TypeRef.None;
}
// TODO: not used yet
@@ -818,80 +836,69 @@ export class Type {
TypeFlags.Value, 128
);
- /** Function reference. */
- static readonly funcref: Type = new Type(TypeKind.Funcref,
+ /** Non-nullable function reference (`ref func`). */
+ static readonly func: Type = new Type(TypeKind.Func,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** External reference. */
- static readonly externref: Type = new Type(TypeKind.Externref,
+ /** Non-nullable external reference (`ref extern`). */
+ static readonly extern: Type = new Type(TypeKind.Extern,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** Any reference. */
- static readonly anyref: Type = new Type(TypeKind.Anyref,
+ /** Non-nullable any reference (`ref any`). */
+ static readonly any: Type = new Type(TypeKind.Any,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** Equatable reference. */
- static readonly eqref: Type = new Type(TypeKind.Eqref,
+ /** Non-nullable equatable reference (`ref eq`). */
+ static readonly eq: Type = new Type(TypeKind.Eq,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** Struct reference. */
- static readonly structref: Type = new Type(TypeKind.Structref,
+ /** Non-nullable struct reference (`ref struct`). */
+ static readonly struct: Type = new Type(TypeKind.Struct,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** Array reference. */
- static readonly arrayref: Type = new Type(TypeKind.Arrayref,
+ /** Non-nullable array reference (`ref array`). */
+ static readonly array: Type = new Type(TypeKind.Array,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** 31-bit integer reference. */
- static readonly i31ref: Type = new Type(TypeKind.I31ref,
+ /** Non-nullable 31-bit integer reference (`ref i31`). */
+ static readonly i31: Type = new Type(TypeKind.I31,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** String reference. */
- static readonly stringref: Type = new Type(TypeKind.Stringref,
+ /** Non-nullable string reference (`ref string`). */
+ static readonly string: Type = new Type(TypeKind.String,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** WTF8 string view. */
+ /** Non-nullable WTF8 string view reference (`ref stringview_wtf8`). */
static readonly stringview_wtf8: Type = new Type(TypeKind.StringviewWTF8,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** WTF16 string view. */
+ /** Non-nullable WTF16 string view reference (`ref stringview_wtf16`). */
static readonly stringview_wtf16: Type = new Type(TypeKind.StringviewWTF16,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
- /** String iterator. */
+ /** Non-nullable string iterator reference (`ref stringview_iter`). */
static readonly stringview_iter: Type = new Type(TypeKind.StringviewIter,
TypeFlags.External |
- TypeFlags.Nullable |
TypeFlags.Reference, 0
);
@@ -1048,22 +1055,14 @@ export class Signature {
isAssignableTo(target: Signature, checkCompatibleOverride: bool = false): bool {
let thisThisType = this.thisType;
let targetThisType = target.thisType;
- if (checkCompatibleOverride) {
- // check kind of `this` type
- if (thisThisType) {
- if (!targetThisType || !thisThisType.canExtendOrImplement(targetThisType)) {
- return false;
- }
- } else if (targetThisType) {
- return false;
- }
- } else {
- // check `this` type (invariant)
- if (thisThisType) {
- if (targetThisType != targetThisType) return false;
- } else if (targetThisType) {
- return false;
- }
+
+ if (thisThisType && targetThisType) {
+ const compatibleThisType = checkCompatibleOverride
+ ? thisThisType.canExtendOrImplement(targetThisType)
+ : targetThisType.isAssignableTo(thisThisType);
+ if (!compatibleThisType) return false;
+ } else if (thisThisType || targetThisType) {
+ return false;
}
// check rest parameter
diff --git a/src/util/math.ts b/src/util/math.ts
index 25759f35d1..56655e921c 100644
--- a/src/util/math.ts
+++ b/src/util/math.ts
@@ -11,16 +11,10 @@ export function isPowerOf2(x: i32): bool {
export function accuratePow64(x: f64, y: f64): f64 {
if (!ASC_TARGET) { // ASC_TARGET == JS
// Engines like V8, WebKit and SpiderMonkey uses powi fast path if exponent is integer
- // This speculative optimization leads to loose precisions like 10 ** 208 != 1e208
- // or/and 10 ** -5 != 1e-5 anymore. For avoid this behaviour we are forcing exponent
- // to fractional form and compensate this afterwards.
- if (isFinite(y) && Math.abs(y) >= 2 && Math.trunc(y) == y) {
- if (y < 0) {
- return Math.pow(x, y + 0.5) / Math.pow(x, 0.5);
- } else {
- return Math.pow(x, y - 0.5) * Math.pow(x, 0.5);
- }
- }
+ // This speculative optimization leads to loose precisions like 10 ** -5 != 1e-5 anymore
+ // and introduces inconsistencies between different engines and versions
+ // For avoid this behavior we using bootstrap f64_pow function.
+ return f64_pow(x, y);
}
return Math.pow(x, y);
}
diff --git a/std/assembly.json b/std/assembly.json
index 10a3e067dc..189ed19dc7 100644
--- a/std/assembly.json
+++ b/std/assembly.json
@@ -7,7 +7,6 @@
"allowJs": false,
"typeRoots": [ "types" ],
"types": [ "assembly" ],
- "baseUrl": ".",
"paths": {
"*": [
"./assembly/*"
diff --git a/std/assembly/builtins.ts b/std/assembly/builtins.ts
index 05238edc03..1c23551993 100644
--- a/std/assembly/builtins.ts
+++ b/std/assembly/builtins.ts
@@ -66,10 +66,6 @@ export declare function isVoid(): bool;
@builtin
export declare function lengthof(func?: T): i32;
-// @ts-ignore
-@builtin
-export declare function bswap(value: T): T;
-
// @ts-ignore: decorator
@builtin
export declare function clz(value: T): T;
@@ -206,6 +202,12 @@ export declare function assert(isTrueish: T, message?: string): T;
@unsafe @builtin
export declare function unchecked(expr: T): T;
+export namespace inline {
+ // @ts-ignore: decorator
+ @unsafe @builtin
+ export declare function always(expr: T): T;
+}
+
// @ts-ignore: decorator
@unsafe @builtin
export declare function call_indirect(index: u32, ...args: auto[]): T;
@@ -1273,7 +1275,7 @@ export namespace v128 {
// @ts-ignore: decorator
@unsafe @builtin
- export declare function store_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;
+ export declare function store_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): void;
// @ts-ignore: decorator
@builtin
@@ -1345,19 +1347,19 @@ export namespace v128 {
// @ts-ignore: decorator
@unsafe @builtin
- export declare function store8_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;
+ export declare function store8_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): void;
// @ts-ignore: decorator
@unsafe @builtin
- export declare function store16_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;
+ export declare function store16_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): void;
// @ts-ignore: decorator
@unsafe @builtin
- export declare function store32_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;
+ export declare function store32_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): void;
// @ts-ignore: decorator
@unsafe @builtin
- export declare function store64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): v128;
+ export declare function store64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: u32, immAlign?: u32): void;
// @ts-ignore: decorator
@unsafe @builtin
@@ -1562,6 +1564,50 @@ export namespace v128 {
// @ts-ignore: decorator
@builtin
export declare function extmul_high(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_swizzle(a: v128, s: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_trunc(a: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_trunc_zero(a: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_madd(a: v128, b: v128, c: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_nmadd(a: v128, b: v128, c: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_min(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_max(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_q15mulr(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_dot(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_dot_add(a: v128, b: v128, c: v128): v128;
}
// @ts-ignore: decorator
@@ -1724,6 +1770,14 @@ export namespace i8x16 {
// @ts-ignore: decorator
@builtin
export declare function swizzle(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_swizzle(a: v128, s: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
}
// @ts-ignore: decorator
@@ -1925,7 +1979,15 @@ export namespace i16x8 {
// @ts-ignore: decorator
@builtin
- export declare function swizzle(a: v128, b: v128): v128;
+ export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_q15mulr_s(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_dot_i8x16_i7x16_s(a: v128, b: v128, c: v128): v128;
}
// @ts-ignore: decorator
@@ -2108,7 +2170,27 @@ export namespace i32x4 {
// @ts-ignore: decorator
@builtin
- export declare function swizzle(a: v128, b: v128): v128;
+ export declare function relaxed_trunc_f32x4_s(a: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_trunc_f32x4_u(a: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_trunc_f64x2_s_zero(a: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_trunc_f64x2_u_zero(a: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_dot_i8x16_i7x16_add_s(a: v128, b: v128, c: v128): v128;
}
// @ts-ignore: decorator
@@ -2231,7 +2313,7 @@ export namespace i64x2 {
// @ts-ignore: decorator
@builtin
- export declare function swizzle(a: v128, b: v128): v128;
+ export declare function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
}
// @ts-ignore: decorator
@@ -2354,7 +2436,19 @@ export namespace f32x4 {
// @ts-ignore: decorator
@builtin
- export declare function swizzle(a: v128, b: v128): v128;
+ export declare function relaxed_madd(a: v128, b: v128, c: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_nmadd(a: v128, b: v128, c: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_min(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_max(a: v128, b: v128): v128;
}
// @ts-ignore: decorator
@@ -2477,7 +2571,19 @@ export namespace f64x2 {
// @ts-ignore: decorator
@builtin
- export declare function swizzle(a: v128, b: v128): v128;
+ export declare function relaxed_madd(a: v128, b: v128, c: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_nmadd(a: v128, b: v128, c: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_min(a: v128, b: v128): v128;
+
+ // @ts-ignore: decorator
+ @builtin
+ export declare function relaxed_max(a: v128, b: v128): v128;
}
@final
diff --git a/std/assembly/date.ts b/std/assembly/date.ts
index 5d77fdcbde..2f847e1786 100644
--- a/std/assembly/date.ts
+++ b/std/assembly/date.ts
@@ -52,7 +52,8 @@ export class Date {
hour: i32 = 0,
min: i32 = 0,
sec: i32 = 0,
- ms: i32 = 0;
+ ms: i32 = 0,
+ offsetMs: i32 = 0;
let dateString = dateTimeString;
let posT = dateTimeString.indexOf("T");
@@ -61,37 +62,67 @@ export class Date {
let timeString: string;
dateString = dateTimeString.substring(0, posT);
timeString = dateTimeString.substring(posT + 1);
- // parse the HH-MM-SS component
+
+ // might end with an offset ("Z", "+05:30", "-08:00", etc.)
+ for (let i = timeString.length - 1; i >= 0; i--) {
+ let c = timeString.charCodeAt(i);
+ if (c == 90) { // Z
+ timeString = timeString.substring(0, i);
+ break;
+ } else if (c == 43 || c == 45) { // + or -
+ if (i == timeString.length - 1) {
+ throw new RangeError(E_INVALIDDATE);
+ }
+
+ let posColon = timeString.indexOf(":", i + 1);
+ if (~posColon) {
+ let offsetHours = i32.parse(timeString.substring(i + 1, posColon));
+ let offsetMinutes = i32.parse(timeString.substring(posColon + 1));
+ offsetMs = (offsetHours * 60 + offsetMinutes) * MILLIS_PER_MINUTE;
+ } else {
+ let offsetHours = i32.parse(timeString.substring(i + 1));
+ offsetMs = offsetHours * MILLIS_PER_HOUR;
+ }
+
+ if (c == 45) offsetMs = -offsetMs; // negative offset
+ timeString = timeString.substring(0, i);
+ break;
+ }
+ }
+
+ // parse the HH:MM:SS component
let timeParts = timeString.split(":");
let len = timeParts.length;
if (len <= 1) throw new RangeError(E_INVALIDDATE);
- hour = I32.parseInt(timeParts[0]);
- min = I32.parseInt(timeParts[1]);
+ hour = i32.parse(timeParts[0]);
+ min = i32.parse(timeParts[1]);
if (len >= 3) {
- let secAndMs = timeParts[2];
- let posDot = secAndMs.indexOf(".");
+ let secAndFrac = timeParts[2];
+ let posDot = secAndFrac.indexOf(".");
if (~posDot) {
- // includes milliseconds
- sec = I32.parseInt(secAndMs.substring(0, posDot));
- ms = I32.parseInt(secAndMs.substring(posDot + 1));
+ // includes fractional seconds (truncate to milliseconds)
+ sec = i32.parse(secAndFrac.substring(0, posDot));
+ ms = i32.parse(secAndFrac.substr(posDot + 1, 3).padEnd(3, "0"));
} else {
- sec = I32.parseInt(secAndMs);
+ sec = i32.parse(secAndFrac);
}
}
}
+
// parse the YYYY-MM-DD component
let parts = dateString.split("-");
- let year = I32.parseInt(parts[0]);
+ let year = i32.parse(parts[0]);
let month = 1, day = 1;
let len = parts.length;
if (len >= 2) {
- month = I32.parseInt(parts[1]);
+ month = i32.parse(parts[1]);
if (len >= 3) {
- day = I32.parseInt(parts[2]);
+ day = i32.parse(parts[2]);
}
}
- return new Date(epochMillis(year, month, day, hour, min, sec, ms));
+
+ return new Date(epochMillis(year, month, day, hour, min, sec, ms) - offsetMs);
}
constructor(private epochMillis: i64) {
diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts
index ecf389936e..a604397320 100644
--- a/std/assembly/index.d.ts
+++ b/std/assembly/index.d.ts
@@ -35,28 +35,50 @@ declare type f32 = number;
declare type f64 = number;
/** A 128-bit vector. */
declare type v128 = object;
-/** Function reference. */
-declare type funcref = object | null;
-/** External reference. */
-declare type externref = object | null;
-/** Any reference. */
-declare type anyref = object | null;
-/** Equatable reference. */
-declare type eqref = object | null;
-/** Struct reference. */
-declare type structref = object | null;
-/** Array reference. */
-declare type arrayref = object | null;
-/** 31-bit integer reference. */
-declare type i31ref = object | null;
-/** String reference. */
-declare type stringref = object | null;
-/** WTF-8 string view. */
-declare type stringview_wtf8 = object | null;
-/** WTF-16 string view. */
-declare type stringview_wtf16 = object | null;
-/** String iterator. */
-declare type stringview_iter = object | null;
+/** Non-nullable function reference. */
+declare type ref_func = object;
+/** Canonical nullable function reference. */
+declare type funcref = ref_func | null;
+/** Non-nullable external reference. */
+declare type ref_extern = object;
+/** Canonical nullable external reference. */
+declare type externref = ref_extern | null;
+/** Non-nullable any reference. */
+declare type ref_any = object;
+/** Canonical nullable any reference. */
+declare type anyref = ref_any | null;
+/** Non-nullable equatable reference. */
+declare type ref_eq = object;
+/** Canonical nullable equatable reference. */
+declare type eqref = ref_eq | null;
+/** Non-nullable struct reference. */
+declare type ref_struct = object;
+/** Canonical nullable struct reference. */
+declare type structref = ref_struct | null;
+/** Non-nullable array reference. */
+declare type ref_array = object;
+/** Canonical nullable array reference. */
+declare type arrayref = ref_array | null;
+/** Non-nullable 31-bit integer reference. */
+declare type ref_i31 = object;
+/** Canonical nullable 31-bit integer reference. */
+declare type i31ref = ref_i31 | null;
+/** Non-nullable string reference. */
+declare type ref_string = object;
+/** Canonical nullable string reference. */
+declare type stringref = ref_string | null;
+/** Non-nullable WTF-8 string view. */
+declare type ref_stringview_wtf8 = object;
+/** Canonical nullable WTF-8 string view. */
+declare type stringview_wtf8 = ref_stringview_wtf8 | null;
+/** Non-nullable WTF-16 string view. */
+declare type ref_stringview_wtf16 = object;
+/** Canonical nullable WTF-16 string view. */
+declare type stringview_wtf16 = ref_stringview_wtf16 | null;
+/** Non-nullable string iterator. */
+declare type ref_stringview_iter = object;
+/** Canonical nullable string iterator. */
+declare type stringview_iter = ref_stringview_iter | null;
// Compiler hints
@@ -769,9 +791,9 @@ declare function v128(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i:
declare namespace v128 {
/** Creates a vector with identical lanes. */
export function splat(x: T): v128;
- /** Extracts one lane as a scalar. */
+ /** Extracts one lane as a scalar. idx argument needs to be compile time constant. */
export function extract_lane(x: v128, idx: u8): T;
- /** Replaces one lane. */
+ /** Replaces one lane. idx argument needs to be compile time constant.*/
export function replace_lane(x: v128, idx: u8, value: T): v128;
/** Selects lanes from either vector according to the specified lane indexes. */
export function shuffle(a: v128, b: v128, ...lanes: u8[]): v128;
@@ -786,7 +808,7 @@ declare namespace v128 {
/** Loads a single lane from memory into the specified lane of the given vector. Other lanes are bypassed as is. */
export function load_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;
/** Stores the single lane at the specified index of the given vector to memory. */
- export function store_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;
+ export function store_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): void;
/** Creates a vector with eight 16-bit integer lanes by loading and sign extending eight 8-bit integers. */
export function load8x8_s(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
/** Creates a vector with eight 16-bit integer lanes by loading and zero extending eight 8-bit integers. */
@@ -822,13 +844,13 @@ declare namespace v128 {
/** Loads a single 64-bit lane from memory into the specified lane of the given vector. Other lanes are bypassed as is. */
export function load64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;
/** Stores the 8-bit lane at the specified lane of the given vector to memory. */
- export function store8_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;
+ export function store8_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): void;
/** Stores the 16-bit lane at the specified lane of the given vector to memory. */
- export function store16_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;
+ export function store16_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): void;
/** Stores the 32-bit lane at the specified lane of the given vector to memory. */
- export function store32_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;
+ export function store32_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): void;
/** Stores the 64-bit lane at the specified lane of the given vector to memory. */
- export function store64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): v128;
+ export function store64_lane(ptr: usize, vec: v128, idx: u8, immOffset?: usize, immAlign?: usize): void;
/** Stores a vector to memory. */
export function store(ptr: usize, value: v128, immOffset?: usize, immAlign?: usize): void;
/** Adds each lane. */
@@ -859,7 +881,7 @@ declare namespace v128 {
export function andnot(a: v128, b: v128): v128;
/** Performs the bitwise NOT operation on a vector. */
export function not(a: v128): v128;
- /** Selects bits of either vector according to the specified mask. */
+ /** Selects bits of either vector according to the specified mask. Selects from `v1` if the bit in `mask` is `1`, otherwise from `v2`. */
export function bitselect(v1: v128, v2: v128, mask: v128): v128;
/** Reduces a vector to a scalar indicating whether any lane is considered `true`. */
export function any_true(a: v128): bool;
@@ -925,23 +947,115 @@ declare namespace v128 {
export function demote_zero(a: v128): v128;
/** Promotes the lower float lanes to higher precision. */
export function promote_low(a: v128): v128;
- /** Performs the line-wise saturating rounding multiplication in Q15 format. */
+ /** Performs the line-wise saturating rounding multiplication in Q15 format (`(a[i] * b[i] + (1 << (Q - 1))) >> Q` where `Q=15`). */
export function q15mulr_sat(a: v128, b: v128): v128;
/** Performs the lane-wise integer extended multiplication of the lower lanes producing a twice wider result than the inputs. */
export function extmul_low(a: v128, b: v128): v128;
/** Performs the lane-wise integer extended multiplication of the higher lanes producing a twice wider result than the inputs. */
export function extmul_high(a: v128, b: v128): v128;
+ /**
+ * Selects 8-bit lanes from `a` using indices in `s`. Indices in the range [0-15] select the i-th element of `a`.
+ *
+ * Unlike {@link v128.swizzle}, the result of an out of bounds index is implementation-defined, depending on hardware
+ * capabilities: Either `0` or `a[s[i]%16]`.
+ */
+ export function relaxed_swizzle(a: v128, s: v128): v128;
+ /**
+ * Truncates each lane of a vector from 32-bit floating point to a 32-bit signed or unsigned integer as indicated by
+ * `T`.
+ *
+ * Unlike {@link v128.trunc_sat}, the result of lanes out of bounds of the target type is implementation defined,
+ * depending on hardware capabilities:
+ * - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
+ * - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
+ * saturatated result or maximum integer value.
+ */
+ export function relaxed_trunc(a: v128): v128;
+ /**
+ * Truncates each lane of a vector from 64-bit floating point to a 32-bit signed or unsigned integer as indicated by
+ * `T`. Unused higher integer lanes of the result are initialized to zero.
+ *
+ * Unlike {@link v128.trunc_sat_zero}, the result of lanes out of bounds of the target type is implementation defined,
+ * depending on hardware capabilities:
+ * - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
+ * - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
+ * saturatated result or maximum integer value.
+ */
+ export function relaxed_trunc_zero(a: v128): v128;
+ /**
+ * Performs the fused multiply-add operation (`a * b + c`) on 32- or 64-bit floating point lanes as indicated by
+ * `T`.
+ *
+ * The result is implementation defined, depending on hardware capabilities:
+ * - Either `a * b` is rounded once and the final result rounded again, or
+ * - The expression is evaluated with higher precision and only rounded once
+ */
+ export function relaxed_madd(a: v128, b: v128, c: v128): v128;
+ /**
+ * Performs the fused negative multiply-add operation (`-(a * b) + c`) on 32- or 64-bit floating point lanes as
+ * indicated by `T`.
+ *
+ * The result is implementation defined, depending on hardware capabilities:
+ * - Either `a * b` is rounded once and the final result rounded again, or
+ * - The expression is evaluated with higher precision and only rounded once
+ */
+ export function relaxed_nmadd(a: v128, b: v128, c: v128): v128;
+ /**
+ * Selects 8-, 16-, 32- or 64-bit integer lanes as indicated by `T` from `a` or `b` based on masks in `m`.
+ *
+ * Behaves like {@link v128.bitselect} if masks in `m` do have all bits either set (result is `a[i]`) or unset (result
+ * is `b[i]`). Otherwise the result is implementation-defined, depending on hardware capabilities: If the most
+ * significant bit of `m` is set, the result is either `bitselect(a[i], b[i], mask)` or `a[i]`, otherwise the result
+ * is `b[i]`.
+ */
+ export function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
+ /**
+ * Computes the minimum of each 32- or 64-bit floating point lane as indicated by `T`.
+ *
+ * Unlike {@link v128.min}, the result is implementation-defined if either value is `NaN` or both are `-0.0` and
+ * `+0.0`, depending on hardware capabilities: Either `a[i]` or `b[i]`.
+ */
+ export function relaxed_min(a: v128, b: v128): v128;
+ /**
+ * Computes the maximum of each 32- or 64-bit floating point lane as indicated by `T`.
+ *
+ * Unlike {@link v128.max}, the result is implementation-defined if either value is `NaN` or both are `-0.0` and
+ * `+0.0`, depending on hardware capabilities: Either `a[i]` or `b[i]`.
+ */
+ export function relaxed_max(a: v128, b: v128): v128;
+ /**
+ * Performs the lane-wise rounding multiplication in Q15 format (`(a[i] * b[i] + (1 << (Q - 1))) >> Q` where `Q=15`).
+ *
+ * Unlike {@link v128.q15mulr_sat}, the result is implementation-defined if both inputs are the minimum signed value:
+ * Either the minimum or maximum signed value.
+ */
+ export function relaxed_q15mulr(a: v128, b: v128): v128;
+ /**
+ * Computes the dot product of two 8-bit integer lanes each, yielding lanes one size wider than the input.
+ *
+ * Unlike {@link v128.dot}, if the most significant bit of `b[i]` is set, whether `b[i]` is interpreted as signed or
+ * unsigned is implementation-defined.
+ */
+ export function relaxed_dot(a: v128, b: v128): v128;
+ /**
+ * Computes the dot product of two 8-bit integer lanes each, yielding lanes two sizes wider than the input with the
+ * lanes of `c` accumulated into the result.
+ *
+ * Unlike {@link v128.dot}, if the most significant bit of `b[i]` is set, whether `b[i]` is interpreted as signed or
+ * unsigned by the intermediate multiplication is implementation-defined.
+ */
+ export function relaxed_dot_add(a: v128, b: v128, c: v128): v128;
}
/** Initializes a 128-bit vector from sixteen 8-bit integer values. Arguments must be compile-time constants. */
declare function i8x16(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: i8, j: i8, k: i8, l: i8, m: i8, n: i8, o: i8, p: i8): v128;
declare namespace i8x16 {
/** Creates a vector with sixteen identical 8-bit integer lanes. */
export function splat(x: i8): v128;
- /** Extracts one 8-bit integer lane as a signed scalar. */
+ /** Extracts one 8-bit integer lane as a signed scalar. idx argument needs to be compile time constant. */
export function extract_lane_s(x: v128, idx: u8): i8;
- /** Extracts one 8-bit integer lane as an unsigned scalar. */
+ /** Extracts one 8-bit integer lane as an unsigned scalar. idx argument needs to be compile time constant. */
export function extract_lane_u(x: v128, idx: u8): u8;
- /** Replaces one 8-bit integer lane. */
+ /** Replaces one 8-bit integer lane. idx argument needs to be compile time constant. */
export function replace_lane(x: v128, idx: u8, value: i8): v128;
/** Adds each 8-bit integer lane. */
export function add(a: v128, b: v128): v128;
@@ -1009,17 +1123,34 @@ declare namespace i8x16 {
export function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8, l8: u8, l9: u8, l10: u8, l11: u8, l12: u8, l13: u8, l14: u8, l15: u8): v128;
/** Selects 8-bit lanes from the first vector according to the indexes [0-15] specified by the 8-bit lanes of the second vector. */
export function swizzle(a: v128, s: v128): v128;
+ /**
+ * Selects 8-bit integer lanes from `a` using indices in `s`. Indices in the range [0-15] select the i-th element of
+ * `a`.
+ *
+ * Unlike {@link i8x16.swizzle}, the result of an out of bounds index is implementation-defined, depending on hardware
+ * capabilities: Either `0` or `a[s[i]%16]`.
+ */
+ export function relaxed_swizzle(a: v128, s: v128): v128;
+ /**
+ * Selects 8-bit integer lanes from `a` or `b` based on masks in `m`.
+ *
+ * Behaves like {@link v128.bitselect} if masks in `m` do have all bits either set (result is `a[i]`) or unset (result
+ * is `b[i]`). Otherwise the result is implementation-defined, depending on hardware capabilities: If the most
+ * significant bit of `m` is set, the result is either `bitselect(a[i], b[i], mask)` or `a[i]`, otherwise the result
+ * is `b[i]`.
+ */
+ export function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
}
/** Initializes a 128-bit vector from eight 16-bit integer values. Arguments must be compile-time constants. */
declare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h: i16): v128;
declare namespace i16x8 {
/** Creates a vector with eight identical 16-bit integer lanes. */
export function splat(x: i16): v128;
- /** Extracts one 16-bit integer lane as a signed scalar. */
+ /** Extracts one 16-bit integer lane as a signed scalar. idx argument needs to be compile time constant. */
export function extract_lane_s(x: v128, idx: u8): i16;
- /** Extracts one 16-bit integer lane as an unsigned scalar. */
+ /** Extracts one 16-bit integer lane as an unsigned scalar. idx argument needs to be compile time constant. */
export function extract_lane_u(x: v128, idx: u8): u16;
- /** Replaces one 16-bit integer lane. */
+ /** Replaces one 16-bit integer lane. idx argument needs to be compile time constant. */
export function replace_lane(x: v128, idx: u8, value: i16): v128;
/** Adds each 16-bit integer lane. */
export function add(a: v128, b: v128): v128;
@@ -1107,17 +1238,38 @@ declare namespace i16x8 {
export function extmul_high_i8x16_u(a: v128, b: v128): v128;
/** Selects 16-bit lanes from either vector according to the specified [0-7] respectively [8-15] lane indexes. */
export function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8, l4: u8, l5: u8, l6: u8, l7: u8): v128;
- /** Selects 8-bit lanes from the first vector according to the indexes [0-15] specified by the 8-bit lanes of the second vector. */
- export function swizzle(a: v128, s: v128): v128;
+ /**
+ * Selects 16-bit integer lanes from `a` or `b` based on masks in `m`.
+ *
+ * Behaves like {@link v128.bitselect} if masks in `m` do have all bits either set (result is `a[i]`) or unset (result
+ * is `b[i]`). Otherwise the result is implementation-defined, depending on hardware capabilities: If the most
+ * significant bit of `m` is set, the result is either `bitselect(a[i], b[i], mask)` or `a[i]`, otherwise the result
+ * is `b[i]`.
+ */
+ export function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
+ /**
+ * Performs the line-wise rounding multiplication in Q15 format (`(a[i] * b[i] + (1 << (Q - 1))) >> Q` where `Q=15`).
+ *
+ * Some results are implementation-defined: If both inputs are `i16.MIN_VALUE`, the value of the respective
+ * resulting lane may be either `i16.MIN_VALUE` or `i16.MAX_VALUE`.
+ */
+ export function relaxed_q15mulr_s(a: v128, b: v128): v128;
+ /**
+ * Computes the dot product of two 8-bit integer lanes each, yielding lanes one size wider than the input.
+ *
+ * Some results are implementation-defined: If the most significant bit of `b[i]` is set, the intermediate
+ * multiplication may interpret `b[i]` as either signed or unsigned.
+ */
+ export function relaxed_dot_i8x16_i7x16_s(a: v128, b: v128): v128;
}
/** Initializes a 128-bit vector from four 32-bit integer values. Arguments must be compile-time constants. */
declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;
declare namespace i32x4 {
/** Creates a vector with four identical 32-bit integer lanes. */
export function splat(x: i32): v128;
- /** Extracts one 32-bit integer lane as a scalar. */
+ /** Extracts one 32-bit integer lane as a scalar. idx argument needs to be compile time constant. */
export function extract_lane(x: v128, idx: u8): i32;
- /** Replaces one 32-bit integer lane. */
+ /** Replaces one 32-bit integer lane. idx argument needs to be compile time constant. */
export function replace_lane(x: v128, idx: u8, value: i32): v128;
/** Adds each 32-bit integer lane. */
export function add(a: v128, b: v128): v128;
@@ -1199,17 +1351,74 @@ declare namespace i32x4 {
export function extmul_high_i16x8_u(a: v128, b: v128): v128;
/** Selects 32-bit lanes from either vector according to the specified [0-3] respectively [4-7] lane indexes. */
export function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8): v128;
- /** Selects 8-bit lanes from the first vector according to the indexes [0-15] specified by the 8-bit lanes of the second vector. */
- export function swizzle(a: v128, s: v128): v128;
+ /**
+ * Truncates each lane of a vector from 32-bit floating point to a signed 32-bit integer.
+ *
+ * Unlike {@link i32x4.trunc_sat_f32x4_s}, the result of lanes out of bounds of the target type is implementation
+ * defined, depending on hardware capabilities:
+ * - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
+ * - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
+ * saturatated result or maximum integer value.
+ */
+ export function relaxed_trunc_f32x4_s(a: v128): v128;
+ /**
+ * Truncates each lane of a vector from 32-bit floating point to an unsigned 32-bit integer.
+ *
+ * Unlike {@link i32x4.trunc_sat_f32x4_u}, the result of lanes out of bounds of the target type is implementation
+ * defined, depending on hardware capabilities:
+ * - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
+ * - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
+ * saturatated result or maximum integer value.
+ */
+ export function relaxed_trunc_f32x4_u(a: v128): v128;
+ /**
+ * Truncates each lane of a vector from 64-bit floating point to a signed 32-bit integer. The two higher
+ * integer lanes of the result are initialized to zero.
+ *
+ * Unlike {@link i32x4.trunc_sat_f64x2_s_zero}, the result of lanes out of bounds of the target type is implementation
+ * defined, depending on hardware capabilities:
+ * - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
+ * - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
+ * saturatated result or maximum integer value.
+ */
+ export function relaxed_trunc_f64x2_s_zero(a: v128): v128;
+ /**
+ * Truncates each lane of a vector from 64-bit floating point to an unsigned 32-bit integer. The two higher
+ * integer lanes of the result are initialized to zero.
+ *
+ * Unlike {@link i32x4.trunc_sat_f64x2_u_zero}, the result of lanes out of bounds of the target type is implementation
+ * defined, depending on hardware capabilities:
+ * - If the input lane contains `NaN`, the result is either `0` or the respective maximum integer value.
+ * - If the input lane contains a value otherwise out of bounds of the target type, the result is either the
+ * saturatated result or maximum integer value.
+ */
+ export function relaxed_trunc_f64x2_u_zero(a: v128): v128;
+ /**
+ * Selects 32-bit integer lanes from `a` or `b` based on masks in `m`.
+ *
+ * Behaves like {@link v128.bitselect} if masks in `m` do have all bits either set (result is `a[i]`) or unset (result
+ * is `b[i]`). Otherwise the result is implementation-defined, depending on hardware capabilities: If the most
+ * significant bit of `m` is set, the result is either `bitselect(a[i], b[i], mask)` or `a[i]`, otherwise the result
+ * is `b[i]`.
+ */
+ export function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
+ /**
+ * Computes the dot product of two 8-bit lanes each, yielding lanes two sizes wider than the input with the lanes of
+ * `c` accumulated into the result.
+ *
+ * Unlike {@link v128.dot}, if the most significant bit of `b[i]` is set, whether `b[i]` is interpreted as signed or
+ * unsigned by the intermediate multiplication is implementation-defined.
+ */
+ export function relaxed_dot_i8x16_i7x16_add_s(a: v128, b: v128, c: v128): v128;
}
/** Initializes a 128-bit vector from two 64-bit integer values. Arguments must be compile-time constants. */
declare function i64x2(a: i64, b: i64): v128;
declare namespace i64x2 {
/** Creates a vector with two identical 64-bit integer lanes. */
export function splat(x: i64): v128;
- /** Extracts one 64-bit integer lane as a scalar. */
+ /** Extracts one 64-bit integer lane as a scalar. `idx` argument need to be compile time constant */
export function extract_lane(x: v128, idx: u8): i64;
- /** Replaces one 64-bit integer lane. */
+ /** Replaces one 64-bit integer lane. idx argument needs to be compile time constant. */
export function replace_lane(x: v128, idx: u8, value: i64): v128;
/** Adds each 64-bit integer lane. */
export function add(a: v128, b: v128): v128;
@@ -1261,17 +1470,24 @@ declare namespace i64x2 {
export function extmul_high_i32x4_u(a: v128, b: v128): v128;
/** Selects 64-bit lanes from either vector according to the specified [0-1] respectively [2-3] lane indexes. */
export function shuffle(a: v128, b: v128, l0: u8, l1: u8): v128;
- /** Selects 8-bit lanes from the first vector according to the indexes [0-15] specified by the 8-bit lanes of the second vector. */
- export function swizzle(a: v128, s: v128): v128;
+ /**
+ * Selects 64-bit integer lanes from `a` or `b` based on masks in `m`.
+ *
+ * Behaves like {@link v128.bitselect} if masks in `m` do have all bits either set (result is `a[i]`) or unset (result
+ * is `b[i]`). Otherwise the result is implementation-defined, depending on hardware capabilities: If the most
+ * significant bit of `m` is set, the result is either `bitselect(a[i], b[i], mask)` or `a[i]`, otherwise the result
+ * is `b[i]`.
+ */
+ export function relaxed_laneselect(a: v128, b: v128, m: v128): v128;
}
/** Initializes a 128-bit vector from four 32-bit float values. Arguments must be compile-time constants. */
declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;
declare namespace f32x4 {
/** Creates a vector with four identical 32-bit float lanes. */
export function splat(x: f32): v128;
- /** Extracts one 32-bit float lane as a scalar. */
+ /** Extracts one 32-bit float lane as a scalar. idx argument needs to be compile time constant. */
export function extract_lane(x: v128, idx: u8): f32;
- /** Replaces one 32-bit float lane. */
+ /** Replaces one 32-bit float lane. idx argument needs to be compile time constant. */
export function replace_lane(x: v128, idx: u8, value: f32): v128;
/** Adds each 32-bit float lane. */
export function add(a: v128, b: v128): v128;
@@ -1323,17 +1539,45 @@ declare namespace f32x4 {
export function demote_f64x2_zero(a: v128): v128;
/** Selects 32-bit lanes from either vector according to the specified [0-3] respectively [4-7] lane indexes. */
export function shuffle(a: v128, b: v128, l0: u8, l1: u8, l2: u8, l3: u8): v128;
- /** Selects 8-bit lanes from the first vector according to the indexes [0-15] specified by the 8-bit lanes of the second vector. */
- export function swizzle(a: v128, s: v128): v128;
+ /**
+ * Performs the fused multiply-add operation (`a * b + c`) on all 32-bit floating point lanes.
+ *
+ * The result is implementation defined, depending on hardware capabilities:
+ * - Either `a * b` is rounded once and the final result rounded again, or
+ * - The expression is evaluated with higher precision and only rounded once
+ */
+ export function relaxed_madd(a: v128, b: v128, c: v128): v128;
+ /**
+ * Performs the fused negative multiply-add operation (`-(a * b) + c`) on all 32-bit floating point lanes.
+ *
+ * The result is implementation defined, depending on hardware capabilities:
+ * - Either `a * b` is rounded once and the final result rounded again, or
+ * - The expression is evaluated with higher precision and only rounded once
+ */
+ export function relaxed_nmadd(a: v128, b: v128, c: v128): v128;
+ /**
+ * Computes the minimum of each 32-bit floating point lane.
+ *
+ * Unlike {@link f32x4.min}, the result is implementation-defined if either value is `NaN`, `-0.0` or `+0.0`,
+ * depending on hardware capabilities: Either `a[i]` or `b[i]`.
+ */
+ export function relaxed_min(a: v128, b: v128): v128;
+ /**
+ * Computes the maximum of each 32-bit floating point lane.
+ *
+ * Unlike {@link f32x4.max}, the result is implementation-defined if either value is `NaN`, `-0.0` or `+0.0`,
+ * depending on hardware capabilities: Either `a[i]` or `b[i]`.
+ */
+ export function relaxed_max(a: v128, b: v128): v128;
}
/** Initializes a 128-bit vector from two 64-bit float values. Arguments must be compile-time constants. */
declare function f64x2(a: f64, b: f64): v128;
declare namespace f64x2 {
/** Creates a vector with two identical 64-bit float lanes. */
export function splat(x: f64): v128;
- /** Extracts one 64-bit float lane as a scalar. */
+ /** Extracts one 64-bit float lane as a scalar. idx argument needs to be compile time constant. */
export function extract_lane(x: v128, idx: u8): f64;
- /** Replaces one 64-bit float lane. */
+ /** Replaces one 64-bit float lane. idx argument needs to be compile time constant. */
export function replace_lane(x: v128, idx: u8, value: f64): v128;
/** Adds each 64-bit float lane. */
export function add(a: v128, b: v128): v128;
@@ -1385,15 +1629,43 @@ declare namespace f64x2 {
export function promote_low_f32x4(a: v128): v128;
/** Selects 64-bit lanes from either vector according to the specified [0-1] respectively [2-3] lane indexes. */
export function shuffle(a: v128, b: v128, l0: u8, l1: u8): v128;
- /** Selects 8-bit lanes from the first vector according to the indexes [0-15] specified by the 8-bit lanes of the second vector. */
- export function swizzle(a: v128, s: v128): v128;
+ /**
+ * Performs the fused multiply-add operation (`a * b + c`) on all 64-bit floating point lanes.
+ *
+ * The result is implementation defined, depending on hardware capabilities:
+ * - Either `a * b` is rounded once and the final result rounded again, or
+ * - The expression is evaluated with higher precision and only rounded once
+ */
+ export function relaxed_madd(a: v128, b: v128, c: v128): v128;
+ /**
+ * Performs the fused negative multiply-add operation (`-(a * b) + c`) on all 64-bit floating point lanes.
+ *
+ * The result is implementation defined, depending on hardware capabilities:
+ * - Either `a * b` is rounded once and the final result rounded again, or
+ * - The expression is evaluated with higher precision and only rounded once
+ */
+ export function relaxed_nmadd(a: v128, b: v128, c: v128): v128;
+ /**
+ * Computes the minimum of each 64-bit floating point lane.
+ *
+ * Unlike {@link f64x2.min}, the result is implementation-defined if either value is `NaN`, `-0.0` or `+0.0`,
+ * depending on hardware capabilities: Either `a[i]` or `b[i]`.
+ */
+ export function relaxed_min(a: v128, b: v128): v128;
+ /**
+ * Computes the maximum of each 64-bit floating point lane.
+ *
+ * Unlike {@link f64x2.max}, the result is implementation-defined if either value is `NaN`, `-0.0` or `+0.0`,
+ * depending on hardware capabilities: Either `a[i]` or `b[i]`.
+ */
+ export function relaxed_max(a: v128, b: v128): v128;
}
declare abstract class i31 {
- /** Creates a new i31ref from the specified integer value. */
- static new(value: i32): i31ref;
- /** Gets the integer value of an i31ref. */
- static get(i31expr: i31ref): i32;
+ /** Creates a new 31-bit integer reference from the specified integer value. */
+ static new(value: i32): ref_i31;
+ /** Gets the integer value of an 31-bit integer reference. */
+ static get(i31expr: ref_i31 | null): i32;
}
/** Macro type evaluating to the underlying native WebAssembly type. */
@@ -1857,6 +2129,7 @@ declare class StaticArray {
/** Class representing a sequence of characters. */
declare class String {
+ [key: i32]: string;
static fromCharCode(ls: i32, hs?: i32): string;
static fromCharCodes(arr: i32[]): string;
static fromCodePoint(code: i32): string;
@@ -2035,6 +2308,90 @@ interface Function {
/** Returns a string representation of this function. */
toString(): string;
}
+
+/**
+ * Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.
+ */
+type ThisParameterType = T extends (this: infer U, ...args: never) => any ? U : unknown;
+
+/**
+ * Removes the 'this' parameter from a function type.
+ */
+type OmitThisParameter = unknown extends ThisParameterType ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;
+
+interface CallableFunction extends Function {
+ /**
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
+ * @param thisArg The object to be used as the this object.
+ */
+ apply(this: (this: T) => R, thisArg: T): R;
+
+ /**
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
+ * @param thisArg The object to be used as the this object.
+ * @param args An array of argument values to be passed to the function.
+ */
+ apply(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;
+
+ /**
+ * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
+ * @param thisArg The object to be used as the this object.
+ * @param args Argument values to be passed to the function.
+ */
+ call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg The object to be used as the this object.
+ */
+ bind(this: T, thisArg: ThisParameterType): OmitThisParameter;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg The object to be used as the this object.
+ * @param args Arguments to bind to the parameters of the function.
+ */
+ bind(this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R;
+}
+
+interface NewableFunction extends Function {
+ /**
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
+ * @param thisArg The object to be used as the this object.
+ */
+ apply(this: new () => T, thisArg: T): void;
+ /**
+ * Calls the function with the specified object as the this value and the elements of specified array as the arguments.
+ * @param thisArg The object to be used as the this object.
+ * @param args An array of argument values to be passed to the function.
+ */
+ apply(this: new (...args: A) => T, thisArg: T, args: A): void;
+
+ /**
+ * Calls the function with the specified object as the this value and the specified rest arguments as the arguments.
+ * @param thisArg The object to be used as the this object.
+ * @param args Argument values to be passed to the function.
+ */
+ call(this: new (...args: A) => T, thisArg: T, ...args: A): void;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg The object to be used as the this object.
+ */
+ bind(this: T, thisArg: any): T;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg The object to be used as the this object.
+ * @param args Arguments to bind to the parameters of the function.
+ */
+ bind(this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R;
+}
+
interface IArguments {}
interface RegExp {}
@@ -2337,6 +2694,10 @@ declare function final(constructor: Constructor): void;
/** Annotates a method, function or constant global as always inlined. */
declare function inline(...args: any[]): any;
+declare namespace inline {
+ /** Explicitly requests inlined function calls on the provided expression wherever possible. */
+ export function always(value: T): T;
+}
/** Annotates a method, function or constant global as unsafe. */
declare function unsafe(...args: any[]): any;
diff --git a/std/assembly/polyfills.ts b/std/assembly/polyfills.ts
new file mode 100644
index 0000000000..2f39f1f207
--- /dev/null
+++ b/std/assembly/polyfills.ts
@@ -0,0 +1,27 @@
+export function bswap(value: T): T {
+ if (isInteger()) {
+ if (sizeof() == 1) {
+ return value;
+ }
+ if (sizeof() == 2) {
+ return (value << 8 | (value >> 8));
+ }
+ if (sizeof() == 4) {
+ return (
+ rotl(value & 0xFF00FF00, 8) |
+ rotr(value & 0x00FF00FF, 8)
+ );
+ }
+ if (sizeof() == 8) {
+ let a = (value >> 8) & 0x00FF00FF00FF00FF;
+ let b = (value & 0x00FF00FF00FF00FF) << 8;
+ let v = a | b;
+
+ a = (v >>> 16) & 0x0000FFFF0000FFFF;
+ b = (v & 0x0000FFFF0000FFFF) << 16;
+
+ return rotr(a | b, 32);
+ }
+ }
+ ERROR("Unsupported generic type");
+}
diff --git a/std/assembly/process.ts b/std/assembly/process.ts
index 107e6c2ace..63c35e1b98 100644
--- a/std/assembly/process.ts
+++ b/std/assembly/process.ts
@@ -29,7 +29,7 @@ export namespace process {
}
export function time(): i64 {
- return Date_binding.now();
+ return Date_binding.now();
}
export function hrtime(): u64 {
diff --git a/std/assembly/reference.ts b/std/assembly/reference.ts
index 1c7b85cb13..148f456799 100644
--- a/std/assembly/reference.ts
+++ b/std/assembly/reference.ts
@@ -1,31 +1,48 @@
+// Canonical aliases
+export type funcref = ref_func | null;
+export type externref = ref_extern | null;
+export type anyref = ref_any | null;
+export type eqref = ref_eq | null;
+export type i31ref = ref_i31 | null;
+export type structref = ref_struct | null;
+export type arrayref = ref_array | null;
+export type stringref = ref_string | null;
+export type stringview_wtf8 = ref_stringview_wtf8 | null;
+export type stringview_wtf16 = ref_stringview_wtf16 | null;
+export type stringview_iter = ref_stringview_iter | null;
+
@unmanaged
abstract class Ref {
}
@final @unmanaged
-export abstract class Funcref extends Ref {
+export abstract class RefFunc extends Ref {
+}
+
+@final @unmanaged
+export abstract class RefExtern extends Ref {
}
@final @unmanaged
-export abstract class Externref extends Ref {
+export abstract class RefAny extends Ref {
}
@final @unmanaged
-export abstract class Anyref extends Ref {
+export abstract class RefEq extends Ref {
}
@final @unmanaged
-export abstract class Eqref extends Ref {
+export abstract class RefI31 extends Ref {
}
@final @unmanaged
-export abstract class I31ref extends Ref {
+export abstract class RefStruct extends Ref {
}
@final @unmanaged
-export abstract class Structref extends Ref {
+export abstract class RefArray extends Ref {
}
@final @unmanaged
-export abstract class Arrayref extends Ref {
+export abstract class RefString extends Ref {
}
diff --git a/std/assembly/rt/index-incremental.ts b/std/assembly/rt/index-incremental.ts
index 4730344b4f..2f1f115932 100644
--- a/std/assembly/rt/index-incremental.ts
+++ b/std/assembly/rt/index-incremental.ts
@@ -1,2 +1,2 @@
-import "rt/tlsf";
-import "rt/itcms";
+import "./tlsf";
+import "./itcms";
diff --git a/std/assembly/rt/index-minimal.ts b/std/assembly/rt/index-minimal.ts
index cf88ee158f..72b6eb0873 100644
--- a/std/assembly/rt/index-minimal.ts
+++ b/std/assembly/rt/index-minimal.ts
@@ -1,2 +1,2 @@
-import "rt/tlsf";
-import "rt/tcms";
+import "./tlsf";
+import "./tcms";
diff --git a/std/assembly/rt/index-stub.ts b/std/assembly/rt/index-stub.ts
index 47f29bebfd..924ecfb8e3 100644
--- a/std/assembly/rt/index-stub.ts
+++ b/std/assembly/rt/index-stub.ts
@@ -1 +1 @@
-import "rt/stub";
+import "./stub";
diff --git a/std/assembly/rt/itcms.ts b/std/assembly/rt/itcms.ts
index b44b69af25..ba2e09eb00 100644
--- a/std/assembly/rt/itcms.ts
+++ b/std/assembly/rt/itcms.ts
@@ -403,7 +403,12 @@ function interrupt(): void {
budget -= step();
if (state == STATE_IDLE) {
if (TRACE) trace("└ GC (auto) done at cur/max", 2, total, memory.size() << 16);
- threshold = (total * IDLEFACTOR / 100) + GRANULARITY;
+ if (IDLEFACTOR % 100 == 0) {
+ // optimization for the default GC parameters which idle factor is 200%
+ threshold = total * (IDLEFACTOR / 100) + GRANULARITY;
+ } else {
+ threshold = ((total * IDLEFACTOR) / 100) + GRANULARITY;
+ }
if (PROFILE) onyield(total);
return;
}
diff --git a/std/assembly/rt/tlsf.ts b/std/assembly/rt/tlsf.ts
index df437b82cb..3d135a3bee 100644
--- a/std/assembly/rt/tlsf.ts
+++ b/std/assembly/rt/tlsf.ts
@@ -307,6 +307,15 @@ function removeBlock(root: Root, block: Block): void {
// must perform those updates.
}
+function roundSize(size: usize): usize {
+ const halfMaxSize = BLOCK_MAXSIZE >> 1; // don't round last fl
+ const inv: usize = sizeof() * 8 - 1;
+ const invRound = inv - SL_BITS;
+ return size < halfMaxSize
+ ? size + (1 << (invRound - clz(size))) - 1
+ : size;
+}
+
/** Searches for a free block of at least the specified size. */
function searchBlock(root: Root, size: usize): Block | null {
// size was already asserted by caller
@@ -317,13 +326,8 @@ function searchBlock(root: Root, size: usize): Block | null {
fl = 0;
sl = (size >> AL_BITS);
} else {
- const halfMaxSize = BLOCK_MAXSIZE >> 1; // don't round last fl
- const inv: usize = sizeof() * 8 - 1;
- const invRound = inv - SL_BITS;
- let requestSize = size < halfMaxSize
- ? size + (1 << (invRound - clz(size))) - 1
- : size;
- fl = inv - clz(requestSize);
+ const requestSize = roundSize(size);
+ fl = sizeof() * 8 - 1 - clz(requestSize);
sl = ((requestSize >> (fl - SL_BITS)) ^ (1 << SL_BITS));
fl -= SB_BITS - 1;
}
@@ -373,8 +377,9 @@ function prepareBlock(root: Root, block: Block, size: usize): void {
}
/** Adds more memory to the pool. */
-function addMemory(root: Root, start: usize, end: usize): bool {
- if (DEBUG) assert(start <= end); // must be valid
+function addMemory(root: Root, start: usize, endU64: u64): bool {
+ let end = endU64;
+ if (DEBUG) assert(