diff --git a/acorn-loose/package-lock.json b/acorn-loose/package-lock.json new file mode 100644 index 000000000..c07f9b157 --- /dev/null +++ b/acorn-loose/package-lock.json @@ -0,0 +1,33 @@ +{ + "name": "acorn-loose", + "version": "8.5.2", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "acorn-loose", + "version": "8.5.2", + "license": "MIT", + "dependencies": { + "acorn": "^8.15.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "../acorn": { + "version": "8.15.0", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn": { + "resolved": "../acorn", + "link": true + } + } +} diff --git a/acorn-loose/package.json b/acorn-loose/package.json index 6bf5980c7..14bff4b17 100644 --- a/acorn-loose/package.json +++ b/acorn-loose/package.json @@ -2,8 +2,8 @@ "name": "acorn-loose", "description": "Error-tolerant ECMAScript parser", "homepage": "https://github.com/acornjs/acorn", + "type": "module", "main": "dist/acorn-loose.js", - "module": "dist/acorn-loose.mjs", "types": "dist/acorn-loose.d.ts", "exports": { ".": [ diff --git a/acorn-loose/rollup.config.mjs b/acorn-loose/rollup.config.js similarity index 100% rename from acorn-loose/rollup.config.mjs rename to acorn-loose/rollup.config.js diff --git a/acorn-walk/package-lock.json b/acorn-walk/package-lock.json new file mode 100644 index 000000000..7f5e31370 --- /dev/null +++ b/acorn-walk/package-lock.json @@ -0,0 +1,33 @@ +{ + "name": "acorn-walk", + "version": "8.3.4", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "acorn-walk", + "version": "8.3.4", + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "../acorn": { + "version": "8.15.0", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn": { + "resolved": "../acorn", + "link": true + } + } +} diff --git a/acorn-walk/package.json b/acorn-walk/package.json index 133059576..f08f25673 100644 --- a/acorn-walk/package.json +++ b/acorn-walk/package.json @@ -2,9 +2,9 @@ "name": "acorn-walk", "description": "ECMAScript (ESTree) AST walker", "homepage": "https://github.com/acornjs/acorn", + "type": "module", "main": "dist/walk.js", "types": "dist/walk.d.ts", - "module": "dist/walk.mjs", "exports": { ".": [ { diff --git a/acorn-walk/rollup.config.mjs b/acorn-walk/rollup.config.js similarity index 100% rename from acorn-walk/rollup.config.mjs rename to acorn-walk/rollup.config.js diff --git a/acorn/README.md b/acorn/README.md index 962de0272..42d62a121 100644 --- a/acorn/README.md +++ b/acorn/README.md @@ -257,8 +257,8 @@ on the extended version of the class. To extend a parser with plugins, you can use its static `extend` method. ```javascript -var acorn = require("acorn") -var jsx = require("acorn-jsx") +import * as acorn from "acorn" +import jsx from "acorn-jsx" var JSXParser = acorn.Parser.extend(jsx()) JSXParser.parse("foo()", {ecmaVersion: 2020}) ``` diff --git a/acorn/package-lock.json b/acorn/package-lock.json new file mode 100644 index 000000000..116aa59ad --- /dev/null +++ b/acorn/package-lock.json @@ -0,0 +1,19 @@ +{ + "name": "acorn", + "version": "8.15.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "acorn", + "version": "8.15.0", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + } + } +} diff --git a/acorn/package.json b/acorn/package.json index 6f63ddbf6..4b1630729 100644 --- a/acorn/package.json +++ b/acorn/package.json @@ -2,9 +2,9 @@ "name": "acorn", "description": "ECMAScript parser", "homepage": "https://github.com/acornjs/acorn", + "type": "module", "main": "dist/acorn.js", "types": "dist/acorn.d.ts", - "module": "dist/acorn.mjs", "exports": { ".": [ { diff --git a/acorn/rollup.config.mjs b/acorn/rollup.config.js similarity index 100% rename from acorn/rollup.config.mjs rename to acorn/rollup.config.js diff --git a/bin/generate-identifier-regex.js b/bin/generate-identifier-regex.js index 28175f19a..dc813f7f1 100644 --- a/bin/generate-identifier-regex.js +++ b/bin/generate-identifier-regex.js @@ -1,14 +1,12 @@ -"use strict" - -const fs = require("fs") -const path = require("path") -const pkg = require("../package.json") +import fs from "fs" +import path from "path" +import pkg from "../package.json" with { type: "json" } const dependencies = Object.keys(pkg.devDependencies) const unicodeVersion = dependencies.find((name) => /^@unicode\/unicode-\d/.test(name)) -const start = require(unicodeVersion + "/Binary_Property/ID_Start/code-points.js").filter(ch => ch > 0x7f) +const start = (await import(unicodeVersion + "/Binary_Property/ID_Start/code-points.js")).default.filter(ch => ch > 0x7f) let last = -1 -const cont = [0x200c, 0x200d].concat(require(unicodeVersion + "/Binary_Property/ID_Continue/code-points.js") +const cont = [0x200c, 0x200d].concat((await import(unicodeVersion + "/Binary_Property/ID_Continue/code-points.js")).default .filter(ch => ch > 0x7f && search(start, ch, last + 1) === -1)) function search(arr, ch, starting) { diff --git a/bin/generate-unicode-script-values.js b/bin/generate-unicode-script-values.js index e49f8585b..8779b8a50 100644 --- a/bin/generate-unicode-script-values.js +++ b/bin/generate-unicode-script-values.js @@ -1,35 +1,29 @@ -"use strict" - -const fs = require("fs") -const path = require("path") - -import("../acorn/src/unicode-property-data.js") - .then(m => { - return m.default[13].nonBinary.Script - }) - .then(async(reScriptValuesAddedInES) => { - const scriptValues = new Set() - for await (const value of getLatestUnicodeScriptValues()) { - scriptValues.add(value) - } - const scriptValuesAddedInUnicode = "export default " + - JSON.stringify( - [...scriptValues] - // The unicode script values now follow the Unicode spec as of ES2023, - // but prior to ES2022 they were listed in the ES2022 spec. - // The generated file lists all the unicode script values except those listed before ES2022. - .filter(value => !reScriptValuesAddedInES.test(value)) - .sort() - .join(" ") - ) +import fs from "fs" +import path from "path" +import m from "../acorn/src/unicode-property-data.js" + +const reScriptValuesAddedInES = m[13].nonBinary.Script +const scriptValues = new Set() +for await (const value of getLatestUnicodeScriptValues()) { + scriptValues.add(value) +} +const scriptValuesAddedInUnicode = "export default " + +JSON.stringify( + [...scriptValues] + // The unicode script values now follow the Unicode spec as of ES2023, + // but prior to ES2022 they were listed in the ES2022 spec. + // The generated file lists all the unicode script values except those listed before ES2022. + .filter(value => !reScriptValuesAddedInES.test(value)) + .sort() + .join(" ") +) - writeGeneratedFile("scriptValuesAddedInUnicode", scriptValuesAddedInUnicode) +writeGeneratedFile("scriptValuesAddedInUnicode", scriptValuesAddedInUnicode) - console.log("Done. The generated files must be committed.") - }) +console.log("Done. The generated files must be committed.") function writeGeneratedFile(filename, content) { - const comment = "// This file was generated by \"bin/" + path.basename(__filename) + "\". Do not modify manually!" + const comment = "// This file was generated by \"bin/" + path.basename(import.meta.filename) + "\". Do not modify manually!" fs.writeFileSync(path.resolve("./acorn/src/generated", filename + ".js"), comment + "\n" + content + "\n", "utf8") } diff --git a/bin/run_test262.js b/bin/run_test262.js index 129aebec5..c3d921cc2 100644 --- a/bin/run_test262.js +++ b/bin/run_test262.js @@ -1,7 +1,7 @@ -const fs = require("fs") -const path = require("path") -const run = require("test262-parser-runner") -const parse = require("../acorn").parse +import fs from "fs" +import path from "path" +import run from "test262-parser-runner" +import {parse} from "../acorn/src/index.js" function loadList(filename) { return fs.readFileSync(filename, "utf8") @@ -12,7 +12,7 @@ function loadList(filename) { run( (content, {sourceType}) => parse(content, {sourceType, ecmaVersion: "latest", preserveParens: true}), { - testsDirectory: path.dirname(require.resolve("test262/package.json")), + testsDirectory: path.dirname(new URL(import.meta.resolve("test262/package.json")).pathname), skip: test => test.attrs.features && loadList("./bin/test262.unsupported-features").some(f => test.attrs.features.includes(f)), whitelist: loadList("./bin/test262.whitelist") diff --git a/eslint.config.mjs b/eslint.config.js similarity index 94% rename from eslint.config.mjs rename to eslint.config.js index be73fe6d0..6b8bb40bb 100644 --- a/eslint.config.mjs +++ b/eslint.config.js @@ -60,10 +60,11 @@ export default [ files: [ "acorn/src/bin/*.js", "bin/generate-identifier-regex.js", - "bin/generate-unicode-script-values.js" + "bin/generate-unicode-script-values.js", + "bin/run_test262.js" ], languageOptions: { - ecmaVersion: 2022 + ecmaVersion: 2025 }, rules: { "no-console": "off" diff --git a/package.json b/package.json index acb7ebda6..f56c1b2a1 100644 --- a/package.json +++ b/package.json @@ -19,17 +19,19 @@ "type": "git", "url": "https://github.com/acornjs/acorn.git" }, + "type": "module", "license": "MIT", "scripts": { "build": "npm run build:main && npm run build:walk && npm run build:loose", - "build:loose": "rollup -c acorn-loose/rollup.config.mjs", - "build:main": "rollup -c acorn/rollup.config.mjs", - "build:walk": "rollup -c acorn-walk/rollup.config.mjs", + "build:loose": "rollup -c acorn-loose/rollup.config.js && echo \"{\\\"type\\\": \\\"commonjs\\\"}\" > acorn-loose/dist/package.json", + "build:main": "rollup -c acorn/rollup.config.js && echo \"{\\\"type\\\": \\\"commonjs\\\"}\" > acorn/dist/package.json", + "build:walk": "rollup -c acorn-walk/rollup.config.js && echo \"{\\\"type\\\": \\\"commonjs\\\"}\" > acorn-walk/dist/package.json", "generate": "npm run generate:identifier-regex && npm run generate:unicode-script-values", "generate:identifier-regex": "node bin/generate-identifier-regex.js", "generate:unicode-script-values": "node bin/generate-unicode-script-values.js", "lint": "eslint .", "lint:fix": "eslint . --fix", + "benchmark": "node test/bench/index.js", "prepare": "npm run test", "pretest": "npm run build:main && npm run build:loose", "test": "node test/run.js", diff --git a/test/bench/package-lock.json b/test/bench/package-lock.json new file mode 100644 index 000000000..08ff17564 --- /dev/null +++ b/test/bench/package-lock.json @@ -0,0 +1,1218 @@ +{ + "name": "acorn-benchmarks", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "acorn-benchmarks", + "version": "0.0.0", + "license": "MIT", + "dependencies": { + "acorn": "*", + "babylon": "*", + "benchtable": "^0.1.0", + "esprima": "*", + "flow-parser": "*", + "traceur": "*", + "typescript": "*", + "yargs": "^8.0.1" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "license": "BSD-3-Clause OR MIT", + "engines": { + "node": ">=0.4.2" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansy": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/ansy/-/ansy-1.0.16.tgz", + "integrity": "sha512-9heIA517JMByr2usiEiobYDJSN71ikQgcFucf4mp4THZG2ZQHNQJjzJIICB1m5JOy3s66HZHTZ5nTHDoliLI9A==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.0.0", + "custom-return": "^1.0.0", + "supports-color": "^3.1.2", + "ul": "^5.2.1" + } + }, + "node_modules/babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "license": "MIT", + "bin": { + "babylon": "bin/babylon.js" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha512-l9MlfN4M1K/H2fbhfMy3B7vJd6AGKJVQn2h6Sg/Yx+KckoUA7ewS5Vv6TjSq18ooE1kS9hhAlQRH3AkXIh/aOQ==", + "license": "MIT", + "dependencies": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "node_modules/benchtable": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/benchtable/-/benchtable-0.1.0.tgz", + "integrity": "sha512-Ap1W+z1P63YYSTS7Znmp0MFOtZD5BIIH92Fsgvf7ozf2vlVdASCUu/ragfprCyGvfKJCznbQZvv6TMaMgHs0Tw==", + "license": "Apache-2.0", + "dependencies": { + "benchmark": "^2.0.0", + "cli-table": "^0.3.1", + "color-it": "^1.2.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.11.tgz", + "integrity": "sha512-IqLQi4lO0nIB4tcdTpN4LCB9FI3uqrJZK7RC515EnhZ6qBaglkIgICb1wjeAqpdoOabm1+SuQtkXIPdYC93jhQ==", + "dependencies": { + "colors": "1.0.3" + }, + "engines": { + "node": ">= 0.2.0" + } + }, + "node_modules/cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", + "license": "ISC", + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "license": "MIT", + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "license": "MIT", + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-it": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/color-it/-/color-it-1.2.13.tgz", + "integrity": "sha512-JPcsSzt0MRDKagqfYZgO4vZ1p/xBNnfFOtZDJ82ishjja4/M3esGhboDlFVMdd790f0ZN62BXEMXegyv0s7aJw==", + "license": "MIT", + "dependencies": { + "couleurs": "^6.0.6", + "flat-colors": "^3.1.0", + "iterate-object": "^1.1.0", + "typpy": "^2.3.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha512-pFGrxThWcWQ2MsAz6RtgeWe4NK2kUE1WfsrvvlctdII745EW9I0yflqhe7++M5LEc7bV2c/9/5zc8sFcpL0Drw==", + "license": "MIT", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/commander": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "integrity": "sha512-bmkUukX8wAOjHdN26xj5c4ctEV22TQ7dQYhSmuckKhToXrkUn0iIaolHdIxYYqD55nhpSPA9zPQ1yP57GdXP2A==", + "license": "MIT", + "dependencies": { + "graceful-readlink": ">= 1.0.0" + }, + "engines": { + "node": ">= 0.6.x" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/couleurs": { + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/couleurs/-/couleurs-6.0.12.tgz", + "integrity": "sha512-3SzCoWk+IWpReIhdrPnFCsjOQq1CyZ1OHWVTlFq/HR94tK6tEzNSbUycYCEhg+ywnznhFACad+YbGAHGmKzeOQ==", + "license": "MIT", + "dependencies": { + "ansy": "^1.0.0", + "color-convert": "^1.0.0", + "iterate-object": "^1.3.1", + "typpy": "^2.3.1" + } + }, + "node_modules/cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", + "license": "MIT", + "dependencies": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "node_modules/custom-return": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/custom-return/-/custom-return-1.0.13.tgz", + "integrity": "sha512-28xNk/Ek+zEhP5grGiNm9+npFJzqhwULzNcBSx4Osh4iuvczTLQqKB7cZoyNql/hpuuWyWBzbeY2+uCH0Qv7UA==", + "license": "MIT", + "dependencies": { + "noop6": "^1.0.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deffy": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/deffy/-/deffy-2.2.5.tgz", + "integrity": "sha512-6TX2cfIo97eKqWmqgMDAUulCwnveAe3K+4VGsTGPJsL3NtSEnSBFZ3sUXdS4EBhZ8GbdaZBzXQ04ton18dJrug==", + "license": "MIT", + "dependencies": { + "typpy": "^2.0.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha512-RztN09XglpYI7aBBrJCPW95jEH7YF1UEPOoX9yDhUTPdp7mK+CQvnLTuD10BNXZ3byLTu2uehZ8EcKT/4CGiFw==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "license": "MIT", + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flat-colors": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/flat-colors/-/flat-colors-3.3.13.tgz", + "integrity": "sha512-wtm7d8radXRuXQEV8taHfW2PybnYAEEr3rK3ri3mKbeA4wc2vzOyAYpbY26MJWl7IthhiqduvC2XcJvIdZsegQ==", + "license": "MIT" + }, + "node_modules/flow-parser": { + "version": "0.289.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.289.0.tgz", + "integrity": "sha512-w4sVnH6ddNAIxokoz0mGyiIIdzvqncFhAYW+RmkPbPSSTYozG6yhqAixzaWeBCQf2qqXJTlHkoKPnf/BAj8Ofw==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.name": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/function.name/-/function.name-1.0.14.tgz", + "integrity": "sha512-s99L814NRuLxwF2sJMIcLhkQhueGXb3oKyvorzrUKKwlVB0SBbWrgZt4+EwKAo3ujCXnT7vshmCvXgZA09kCMw==", + "license": "MIT", + "dependencies": { + "noop6": "^1.0.1" + } + }, + "node_modules/get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "license": "ISC" + }, + "node_modules/get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha512-8tLu60LgxF6XpdbK8OW3FA+IfTNBn1ZHGHKF4KQbEeSkajYw5PlYJcKluntgegDPTg8UkHjpet1T82vk6TQ68w==", + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "license": "ISC" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/iterate-object": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/iterate-object/-/iterate-object-1.3.5.tgz", + "integrity": "sha512-eL23u8oFooYTq6TtJKjp2RYjZnCkUYQvC0T/6fJfWykXJ3quvdDdzKZ3CEjy8b3JGOvLTjDYMEMIp5243R906A==", + "license": "MIT" + }, + "node_modules/lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "license": "MIT", + "dependencies": { + "invert-kv": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha512-3p6ZOGNbiX4CdvEd1VcE6yi78UrGNpjHO33noGwHCnT/o2fyllJDepsm8+mFFv/DvtwFHht5HIHSyOy5a+ChVQ==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "license": "MIT", + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "license": "ISC", + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha512-nOBDrc/wgpkd3X/JOhMqYR+/eLqlfLP4oQfoBA6QExIxEl+GU01oyEkwWyueyO8110pUKijtiHGhEmYoOn88oQ==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/noop6": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/noop6/-/noop6-1.0.10.tgz", + "integrity": "sha512-WZvuCILZFZHK+WuqCQwxLBGllkBK1ct8s8Mu9FMDbEsBE6/bqNxyFGbX7Xky+6bYFL8X2Ou4Cis4CJyrwXLvQA==", + "license": "MIT" + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", + "license": "MIT", + "dependencies": { + "path-key": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "license": "MIT", + "dependencies": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "license": "MIT", + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "license": "MIT", + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "license": "MIT", + "dependencies": { + "error-ex": "^1.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "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": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha512-dUnb5dXUf+kzhC/W/F4e5/SkluXIFf5VUHolW1Eg1irn1hGWjPGdsRcvYJ1nD6lhk8Ir7VM0bHJKsYTx8Jx9OQ==", + "license": "MIT", + "dependencies": { + "pify": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "license": "MIT" + }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", + "license": "ISC" + }, + "node_modules/read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha512-eFIBOPW7FGjzBuk3hdXEuNSiTZS/xEMlH49HxMyzb0hyPfu4EhVjT2DH32K1hSSmVq4sebAWnZuuY5auISUTGA==", + "license": "MIT", + "dependencies": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha512-1orxQfbWGUiTn9XsPlChs6rLie/AV9jwZTGmu2NZw/CUDJQchXJFYE0Fq5j7+n558T1JhDWLdhyd1Zj+wLY//w==", + "license": "MIT", + "dependencies": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", + "license": "ISC" + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rsvp": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", + "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", + "license": "MIT", + "engines": { + "node": "0.12.* || 4.* || 6.* || >= 7.*" + } + }, + "node_modules/semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha512-IrpJ+yoG4EOH8DFWuVg+8H1kW1Oaof0Wxe7cPcXW3x9BjkN/eVo54F15LyqemnDIUYskQWr9qvl/RihmSy6+xQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/source-map": { + "version": "0.1.32", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", + "integrity": "sha512-htQyLrrRLkQ87Zfrir4/yN+vAUd6DNjVayEjTSHXu29AYQJw57I4/xEL/M6p6E/woPNJwvZt6rVlzc7gFEJccQ==", + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/source-map-support": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", + "integrity": "sha512-gGKOSat73z0V8wBKo9AGxZZyekczBireh1hHktbt+kb9acsCB5OfVCF2DCWlztcQ3r5oNN7f2BL0B2xOcoJ/DQ==", + "dependencies": { + "source-map": "0.1.32" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.22", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz", + "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==", + "license": "CC0-1.0" + }, + "node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "license": "MIT", + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", + "license": "MIT", + "dependencies": { + "has-flag": "^1.0.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/traceur": { + "version": "0.0.111", + "resolved": "https://registry.npmjs.org/traceur/-/traceur-0.0.111.tgz", + "integrity": "sha512-Zy0NCrl3+k1VZvDrZGQJHjLM4Hwz7XHSedhVTdsbV3RNWVtgw/GUP44Rl5WqqcctLkzyQ60eTU2jxfLrlrjWZQ==", + "license": "Apache-2.0", + "dependencies": { + "commander": "2.9.x", + "glob": "5.0.x", + "rsvp": "^3.0.13", + "semver": "^4.3.3", + "source-map-support": "~0.2.8" + }, + "bin": { + "traceur": "traceur" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typpy": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/typpy/-/typpy-2.4.0.tgz", + "integrity": "sha512-a16Uv5doNtvHzaG4wZCHmXN+l9xxmTMpyODtPz7B3DSTsDVNXilTSJGuNw68sUh0Un4bf+ghRMbEcJCI6r06mQ==", + "license": "MIT", + "dependencies": { + "function.name": "^1.0.3" + } + }, + "node_modules/ul": { + "version": "5.2.16", + "resolved": "https://registry.npmjs.org/ul/-/ul-5.2.16.tgz", + "integrity": "sha512-v1YrSEsJZpJsywzF/MKgsQwMdOwBlwwmNiUOJh/yX6FHrq7dYjeua1YOhLV0q0KioqEFZC4P7MsKmpEsGdZz3w==", + "license": "MIT", + "dependencies": { + "deffy": "^2.2.2", + "typpy": "^2.3.4" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" + }, + "node_modules/wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", + "license": "MIT", + "dependencies": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "license": "MIT", + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "license": "MIT", + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "license": "ISC" + }, + "node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", + "integrity": "sha512-3RiZrpLpjrzIAKgGdPktBcMP/eG5bDFlkI+PHle1qwzyVXyDQL+pD/eZaMoOOO0Y7LLBfjpucObuUm/icvbpKQ==", + "license": "MIT", + "dependencies": { + "camelcase": "^4.1.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "read-pkg-up": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^7.0.0" + } + }, + "node_modules/yargs-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", + "integrity": "sha512-WhzC+xgstid9MbVUktco/bf+KJG+Uu6vMX0LN1sLJvwmbCQVxb4D8LzogobonKycNasCZLdOzTAk1SK7+K7swg==", + "license": "ISC", + "dependencies": { + "camelcase": "^4.1.0" + } + } + } +} diff --git a/test/bench/package.json b/test/bench/package.json index 0717e21d6..de6fd0de0 100644 --- a/test/bench/package.json +++ b/test/bench/package.json @@ -3,6 +3,7 @@ "description": "Acorn benchmarks meta-package", "version": "0.0.0", "private": true, + "type": "commonjs", "maintainers": [ { "name": "Marijn Haverbeke", diff --git a/test/driver.js b/test/driver.js index 0ac2f6e74..f0827e955 100644 --- a/test/driver.js +++ b/test/driver.js @@ -1,16 +1,16 @@ var tests = []; -exports.test = function(code, ast, options) { +export const test = function(code, ast, options) { tests.push({code: code, ast: ast, options: options}); }; -exports.testFail = function(code, message, options) { +export const testFail = function(code, message, options) { tests.push({code: code, error: message, options: options}); }; -exports.testAssert = function(code, assert, options) { +export const testAssert = function(code, assert, options) { tests.push({code: code, assert: assert, options: options}); }; -exports.runTests = function(config, callback) { +export const runTests = function(config, callback) { var parse = config.parse; for (var i = 0; i < tests.length; ++i) { @@ -68,7 +68,7 @@ function addPath(str, pt) { return str + " (" + pt + ")"; } -var misMatch = exports.misMatch = function(exp, act) { +export var misMatch = function(exp, act) { if (!exp || !act || (typeof exp !== "object") || (typeof act !== "object")) { if (exp !== act && typeof exp !== "function") return ppJSON(exp) + " !== " + ppJSON(act); diff --git a/test/run.js b/test/run.js index 7156fd06c..72a6df6b7 100644 --- a/test/run.js +++ b/test/run.js @@ -1,156 +1,154 @@ -(function() { - var driver = require("./driver.js") - require("./tests.js"); - require("./tests-harmony.js"); - require("./tests-es7.js"); - require("./tests-asyncawait.js"); - require("./tests-await-top-level.js"); - require("./tests-trailing-commas-in-func.js"); - require("./tests-template-literal-revision.js"); - require("./tests-directive.js"); - require("./tests-rest-spread-properties.js"); - require("./tests-async-iteration.js"); - require("./tests-regexp.js"); - require("./tests-regexp-2018.js"); - require("./tests-regexp-2020.js"); - require("./tests-regexp-2022.js"); - require("./tests-regexp-2024.js"); - require("./tests-regexp-2025.js"); - require("./tests-json-superset.js"); - require("./tests-optional-catch-binding.js"); - require("./tests-bigint.js"); - require("./tests-dynamic-import.js"); - require("./tests-export-named.js"); - require("./tests-export-all-as-ns-from-source.js"); - require("./tests-import-meta.js"); - require("./tests-nullish-coalescing.js"); - require("./tests-optional-chaining.js"); - require("./tests-logical-assignment-operators.js"); - require("./tests-numeric-separators.js"); - require("./tests-class-features-2022.js"); - require("./tests-module-string-names.js"); - require("./tests-import-attributes.js"); - require("./tests-using.js"); - require("./tests-commonjs.js"); - var acorn = require("../acorn") - var acorn_loose = require("../acorn-loose") - - var htmlLog = typeof document === "object" && document.getElementById('log'); - var htmlGroup = htmlLog; - - function group(name) { - if (htmlGroup) { - var parentGroup = htmlGroup; - htmlGroup = document.createElement("ul"); - var item = document.createElement("li"); - item.textContent = name; - item.appendChild(htmlGroup); - parentGroup.appendChild(item); - } - if (typeof console === "object" && console.group) { - console.group(name); - } +import * as driver from "./driver.js" +import "./tests.js"; +import "./tests-harmony.js"; +import "./tests-es7.js"; +import "./tests-asyncawait.js"; +import "./tests-await-top-level.js"; +import "./tests-trailing-commas-in-func.js"; +import "./tests-template-literal-revision.js"; +import "./tests-directive.js"; +import "./tests-rest-spread-properties.js"; +import "./tests-async-iteration.js"; +import "./tests-regexp.js"; +import "./tests-regexp-2018.js"; +import "./tests-regexp-2020.js"; +import "./tests-regexp-2022.js"; +import "./tests-regexp-2024.js"; +import "./tests-regexp-2025.js"; +import "./tests-json-superset.js"; +import "./tests-optional-catch-binding.js"; +import "./tests-bigint.js"; +import "./tests-dynamic-import.js"; +import "./tests-export-named.js"; +import "./tests-export-all-as-ns-from-source.js"; +import "./tests-import-meta.js"; +import "./tests-nullish-coalescing.js"; +import "./tests-optional-chaining.js"; +import "./tests-logical-assignment-operators.js"; +import "./tests-numeric-separators.js"; +import "./tests-class-features-2022.js"; +import "./tests-module-string-names.js"; +import "./tests-import-attributes.js"; +import "./tests-using.js"; +import "./tests-commonjs.js"; +import * as acorn from "../acorn/src/index.js"; +import * as acorn_loose from "../acorn-loose/src/index.js"; + +var htmlLog = typeof document === "object" && document.getElementById('log'); +var htmlGroup = htmlLog; + +function group(name) { + if (htmlGroup) { + var parentGroup = htmlGroup; + htmlGroup = document.createElement("ul"); + var item = document.createElement("li"); + item.textContent = name; + item.appendChild(htmlGroup); + parentGroup.appendChild(item); + } + if (typeof console === "object" && console.group) { + console.group(name); } +} - function groupEnd() { - if (htmlGroup) { - htmlGroup = htmlGroup.parentElement.parentElement; - } - if (typeof console === "object" && console.groupEnd) { - console.groupEnd(name); - } +function groupEnd() { + if (htmlGroup) { + htmlGroup = htmlGroup.parentElement.parentElement; + } + if (typeof console === "object" && console.groupEnd) { + console.groupEnd(name); } +} - function log(title, message) { - if (htmlGroup) { - var elem = document.createElement("li"); - elem.innerHTML = "" + title + " " + message; - htmlGroup.appendChild(elem); - } - if (typeof console === "object") console.log(title, message); +function log(title, message) { + if (htmlGroup) { + var elem = document.createElement("li"); + elem.innerHTML = "" + title + " " + message; + htmlGroup.appendChild(elem); } + if (typeof console === "object") console.log(title, message); +} - var stats, modes = { - Normal: { - config: { - parse: acorn.parse - } - }, - Loose: { - config: { - parse: acorn_loose.parse, - loose: true, - filter: function (test) { - var opts = test.options || {}; - return opts.loose !== false; - } +var stats, modes = { + Normal: { + config: { + parse: acorn.parse + } + }, + Loose: { + config: { + parse: acorn_loose.parse, + loose: true, + filter: function (test) { + var opts = test.options || {}; + return opts.loose !== false; } - }, - - // Test whether the test for `sourceType: 'script'` produces the same result for `'commonjs'`. - 'Normal with sourceType: commonjs': { - config: { - parse: (code, option) => acorn.parse(code, Object.assign({}, option, { sourceType: 'commonjs' })), - filter: function (test) { - var opts = test.options || {}; - return opts.commonjs !== false && !opts.allowAwaitOutsideFunction && (!opts.sourceType || opts.sourceType === 'script'); - } + } + }, + + // Test whether the test for `sourceType: 'script'` produces the same result for `'commonjs'`. + 'Normal with sourceType: commonjs': { + config: { + parse: (code, option) => acorn.parse(code, Object.assign({}, option, { sourceType: 'commonjs' })), + filter: function (test) { + var opts = test.options || {}; + return opts.commonjs !== false && !opts.allowAwaitOutsideFunction && (!opts.sourceType || opts.sourceType === 'script'); } - }, - 'Loose with sourceType: commonjs': { - config: { - parse: (code, option) => acorn_loose.parse(code, Object.assign({}, option, { sourceType: 'commonjs' })), - loose: true, - filter: function (test) { - var opts = test.options || {}; - if (opts.loose === false) return false; - return opts.commonjs !== false && !opts.allowAwaitOutsideFunction && (!opts.sourceType || opts.sourceType === 'script'); - } + } + }, + 'Loose with sourceType: commonjs': { + config: { + parse: (code, option) => acorn_loose.parse(code, Object.assign({}, option, { sourceType: 'commonjs' })), + loose: true, + filter: function (test) { + var opts = test.options || {}; + if (opts.loose === false) return false; + return opts.commonjs !== false && !opts.allowAwaitOutsideFunction && (!opts.sourceType || opts.sourceType === 'script'); } } - }; - - function report(state, code, message) { - if (state !== "ok") {++stats.failed; log(code, message);} - ++stats.testsRun; } - - group("Errors"); - - for (var name in modes) { - group(name); - var mode = modes[name]; - stats = mode.stats = {testsRun: 0, failed: 0}; - var t0 = +new Date; - driver.runTests(mode.config, report); - mode.stats.duration = +new Date - t0; - groupEnd(); - } - +}; + +function report(state, code, message) { + if (state !== "ok") {++stats.failed; log(code, message);} + ++stats.testsRun; +} + +group("Errors"); + +for (var name in modes) { + group(name); + var mode = modes[name]; + stats = mode.stats = {testsRun: 0, failed: 0}; + var t0 = +new Date; + driver.runTests(mode.config, report); + mode.stats.duration = +new Date - t0; groupEnd(); +} - function outputStats(name, stats) { - log(name + ":", stats.testsRun + " tests run in " + stats.duration + "ms; " + - (stats.failed ? stats.failed + " failures." : "all passed.")); - } +groupEnd(); - var total = {testsRun: 0, failed: 0, duration: 0}; +function outputStats(name, stats) { + log(name + ":", stats.testsRun + " tests run in " + stats.duration + "ms; " + + (stats.failed ? stats.failed + " failures." : "all passed.")); +} - group("Stats"); +var total = {testsRun: 0, failed: 0, duration: 0}; - for (var name in modes) { - var stats = modes[name].stats; - outputStats(name + " parser", stats); - for (var key in stats) total[key] += stats[key]; - } +group("Stats"); - outputStats("Total", total); +for (var name in modes) { + var stats = modes[name].stats; + outputStats(name + " parser", stats); + for (var key in stats) total[key] += stats[key]; +} - groupEnd(); +outputStats("Total", total); - if (total.failed && typeof process === "object") { - process.stdout.write("", function() { - process.exit(1); - }); - } -})(); +groupEnd(); + +if (total.failed && typeof process === "object") { + process.stdout.write("", function() { + process.exit(1); + }); +} diff --git a/test/tests-async-iteration.js b/test/tests-async-iteration.js index 303aef168..bb623312b 100644 --- a/test/tests-async-iteration.js +++ b/test/tests-async-iteration.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------------ // for-await-of diff --git a/test/tests-asyncawait.js b/test/tests-asyncawait.js index 2a217aa3b..ead2edc60 100644 --- a/test/tests-asyncawait.js +++ b/test/tests-asyncawait.js @@ -1,8 +1,5 @@ - -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //----------------------------------------------------------------------------- // Async Function Declarations diff --git a/test/tests-await-top-level.js b/test/tests-await-top-level.js index 80715a5c5..dc4fc0995 100644 --- a/test/tests-await-top-level.js +++ b/test/tests-await-top-level.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------------ // await-top-level diff --git a/test/tests-bigint.js b/test/tests-bigint.js index 3ff72a4a2..412439621 100644 --- a/test/tests-bigint.js +++ b/test/tests-bigint.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; const newBigIntLiteral = (start, stringValue, bigint = stringValue) => ({ start: start, diff --git a/test/tests-class-features-2022.js b/test/tests-class-features-2022.js index 2356bddb9..d3578ecd1 100644 --- a/test/tests-class-features-2022.js +++ b/test/tests-class-features-2022.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------------ // Public Class Field @@ -2055,7 +2053,7 @@ testFail("class C { static #a; #a }", "Identifier '#a' has already been declared // Private Class Method //------------------------------------------------------------------------------ -test("class C { #aaa(){} }", { +test("class C { #aaa(){} }", { "type": "Program", "start": 0, "end": 20, @@ -3484,7 +3482,7 @@ test("class C { #aaa; f() { this.#aaa } }", { "sourceType": "script" }, {ecmaVersion: 13}) -test("class C { #aaa; f(obj) { obj.#aaa } }", { +test("class C { #aaa; f(obj) { obj.#aaa } }", { "type": "Program", "start": 0, "end": 37, @@ -3554,15 +3552,15 @@ test("class C { #aaa; f(obj) { obj.#aaa } }", { "end": 35, "body": [ { - "type": "ExpressionStatement", + "type": "ExpressionStatement", "start": 25, "end": 33, "expression": { - "type": "MemberExpression", + "type": "MemberExpression", "start": 25, "end": 33, "object": { - "type": "Identifier", + "type": "Identifier", "start": 25, "end": 28, "name": "obj" @@ -3658,19 +3656,19 @@ test("class C { #aaa; f(obj) { obj?.#aaa } }", { "end": 36, "body": [ { - "type": "ExpressionStatement", + "type": "ExpressionStatement", "start": 25, "end": 34, "expression": { - "type": "ChainExpression", + "type": "ChainExpression", "start": 25, "end": 34, "expression": { - "type": "MemberExpression", + "type": "MemberExpression", "start": 25, "end": 34, "object": { - "type": "Identifier", + "type": "Identifier", "start": 25, "end": 28, "name": "obj" @@ -3697,7 +3695,7 @@ test("class C { #aaa; f(obj) { obj?.#aaa } }", { "sourceType": "script" }, {ecmaVersion: 13}) -test("class C { #aaa; f(f) { f()?.#aaa } }", { +test("class C { #aaa; f(f) { f()?.#aaa } }", { "type": "Program", "start": 0, "end": 36, @@ -3767,23 +3765,23 @@ test("class C { #aaa; f(f) { f()?.#aaa } }", { "end": 34, "body": [ { - "type": "ExpressionStatement", + "type": "ExpressionStatement", "start": 23, "end": 32, "expression": { - "type": "ChainExpression", + "type": "ChainExpression", "start": 23, "end": 32, "expression": { - "type": "MemberExpression", + "type": "MemberExpression", "start": 23, "end": 32, "object": { - "type": "CallExpression", + "type": "CallExpression", "start": 23, "end": 26, "callee": { - "type": "Identifier", + "type": "Identifier", "start": 23, "end": 24, "name": "f" diff --git a/test/tests-commonjs.js b/test/tests-commonjs.js index 1a8b7d2ab..e9814608c 100644 --- a/test/tests-commonjs.js +++ b/test/tests-commonjs.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; // Top-level using declaration with commonjs test("using x = resource;", { diff --git a/test/tests-directive.js b/test/tests-directive.js index 35e20e8d2..e19548fab 100644 --- a/test/tests-directive.js +++ b/test/tests-directive.js @@ -1,9 +1,5 @@ - -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test; - var testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------ // No directives diff --git a/test/tests-dynamic-import.js b/test/tests-dynamic-import.js index 3224e9239..ca11deb4a 100644 --- a/test/tests-dynamic-import.js +++ b/test/tests-dynamic-import.js @@ -1,9 +1,7 @@ // Tests for ECMAScript 2020 dynamic import -if (typeof exports !== "undefined") { - var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test( "import('dynamicImport.js')", diff --git a/test/tests-es7.js b/test/tests-es7.js index 7608788df..bfaab1c53 100644 --- a/test/tests-es7.js +++ b/test/tests-es7.js @@ -1,9 +1,7 @@ // Tests for ECMAScript 7 syntax changes -if (typeof exports !== "undefined") { - var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test("x **= 42", { type: "Program", diff --git a/test/tests-export-all-as-ns-from-source.js b/test/tests-export-all-as-ns-from-source.js index e0f271036..433ac2501 100644 --- a/test/tests-export-all-as-ns-from-source.js +++ b/test/tests-export-all-as-ns-from-source.js @@ -1,8 +1,5 @@ - -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------------ // export * as ns from "source" diff --git a/test/tests-export-named.js b/test/tests-export-named.js index e2571e019..af35171f1 100644 --- a/test/tests-export-named.js +++ b/test/tests-export-named.js @@ -1,9 +1,7 @@ // Tests for `ExportNamedDeclaration` -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------------ // export {x} from "source" diff --git a/test/tests-harmony.js b/test/tests-harmony.js index dfd1ba117..a0d0a8d3c 100644 --- a/test/tests-harmony.js +++ b/test/tests-harmony.js @@ -29,10 +29,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; /* Tests below were automatically converted from https://github.com/ariya/esprima/blob/2bb17ef9a45c88e82d72c2c61b7b7af93caef028/test/harmonytest.js. diff --git a/test/tests-import-attributes.js b/test/tests-import-attributes.js index 98913f47d..ae98c21c1 100644 --- a/test/tests-import-attributes.js +++ b/test/tests-import-attributes.js @@ -1,9 +1,7 @@ /* eslint quote-props: ["error", "as-needed"] */ /* eslint quotes: ["error", "double", { "avoidEscape": true }] */ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test( 'import json from "./foo.json" with { type: "json" };', diff --git a/test/tests-import-meta.js b/test/tests-import-meta.js index 7c3b9c1df..4d1008622 100644 --- a/test/tests-import-meta.js +++ b/test/tests-import-meta.js @@ -1,9 +1,7 @@ // Tests for ECMAScript 2020 `import.meta` -if (typeof exports !== "undefined") { - var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test( "import.meta", diff --git a/test/tests-json-superset.js b/test/tests-json-superset.js index c6c79e064..cb7379163 100644 --- a/test/tests-json-superset.js +++ b/test/tests-json-superset.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test("'\u2029'", {}, {ecmaVersion: 2019}) test("'\u2028'", {}, {ecmaVersion: 2019}) diff --git a/test/tests-logical-assignment-operators.js b/test/tests-logical-assignment-operators.js index 776085973..aee9d982b 100644 --- a/test/tests-logical-assignment-operators.js +++ b/test/tests-logical-assignment-operators.js @@ -1,9 +1,7 @@ // Tests for ECMAScript 2021 `&&=`, `||=`, `??=` -if (typeof exports !== "undefined") { - var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test( "a &&= b", diff --git a/test/tests-module-string-names.js b/test/tests-module-string-names.js index 5030dbb94..1dbc278b0 100644 --- a/test/tests-module-string-names.js +++ b/test/tests-module-string-names.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test( 'import {"學而時習之,不亦說乎?" as quotation} from "Confucius";', diff --git a/test/tests-nullish-coalescing.js b/test/tests-nullish-coalescing.js index 58fbb0067..7401970af 100644 --- a/test/tests-nullish-coalescing.js +++ b/test/tests-nullish-coalescing.js @@ -1,8 +1,5 @@ - -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test("a ?? b", { "type": "Program", diff --git a/test/tests-numeric-separators.js b/test/tests-numeric-separators.js index 564fc616a..aa7c23f00 100644 --- a/test/tests-numeric-separators.js +++ b/test/tests-numeric-separators.js @@ -1,9 +1,7 @@ // Tests for ECMAScript 2021 Numeric Separators -if (typeof exports !== "undefined") { - var test = require("./driver.js").test; - var testFail = require("./driver.js").testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; function bigint(str) { if (typeof BigInt !== "function") { diff --git a/test/tests-optional-catch-binding.js b/test/tests-optional-catch-binding.js index c7cccf03c..044cf28bf 100644 --- a/test/tests-optional-catch-binding.js +++ b/test/tests-optional-catch-binding.js @@ -1,6 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test("try {} catch {}", { type: "Program", diff --git a/test/tests-optional-chaining.js b/test/tests-optional-chaining.js index f17bde54d..603599f5f 100644 --- a/test/tests-optional-chaining.js +++ b/test/tests-optional-chaining.js @@ -1,8 +1,5 @@ - -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; // Simple test("obj?.foo", { diff --git a/test/tests-regexp-2018.js b/test/tests-regexp-2018.js index baf5d31f1..33fe9d7e8 100644 --- a/test/tests-regexp-2018.js +++ b/test/tests-regexp-2018.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------------ // Named capture groups diff --git a/test/tests-regexp-2020.js b/test/tests-regexp-2020.js index af4a26796..ed1b81720 100644 --- a/test/tests-regexp-2020.js +++ b/test/tests-regexp-2020.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; // https://github.com/tc39/ecma262/pull/1869 testFail("/(?<\\ud835\\udc9c>.)/", "Invalid regular expression: /(?<\\ud835\\udc9c>.)/: Invalid capture group name (1:1)", { ecmaVersion: 2019 }) diff --git a/test/tests-regexp-2022.js b/test/tests-regexp-2022.js index d1768a431..3441006e4 100644 --- a/test/tests-regexp-2022.js +++ b/test/tests-regexp-2022.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; // https://github.com/tc39/ecma262/pull/1713 testFail("/a+(?z)?/d", "Invalid regular expression flag (1:1)", { ecmaVersion: 2021 }) diff --git a/test/tests-regexp-2024.js b/test/tests-regexp-2024.js index dacc631b3..85cd39c00 100644 --- a/test/tests-regexp-2024.js +++ b/test/tests-regexp-2024.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test("/a/v", {}, { ecmaVersion: 2024 }) testFail("/a/v", "Invalid regular expression flag (1:1)", { ecmaVersion: 2023 }) diff --git a/test/tests-regexp-2025.js b/test/tests-regexp-2025.js index 995b90108..e484818b8 100644 --- a/test/tests-regexp-2025.js +++ b/test/tests-regexp-2025.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; // Duplicate named capture groups test("/(?a)|(?b)/", {}, {ecmaVersion: 2025}) diff --git a/test/tests-regexp.js b/test/tests-regexp.js index 514b4aa7d..f21f8dcab 100644 --- a/test/tests-regexp.js +++ b/test/tests-regexp.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test("/foo/", {}, { ecmaVersion: 5 }) test("/foo/", {}, { ecmaVersion: 2015 }) @@ -1349,6 +1347,6 @@ for (const [pattern, message, messageU] of patterns) { } } -require("fs").writeFileSync("a.txt", tests.join("\n")) +fs.writeFileSync("a.txt", tests.join("\n")) */ diff --git a/test/tests-rest-spread-properties.js b/test/tests-rest-spread-properties.js index 9cf4637e3..6bc244f77 100644 --- a/test/tests-rest-spread-properties.js +++ b/test/tests-rest-spread-properties.js @@ -1,8 +1,5 @@ - -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------------ // Spread Properties diff --git a/test/tests-template-literal-revision.js b/test/tests-template-literal-revision.js index c91ce1a88..91961d524 100644 --- a/test/tests-template-literal-revision.js +++ b/test/tests-template-literal-revision.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; test("`foo`", { type: "Program", diff --git a/test/tests-trailing-commas-in-func.js b/test/tests-trailing-commas-in-func.js index b070812bc..28475b996 100644 --- a/test/tests-trailing-commas-in-func.js +++ b/test/tests-trailing-commas-in-func.js @@ -1,8 +1,5 @@ - -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail; -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; //------------------------------------------------------------------------------ // allow diff --git a/test/tests-using.js b/test/tests-using.js index 5726987bf..12cc31016 100644 --- a/test/tests-using.js +++ b/test/tests-using.js @@ -1,7 +1,5 @@ -if (typeof exports !== "undefined") { - var test = require("./driver.js").test - var testFail = require("./driver.js").testFail -} +import { test } from "./driver.js"; +import { testFail } from "./driver.js"; // ============================================================================= // NORMAL CASES - Basic functionality and standard usage patterns @@ -456,7 +454,7 @@ test("function* generator() { using x = resource; yield x; }", { sourceType: "module" }, {ecmaVersion: 17, sourceType: "module"}); -// Using in async generator function +// Using in async generator function test("async function* asyncGenerator() { await using x = resource; yield x; }", { type: "Program", start: 0, @@ -1104,7 +1102,7 @@ testFail("let using x = resource;", "Unexpected token (1:10)", {ecmaVersion: 17, // top level using is not allowed testFail("using x = resource;", "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement (1:0)", {ecmaVersion: 17, sourceType: "script", commonjs: false}); -// BoundNames contains "let" +// BoundNames contains "let" testFail("async function test() { await using let = resource; }", "The keyword 'let' is reserved (1:36)", {ecmaVersion: 17, sourceType: "module"}); // BoundNames contains duplicate entries testFail("async function test() { await using x = resource1, x = resource2; }", "Identifier 'x' has already been declared (1:51)", {ecmaVersion: 17, sourceType: "module"}); @@ -2308,7 +2306,7 @@ test("{ using x = 123n; }", { sourceType: "module" }, {ecmaVersion: 17, sourceType: "module"}); -// ASI (Automatic Semicolon Insertion) test - using without semicolon +// ASI (Automatic Semicolon Insertion) test - using without semicolon test("{ using x = resource\n}", { type: "Program", start: 0, diff --git a/test/tests.js b/test/tests.js index 4e91d7b2c..f6d15fe06 100644 --- a/test/tests.js +++ b/test/tests.js @@ -1,11 +1,9 @@ // Tests largely based on those of Esprima // (http://esprima.org/test/) -if (typeof exports !== "undefined") { - var driver = require("./driver.js"); - var test = driver.test, testFail = driver.testFail, testAssert = driver.testAssert; - var acorn = require("../acorn"); -} +import * as driver from "./driver.js"; +var test = driver.test, testFail = driver.testFail, testAssert = driver.testAssert; +import * as acorn from "../acorn/src/index.js"; test("import ''", { type: "Program",