From a7eee8510cc867371190b8a690d57086f1e09de1 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Sat, 16 Sep 2023 12:04:14 -0700 Subject: [PATCH 1/8] support sdk version wildcard format --- .github/workflows/dart.yml | 20 +- CHANGELOG.md | 5 + README.md | 12 +- action.yml | 9 +- dist/index.mjs | 386 +++++---- dist/main.cjs | 1544 ++++++++++++++++++++++++------------ dist/sig.txt | 2 +- lib/main.dart | 59 +- pubspec.yaml | 1 + 9 files changed, 1320 insertions(+), 718 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 58cbef4..9307b30 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -82,7 +82,25 @@ jobs: - uses: ./ with: sdk: ${{ matrix.sdk }} - architecture: ia32 + + - name: Run hello world + run: | + echo "main() { print('hello world'); }" > hello.dart + dart hello.dart + - run: dart --version + + # Test using wildcard versions for the sdk parameter. + test_release_wildcards: + runs-on: ubuntu-latest + strategy: + matrix: + sdk: [2.19.x, 3.1.x] + fail-fast: false + steps: + - uses: actions/checkout@v3 + - uses: ./ + with: + sdk: ${{ matrix.sdk }} - name: Run hello world run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index f0f6e8d..5e13c35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v1.5.2-wip + +* Add support for specifying a wildcard format for provisioning the latest patch + release of an SDK. + ## v1.5.1 * No longer test the `setup-dart` action on pre-2.12 SDKs. diff --git a/README.md b/README.md index 5767708..8afa828 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,13 @@ jobs: The action takes the following inputs: - * `sdk`: Which SDK version to setup. Can be specified using one of two forms: - * A specific SDK version, e.g. `2.19.0` or `2.12.0-1.4.beta` + * `sdk`: Which SDK version to setup. Can be specified using one of three forms: * A release channel, which will install the latest build from that channel. - Available channels are `stable`, `beta`, `dev`, and `main`. - See the [Dart SDK archive](https://dart.dev/get-dart/archive) for details. + Available channels are `stable`, `beta`, `dev`, and `main`. See the + [Dart SDK archive](https://dart.dev/get-dart/archive) for details. + * A wildcard form for the latest patch release for a specific SDK version. + E.g., `2.19.x` will get the latest patch release for the 2.19 SDK. + * A specific SDK version, e.g. `2.19.0` or `2.12.0-1.4.beta`. * `flavor`: Which build flavor to setup. * The available build flavors are `release` and `raw`. @@ -89,7 +91,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - sdk: [2.18.0, stable, beta, dev] + sdk: [3.1.x, stable, beta, dev] steps: - uses: actions/checkout@v3 - uses: dart-lang/setup-dart@v1 diff --git a/action.yml b/action.yml index 5e51f16..8242d33 100644 --- a/action.yml +++ b/action.yml @@ -6,10 +6,11 @@ branding: inputs: sdk: description: >- - The channel, or a specific version from a channel to install ('stable', - 'beta', 'dev', '2.7.2', '2.12.0-1.4.beta'). Using one of the named - channels instead of a version will give you the latest version published - to that channel. + This can be either the channel to install (i.e., 'stable', 'beta', 'dev'), + a wildcard format for the latest patch release (i.e., `2.19.x`, `3.1.x`), + or a specific sdk version to install (i.e, '2.19.1', '3.0.0-1.4.beta'). + Using one of the named channels instead of a version will give you the + latest version published of that channel. required: false default: "stable" architecture: diff --git a/dist/index.mjs b/dist/index.mjs index 34f9727..00dd09b 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1,7 +1,7 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /******/ var __webpack_modules__ = ({ -/***/ 3551: +/***/ 2690: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; const os = __importStar(__nccwpck_require__(2037)); -const utils_1 = __nccwpck_require__(2139); +const utils_1 = __nccwpck_require__(353); /** * Commands * @@ -99,7 +99,7 @@ function escapeProperty(s) { /***/ }), -/***/ 2606: +/***/ 9935: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -133,12 +133,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(3551); -const file_command_1 = __nccwpck_require__(3682); -const utils_1 = __nccwpck_require__(2139); +const command_1 = __nccwpck_require__(2690); +const file_command_1 = __nccwpck_require__(5898); +const utils_1 = __nccwpck_require__(353); const os = __importStar(__nccwpck_require__(2037)); const path = __importStar(__nccwpck_require__(1017)); -const oidc_utils_1 = __nccwpck_require__(7539); +const oidc_utils_1 = __nccwpck_require__(7901); /** * The code to exit an action */ @@ -423,17 +423,17 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(2586); +var summary_1 = __nccwpck_require__(9050); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(2586); +var summary_2 = __nccwpck_require__(9050); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ -var path_utils_1 = __nccwpck_require__(5228); +var path_utils_1 = __nccwpck_require__(1341); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); @@ -441,7 +441,7 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct /***/ }), -/***/ 3682: +/***/ 5898: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -471,8 +471,8 @@ exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__nccwpck_require__(7147)); const os = __importStar(__nccwpck_require__(2037)); -const uuid_1 = __nccwpck_require__(5941); -const utils_1 = __nccwpck_require__(2139); +const uuid_1 = __nccwpck_require__(1368); +const utils_1 = __nccwpck_require__(353); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -505,7 +505,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 7539: +/***/ 7901: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -520,9 +520,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(4215); -const auth_1 = __nccwpck_require__(885); -const core_1 = __nccwpck_require__(2606); +const http_client_1 = __nccwpck_require__(3658); +const auth_1 = __nccwpck_require__(2660); +const core_1 = __nccwpck_require__(9935); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -588,7 +588,7 @@ exports.OidcClient = OidcClient; /***/ }), -/***/ 5228: +/***/ 1341: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -652,7 +652,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 2586: +/***/ 9050: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -941,7 +941,7 @@ exports.summary = _summary; /***/ }), -/***/ 2139: +/***/ 353: /***/ ((__unused_webpack_module, exports) => { @@ -987,7 +987,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 69: +/***/ 3409: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1022,7 +1022,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; const string_decoder_1 = __nccwpck_require__(1576); -const tr = __importStar(__nccwpck_require__(5029)); +const tr = __importStar(__nccwpck_require__(1139)); /** * Exec a command. * Output will be streamed to the live console. @@ -1096,7 +1096,7 @@ exports.getExecOutput = getExecOutput; /***/ }), -/***/ 5029: +/***/ 1139: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1134,8 +1134,8 @@ const os = __importStar(__nccwpck_require__(2037)); const events = __importStar(__nccwpck_require__(2361)); const child = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); -const io = __importStar(__nccwpck_require__(96)); -const ioUtil = __importStar(__nccwpck_require__(375)); +const io = __importStar(__nccwpck_require__(2725)); +const ioUtil = __importStar(__nccwpck_require__(573)); const timers_1 = __nccwpck_require__(9512); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; @@ -1720,7 +1720,7 @@ class ExecState extends events.EventEmitter { /***/ }), -/***/ 885: +/***/ 2660: /***/ (function(__unused_webpack_module, exports) { @@ -1807,7 +1807,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 4215: +/***/ 3658: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -1844,8 +1844,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; const http = __importStar(__nccwpck_require__(3685)); const https = __importStar(__nccwpck_require__(5687)); -const pm = __importStar(__nccwpck_require__(6695)); -const tunnel = __importStar(__nccwpck_require__(5306)); +const pm = __importStar(__nccwpck_require__(9697)); +const tunnel = __importStar(__nccwpck_require__(7477)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -2418,7 +2418,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 6695: +/***/ 9697: /***/ ((__unused_webpack_module, exports) => { @@ -2449,10 +2449,6 @@ function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; - } const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; @@ -2478,29 +2474,18 @@ function checkBypass(reqUrl) { .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { - if (upperNoProxyItem === '*' || - upperReqHosts.some(x => x === upperNoProxyItem || - x.endsWith(`.${upperNoProxyItem}`) || - (upperNoProxyItem.startsWith('.') && - x.endsWith(`${upperNoProxyItem}`)))) { + if (upperReqHosts.some(x => x === upperNoProxyItem)) { return true; } } return false; } exports.checkBypass = checkBypass; -function isLoopbackAddress(host) { - const hostLower = host.toLowerCase(); - return (hostLower === 'localhost' || - hostLower.startsWith('127.') || - hostLower.startsWith('[::1]') || - hostLower.startsWith('[0:0:0:0:0:0:0:1]')); -} //# sourceMappingURL=proxy.js.map /***/ }), -/***/ 375: +/***/ 573: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -2534,17 +2519,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; const fs = __importStar(__nccwpck_require__(7147)); const path = __importStar(__nccwpck_require__(1017)); -_a = fs.promises -// export const {open} = 'fs' -, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; -// export const {open} = 'fs' +_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; exports.IS_WINDOWS = process.platform === 'win32'; -// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 -exports.UV_FS_O_EXLOCK = 0x10000000; -exports.READONLY = fs.constants.O_RDONLY; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { @@ -2689,7 +2668,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 96: +/***/ 2725: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -2724,8 +2703,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; const assert_1 = __nccwpck_require__(9491); +const childProcess = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); -const ioUtil = __importStar(__nccwpck_require__(375)); +const util_1 = __nccwpck_require__(3837); +const ioUtil = __importStar(__nccwpck_require__(573)); +const exec = util_1.promisify(childProcess.exec); +const execFile = util_1.promisify(childProcess.execFile); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -2806,23 +2789,61 @@ exports.mv = mv; function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { + // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another + // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. // Check for invalid characters // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file if (/[*"<>|]/.test(inputPath)) { throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); } + try { + const cmdPath = ioUtil.getCmdPath(); + if (yield ioUtil.isDirectory(inputPath, true)) { + yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { + env: { inputPath } + }); + } + else { + yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { + env: { inputPath } + }); + } + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + } + // Shelling out fails to remove a symlink folder with missing source, this unlink catches that + try { + yield ioUtil.unlink(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + } } - try { - // note if path does not exist, error is silent - yield ioUtil.rm(inputPath, { - force: true, - maxRetries: 3, - recursive: true, - retryDelay: 300 - }); - } - catch (err) { - throw new Error(`File was unable to be removed ${err}`); + else { + let isDir = false; + try { + isDir = yield ioUtil.isDirectory(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + return; + } + if (isDir) { + yield execFile(`rm`, [`-rf`, `${inputPath}`]); + } + else { + yield ioUtil.unlink(inputPath); + } } }); } @@ -2994,7 +3015,7 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 2033: +/***/ 7936: /***/ (function(module, exports, __nccwpck_require__) { @@ -3028,8 +3049,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._readLinuxVersionFile = exports._getOsVersion = exports._findMatch = void 0; -const semver = __importStar(__nccwpck_require__(537)); -const core_1 = __nccwpck_require__(2606); +const semver = __importStar(__nccwpck_require__(7163)); +const core_1 = __nccwpck_require__(9935); // needs to be require for core node modules to be mocked /* eslint @typescript-eslint/no-require-imports: 0 */ const os = __nccwpck_require__(2037); @@ -3128,7 +3149,7 @@ exports._readLinuxVersionFile = _readLinuxVersionFile; /***/ }), -/***/ 2182: +/***/ 721: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -3162,7 +3183,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RetryHelper = void 0; -const core = __importStar(__nccwpck_require__(2606)); +const core = __importStar(__nccwpck_require__(9935)); /** * Internal class for retries */ @@ -3217,7 +3238,7 @@ exports.RetryHelper = RetryHelper; /***/ }), -/***/ 1994: +/***/ 2275: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -3254,20 +3275,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.evaluateVersions = exports.isExplicitVersion = exports.findFromManifest = exports.getManifestFromRepo = exports.findAllVersions = exports.find = exports.cacheFile = exports.cacheDir = exports.extractZip = exports.extractXar = exports.extractTar = exports.extract7z = exports.downloadTool = exports.HTTPError = void 0; -const core = __importStar(__nccwpck_require__(2606)); -const io = __importStar(__nccwpck_require__(96)); +const core = __importStar(__nccwpck_require__(9935)); +const io = __importStar(__nccwpck_require__(2725)); const fs = __importStar(__nccwpck_require__(7147)); -const mm = __importStar(__nccwpck_require__(2033)); +const mm = __importStar(__nccwpck_require__(7936)); const os = __importStar(__nccwpck_require__(2037)); const path = __importStar(__nccwpck_require__(1017)); -const httpm = __importStar(__nccwpck_require__(4215)); -const semver = __importStar(__nccwpck_require__(537)); +const httpm = __importStar(__nccwpck_require__(3658)); +const semver = __importStar(__nccwpck_require__(7163)); const stream = __importStar(__nccwpck_require__(2781)); const util = __importStar(__nccwpck_require__(3837)); const assert_1 = __nccwpck_require__(9491); -const v4_1 = __importDefault(__nccwpck_require__(6651)); -const exec_1 = __nccwpck_require__(69); -const retry_helper_1 = __nccwpck_require__(2182); +const v4_1 = __importDefault(__nccwpck_require__(4559)); +const exec_1 = __nccwpck_require__(3409); +const retry_helper_1 = __nccwpck_require__(721); class HTTPError extends Error { constructor(httpStatusCode) { super(`Unexpected HTTP response: ${httpStatusCode}`); @@ -3888,7 +3909,7 @@ function _unique(values) { /***/ }), -/***/ 5792: +/***/ 6993: /***/ ((module) => { /** @@ -3921,7 +3942,7 @@ module.exports = bytesToUuid; /***/ }), -/***/ 7553: +/***/ 3480: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Unique ID creation requires a high quality random # generator. In node.js @@ -3936,11 +3957,11 @@ module.exports = function nodeRNG() { /***/ }), -/***/ 6651: +/***/ 4559: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var rng = __nccwpck_require__(7553); -var bytesToUuid = __nccwpck_require__(5792); +var rng = __nccwpck_require__(3480); +var bytesToUuid = __nccwpck_require__(6993); function v4(options, buf, offset) { var i = buf && offset || 0; @@ -3972,7 +3993,7 @@ module.exports = v4; /***/ }), -/***/ 537: +/***/ 7163: /***/ ((module, exports) => { exports = module.exports = SemVer @@ -4003,11 +4024,8 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 -var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 - // The actual regexps go on exports.re var re = exports.re = [] -var safeRe = exports.safeRe = [] var src = exports.src = [] var t = exports.tokens = {} var R = 0 @@ -4016,31 +4034,6 @@ function tok (n) { t[n] = R++ } -var LETTERDASHNUMBER = '[a-zA-Z0-9-]' - -// Replace some greedy regex tokens to prevent regex dos issues. These regex are -// used internally via the safeRe object since all inputs in this library get -// normalized first to trim and collapse all extra whitespace. The original -// regexes are exported for userland consumption and lower level usage. A -// future breaking change could export the safer regex only with a note that -// all input should have extra whitespace removed. -var safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] - -function makeSafeRe (value) { - for (var i = 0; i < safeRegexReplacements.length; i++) { - var token = safeRegexReplacements[i][0] - var max = safeRegexReplacements[i][1] - value = value - .split(token + '*').join(token + '{0,' + max + '}') - .split(token + '+').join(token + '{1,' + max + '}') - } - return value -} - // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. @@ -4050,14 +4043,14 @@ function makeSafeRe (value) { tok('NUMERICIDENTIFIER') src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' +src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' // ## Main Version // Three dot-separated numeric identifiers. @@ -4099,7 +4092,7 @@ src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + // Any combination of digits, letters, or hyphens. tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' +src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata @@ -4179,7 +4172,6 @@ src[t.COERCE] = '(^|[^\\d])' + '(?:$|[^\\d])' tok('COERCERTL') re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') -safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') // Tilde ranges. // Meaning is "reasonably at or greater than" @@ -4189,7 +4181,6 @@ src[t.LONETILDE] = '(?:~>?)' tok('TILDETRIM') src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') -safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') var tildeTrimReplace = '$1~' tok('TILDE') @@ -4205,7 +4196,6 @@ src[t.LONECARET] = '(?:\\^)' tok('CARETTRIM') src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') -safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') var caretTrimReplace = '$1^' tok('CARET') @@ -4227,7 +4217,6 @@ src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + // this one has to use the /g flag re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') -safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` @@ -4256,14 +4245,6 @@ for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) - - // Replace all greedy whitespace to prevent regex dos issues. These regex are - // used internally via the safeRe object since all inputs in this library get - // normalized first to trim and collapse all extra whitespace. The original - // regexes are exported for userland consumption and lower level usage. A - // future breaking change could export the safer regex only with a note that - // all input should have extra whitespace removed. - safeRe[i] = new RegExp(makeSafeRe(src[i])) } } @@ -4288,7 +4269,7 @@ function parse (version, options) { return null } - var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] + var r = options.loose ? re[t.LOOSE] : re[t.FULL] if (!r.test(version)) { return null } @@ -4343,7 +4324,7 @@ function SemVer (version, options) { this.options = options this.loose = !!options.loose - var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) + var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) @@ -4788,7 +4769,6 @@ function Comparator (comp, options) { return new Comparator(comp, options) } - comp = comp.trim().split(/\s+/).join(' ') debug('comparator', comp, options) this.options = options this.loose = !!options.loose @@ -4805,7 +4785,7 @@ function Comparator (comp, options) { var ANY = {} Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] var m = comp.match(r) if (!m) { @@ -4929,16 +4909,9 @@ function Range (range, options) { this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease - // First reduce all whitespace as much as possible so we do not have to rely - // on potentially slow regexes like \s*. This is then stored and used for - // future error messages as well. - this.raw = range - .trim() - .split(/\s+/) - .join(' ') - // First, split based on boolean or || - this.set = this.raw.split('||').map(function (range) { + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason @@ -4946,7 +4919,7 @@ function Range (range, options) { }) if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + this.raw) + throw new TypeError('Invalid SemVer Range: ' + range) } this.format() @@ -4965,19 +4938,20 @@ Range.prototype.toString = function () { Range.prototype.parseRange = function (range) { var loose = this.options.loose + range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] + var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) + range = range.replace(re[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') @@ -4985,7 +4959,7 @@ Range.prototype.parseRange = function (range) { // At this point, the range is completely trimmed and // ready to be split into comparators. - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] + var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) @@ -5085,7 +5059,7 @@ function replaceTildes (comp, options) { } function replaceTilde (comp, options) { - var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] + var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret @@ -5126,7 +5100,7 @@ function replaceCarets (comp, options) { function replaceCaret (comp, options) { debug('caret', comp, options) - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] + var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret @@ -5185,7 +5159,7 @@ function replaceXRanges (comp, options) { function replaceXRange (comp, options) { comp = comp.trim() - var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] + var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) @@ -5260,7 +5234,7 @@ function replaceXRange (comp, options) { function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(safeRe[t.STAR], '') + return comp.trim().replace(re[t.STAR], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) @@ -5586,7 +5560,7 @@ function coerce (version, options) { var match = null if (!options.rtl) { - match = version.match(safeRe[t.COERCE]) + match = version.match(re[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. @@ -5597,17 +5571,17 @@ function coerce (version, options) { // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. var next - while ((next = safeRe[t.COERCERTL].exec(version)) && + while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state - safeRe[t.COERCERTL].lastIndex = -1 + re[t.COERCERTL].lastIndex = -1 } if (match === null) { @@ -5622,15 +5596,15 @@ function coerce (version, options) { /***/ }), -/***/ 5306: +/***/ 7477: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(1998); +module.exports = __nccwpck_require__(8162); /***/ }), -/***/ 1998: +/***/ 8162: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -5901,7 +5875,7 @@ exports.debug = debug; // for test /***/ }), -/***/ 5941: +/***/ 1368: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -5964,29 +5938,29 @@ Object.defineProperty(exports, "parse", ({ } })); -var _v = _interopRequireDefault(__nccwpck_require__(7174)); +var _v = _interopRequireDefault(__nccwpck_require__(3258)); -var _v2 = _interopRequireDefault(__nccwpck_require__(5714)); +var _v2 = _interopRequireDefault(__nccwpck_require__(2559)); -var _v3 = _interopRequireDefault(__nccwpck_require__(6142)); +var _v3 = _interopRequireDefault(__nccwpck_require__(2872)); -var _v4 = _interopRequireDefault(__nccwpck_require__(3946)); +var _v4 = _interopRequireDefault(__nccwpck_require__(5034)); -var _nil = _interopRequireDefault(__nccwpck_require__(9687)); +var _nil = _interopRequireDefault(__nccwpck_require__(6051)); -var _version = _interopRequireDefault(__nccwpck_require__(4312)); +var _version = _interopRequireDefault(__nccwpck_require__(6630)); -var _validate = _interopRequireDefault(__nccwpck_require__(2644)); +var _validate = _interopRequireDefault(__nccwpck_require__(6879)); -var _stringify = _interopRequireDefault(__nccwpck_require__(8551)); +var _stringify = _interopRequireDefault(__nccwpck_require__(2992)); -var _parse = _interopRequireDefault(__nccwpck_require__(1728)); +var _parse = _interopRequireDefault(__nccwpck_require__(3783)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/***/ 7802: +/***/ 1102: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6015,7 +5989,7 @@ exports["default"] = _default; /***/ }), -/***/ 9687: +/***/ 6051: /***/ ((__unused_webpack_module, exports) => { @@ -6029,7 +6003,7 @@ exports["default"] = _default; /***/ }), -/***/ 1728: +/***/ 3783: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6039,7 +6013,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(2644)); +var _validate = _interopRequireDefault(__nccwpck_require__(6879)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6080,7 +6054,7 @@ exports["default"] = _default; /***/ }), -/***/ 808: +/***/ 4557: /***/ ((__unused_webpack_module, exports) => { @@ -6094,7 +6068,7 @@ exports["default"] = _default; /***/ }), -/***/ 406: +/***/ 160: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6124,7 +6098,7 @@ function rng() { /***/ }), -/***/ 2683: +/***/ 4850: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6153,7 +6127,7 @@ exports["default"] = _default; /***/ }), -/***/ 8551: +/***/ 2992: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6163,7 +6137,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(2644)); +var _validate = _interopRequireDefault(__nccwpck_require__(6879)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6198,7 +6172,7 @@ exports["default"] = _default; /***/ }), -/***/ 7174: +/***/ 3258: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6208,9 +6182,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(406)); +var _rng = _interopRequireDefault(__nccwpck_require__(160)); -var _stringify = _interopRequireDefault(__nccwpck_require__(8551)); +var _stringify = _interopRequireDefault(__nccwpck_require__(2992)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6311,7 +6285,7 @@ exports["default"] = _default; /***/ }), -/***/ 5714: +/***/ 2559: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6321,9 +6295,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(1130)); +var _v = _interopRequireDefault(__nccwpck_require__(810)); -var _md = _interopRequireDefault(__nccwpck_require__(7802)); +var _md = _interopRequireDefault(__nccwpck_require__(1102)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6333,7 +6307,7 @@ exports["default"] = _default; /***/ }), -/***/ 1130: +/***/ 810: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6344,9 +6318,9 @@ Object.defineProperty(exports, "__esModule", ({ exports["default"] = _default; exports.URL = exports.DNS = void 0; -var _stringify = _interopRequireDefault(__nccwpck_require__(8551)); +var _stringify = _interopRequireDefault(__nccwpck_require__(2992)); -var _parse = _interopRequireDefault(__nccwpck_require__(1728)); +var _parse = _interopRequireDefault(__nccwpck_require__(3783)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6417,7 +6391,7 @@ function _default(name, version, hashfunc) { /***/ }), -/***/ 6142: +/***/ 2872: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6427,9 +6401,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(406)); +var _rng = _interopRequireDefault(__nccwpck_require__(160)); -var _stringify = _interopRequireDefault(__nccwpck_require__(8551)); +var _stringify = _interopRequireDefault(__nccwpck_require__(2992)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6460,7 +6434,7 @@ exports["default"] = _default; /***/ }), -/***/ 3946: +/***/ 5034: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6470,9 +6444,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(1130)); +var _v = _interopRequireDefault(__nccwpck_require__(810)); -var _sha = _interopRequireDefault(__nccwpck_require__(2683)); +var _sha = _interopRequireDefault(__nccwpck_require__(4850)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6482,7 +6456,7 @@ exports["default"] = _default; /***/ }), -/***/ 2644: +/***/ 6879: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6492,7 +6466,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _regex = _interopRequireDefault(__nccwpck_require__(808)); +var _regex = _interopRequireDefault(__nccwpck_require__(4557)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6505,7 +6479,7 @@ exports["default"] = _default; /***/ }), -/***/ 4312: +/***/ 6630: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -6515,7 +6489,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(2644)); +var _validate = _interopRequireDefault(__nccwpck_require__(6879)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -6651,7 +6625,7 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); /***/ }), -/***/ 3247: +/***/ 8405: /***/ ((__webpack_module__, __unused_webpack___webpack_exports__, __nccwpck_require__) => { var _actions_core__WEBPACK_IMPORTED_MODULE_0___namespace_cache; @@ -6661,10 +6635,10 @@ var fs__WEBPACK_IMPORTED_MODULE_4___namespace_cache; var os__WEBPACK_IMPORTED_MODULE_6___namespace_cache; var process__WEBPACK_IMPORTED_MODULE_7___namespace_cache; __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { -/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(2606); -/* harmony import */ var _actions_exec__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(69); -/* harmony import */ var _actions_http_client__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(4215); -/* harmony import */ var _actions_tool_cache__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(1994); +/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(9935); +/* harmony import */ var _actions_exec__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(3409); +/* harmony import */ var _actions_http_client__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(3658); +/* harmony import */ var _actions_tool_cache__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(2275); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(7147); /* harmony import */ var module__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(8188); /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(2037); @@ -6885,6 +6859,6 @@ __webpack_async_result__(); /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module used 'module' so it can't be inlined -/******/ var __webpack_exports__ = __nccwpck_require__(3247); +/******/ var __webpack_exports__ = __nccwpck_require__(8405); /******/ __webpack_exports__ = await __webpack_exports__; /******/ diff --git a/dist/main.cjs b/dist/main.cjs index 9d03a72..8ea91a8 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -1,4 +1,4 @@ -// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.2.0-140.0.dev. +// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.2.0-170.0.dev. // The code supports the following hooks: // dartPrint(message): // if this function is defined it is called instead of the Dart [print] @@ -236,81 +236,429 @@ typesOffset = init.types.length; hunk(hunkHelpers, init, holders, $); } - var A = {JS_CONST: function JS_CONST() { + var J = { + makeDispatchRecord(interceptor, proto, extension, indexability) { + return {i: interceptor, p: proto, e: extension, x: indexability}; }, - hexDigitValue(char) { - var letter, - digit = char ^ 48; - if (digit <= 9) - return digit; - letter = char | 32; - if (97 <= letter && letter <= 102) - return letter - 87; - return -1; + getNativeInterceptor(object) { + var proto, objectProto, $constructor, interceptor, t1, + record = object[init.dispatchPropertyName]; + if (record == null) + if ($.initNativeDispatchFlag == null) { + A.initNativeDispatch(); + record = object[init.dispatchPropertyName]; + } + if (record != null) { + proto = record.p; + if (false === proto) + return record.i; + if (true === proto) + return object; + objectProto = Object.getPrototypeOf(object); + if (proto === objectProto) + return record.i; + if (record.e === objectProto) + throw A.wrapException(A.UnimplementedError$("Return interceptor for " + A.S(proto(object, record)))); + } + $constructor = object.constructor; + if ($constructor == null) + interceptor = null; + else { + t1 = $._JS_INTEROP_INTERCEPTOR_TAG; + if (t1 == null) + t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); + interceptor = $constructor[t1]; + } + if (interceptor != null) + return interceptor; + interceptor = A.lookupAndCacheInterceptor(object); + if (interceptor != null) + return interceptor; + if (typeof object == "function") + return B.JavaScriptFunction_methods; + proto = Object.getPrototypeOf(object); + if (proto == null) + return B.PlainJavaScriptObject_methods; + if (proto === Object.prototype) + return B.PlainJavaScriptObject_methods; + if (typeof $constructor == "function") { + t1 = $._JS_INTEROP_INTERCEPTOR_TAG; + if (t1 == null) + t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); + Object.defineProperty($constructor, t1, {value: B.UnknownJavaScriptObject_methods, enumerable: false, writable: true, configurable: true}); + return B.UnknownJavaScriptObject_methods; + } + return B.UnknownJavaScriptObject_methods; }, - checkNotNullable(value, $name, $T) { - return value; + JSArray_JSArray$fixed($length, $E) { + if ($length < 0 || $length > 4294967295) + throw A.wrapException(A.RangeError$range($length, 0, 4294967295, "length", null)); + return J.JSArray_JSArray$markFixed(new Array($length), $E); }, - isToStringVisiting(object) { - var t1, i; - for (t1 = $.toStringVisiting.length, i = 0; i < t1; ++i) - if (object === $.toStringVisiting[i]) + JSArray_JSArray$growable($length, $E) { + if ($length < 0) + throw A.wrapException(A.ArgumentError$("Length must be a non-negative integer: " + $length, null)); + return A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")); + }, + JSArray_JSArray$markFixed(allocation, $E) { + return J.JSArray_markFixedList(A._setArrayType(allocation, $E._eval$1("JSArray<0>")), $E); + }, + JSArray_markFixedList(list, $T) { + list.fixed$length = Array; + return list; + }, + JSArray__compareAny(a, b) { + var t1 = type$.Comparable_dynamic; + return J.compareTo$1$ns(t1._as(a), t1._as(b)); + }, + JSString__isWhitespace(codeUnit) { + if (codeUnit < 256) + switch (codeUnit) { + case 9: + case 10: + case 11: + case 12: + case 13: + case 32: + case 133: + case 160: + return true; + default: + return false; + } + switch (codeUnit) { + case 5760: + case 8192: + case 8193: + case 8194: + case 8195: + case 8196: + case 8197: + case 8198: + case 8199: + case 8200: + case 8201: + case 8202: + case 8232: + case 8233: + case 8239: + case 8287: + case 12288: + case 65279: return true; - return false; + default: + return false; + } }, - SubListIterable$(_iterable, _start, _endOrLength, $E) { - A.RangeError_checkNotNegative(_start, "start"); - if (_endOrLength != null) { - A.RangeError_checkNotNegative(_endOrLength, "end"); - if (_start > _endOrLength) - A.throwExpression(A.RangeError$range(_start, 0, _endOrLength, "start", null)); + JSString__skipLeadingWhitespace(string, index) { + var t1, codeUnit; + for (t1 = string.length; index < t1;) { + codeUnit = string.charCodeAt(index); + if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) + break; + ++index; } - return new A.SubListIterable(_iterable, _start, _endOrLength, $E._eval$1("SubListIterable<0>")); + return index; }, - MappedIterable_MappedIterable(iterable, $function, $S, $T) { - if (type$.EfficientLengthIterable_dynamic._is(iterable)) - return new A.EfficientLengthMappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); - return new A.MappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("MappedIterable<1,2>")); + JSString__skipTrailingWhitespace(string, index) { + var t1, index0, codeUnit; + for (t1 = string.length; index > 0; index = index0) { + index0 = index - 1; + if (!(index0 < t1)) + return A.ioore(string, index0); + codeUnit = string.charCodeAt(index0); + if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) + break; + } + return index; }, - IterableElementError_noElement() { - return new A.StateError("No element"); + getInterceptor$(receiver) { + if (typeof receiver == "number") { + if (Math.floor(receiver) == receiver) + return J.JSInt.prototype; + return J.JSNumNotInt.prototype; + } + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return J.JSNull.prototype; + if (typeof receiver == "boolean") + return J.JSBool.prototype; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); }, - LateError: function LateError(t0) { - this.__internal$_message = t0; + getInterceptor$asx(receiver) { + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); }, - CodeUnits: function CodeUnits(t0) { - this.__internal$_string = t0; + getInterceptor$ax(receiver) { + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); }, - EfficientLengthIterable: function EfficientLengthIterable() { + getInterceptor$ns(receiver) { + if (typeof receiver == "number") + return J.JSNumber.prototype; + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; }, - ListIterable: function ListIterable() { + getInterceptor$s(receiver) { + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; }, - SubListIterable: function SubListIterable(t0, t1, t2, t3) { - var _ = this; - _.__internal$_iterable = t0; - _._start = t1; - _._endOrLength = t2; - _.$ti = t3; + get$hashCode$(receiver) { + return J.getInterceptor$(receiver).get$hashCode(receiver); }, - ListIterator: function ListIterator(t0, t1, t2) { - var _ = this; - _.__internal$_iterable = t0; - _.__internal$_length = t1; - _.__internal$_index = 0; - _.__internal$_current = null; - _.$ti = t2; + get$iterator$ax(receiver) { + return J.getInterceptor$ax(receiver).get$iterator(receiver); }, - MappedIterable: function MappedIterable(t0, t1, t2) { - this.__internal$_iterable = t0; - this._f = t1; - this.$ti = t2; + get$length$asx(receiver) { + return J.getInterceptor$asx(receiver).get$length(receiver); }, - EfficientLengthMappedIterable: function EfficientLengthMappedIterable(t0, t1, t2) { - this.__internal$_iterable = t0; - this._f = t1; - this.$ti = t2; + get$runtimeType$(receiver) { + return J.getInterceptor$(receiver).get$runtimeType(receiver); }, - MappedIterator: function MappedIterator(t0, t1, t2) { + $eq$(receiver, a0) { + if (receiver == null) + return a0 == null; + if (typeof receiver != "object") + return a0 != null && receiver === a0; + return J.getInterceptor$(receiver).$eq(receiver, a0); + }, + $index$asx(receiver, a0) { + if (typeof a0 === "number") + if (Array.isArray(receiver) || typeof receiver == "string" || A.isJsIndexable(receiver, receiver[init.dispatchPropertyName])) + if (a0 >>> 0 === a0 && a0 < receiver.length) + return receiver[a0]; + return J.getInterceptor$asx(receiver).$index(receiver, a0); + }, + $indexSet$ax(receiver, a0, a1) { + return J.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1); + }, + allMatches$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).allMatches$1(receiver, a0); + }, + cast$1$0$ax(receiver, $T1) { + return J.getInterceptor$ax(receiver).cast$1$0(receiver, $T1); + }, + codeUnitAt$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).codeUnitAt$1(receiver, a0); + }, + compareTo$1$ns(receiver, a0) { + return J.getInterceptor$ns(receiver).compareTo$1(receiver, a0); + }, + contains$1$asx(receiver, a0) { + return J.getInterceptor$asx(receiver).contains$1(receiver, a0); + }, + elementAt$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).elementAt$1(receiver, a0); + }, + endsWith$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).endsWith$1(receiver, a0); + }, + map$1$1$ax(receiver, a0, $T1) { + return J.getInterceptor$ax(receiver).map$1$1(receiver, a0, $T1); + }, + substring$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).substring$2(receiver, a0, a1); + }, + toString$0$(receiver) { + return J.getInterceptor$(receiver).toString$0(receiver); + }, + Interceptor: function Interceptor() { + }, + JSBool: function JSBool() { + }, + JSNull: function JSNull() { + }, + JavaScriptObject: function JavaScriptObject() { + }, + LegacyJavaScriptObject: function LegacyJavaScriptObject() { + }, + PlainJavaScriptObject: function PlainJavaScriptObject() { + }, + UnknownJavaScriptObject: function UnknownJavaScriptObject() { + }, + JavaScriptFunction: function JavaScriptFunction() { + }, + JavaScriptBigInt: function JavaScriptBigInt() { + }, + JavaScriptSymbol: function JavaScriptSymbol() { + }, + JSArray: function JSArray(t0) { + this.$ti = t0; + }, + JSUnmodifiableArray: function JSUnmodifiableArray(t0) { + this.$ti = t0; + }, + ArrayIterator: function ArrayIterator(t0, t1, t2) { + var _ = this; + _._iterable = t0; + _._length = t1; + _._index = 0; + _._current = null; + _.$ti = t2; + }, + JSNumber: function JSNumber() { + }, + JSInt: function JSInt() { + }, + JSNumNotInt: function JSNumNotInt() { + }, + JSString: function JSString() { + } + }, + A = {JS_CONST: function JS_CONST() { + }, + CastIterable_CastIterable(source, $S, $T) { + if ($S._eval$1("EfficientLengthIterable<0>")._is(source)) + return new A._EfficientLengthCastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("_EfficientLengthCastIterable<1,2>")); + return new A.CastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("CastIterable<1,2>")); + }, + hexDigitValue(char) { + var letter, + digit = char ^ 48; + if (digit <= 9) + return digit; + letter = char | 32; + if (97 <= letter && letter <= 102) + return letter - 87; + return -1; + }, + checkNotNullable(value, $name, $T) { + return value; + }, + isToStringVisiting(object) { + var t1, i; + for (t1 = $.toStringVisiting.length, i = 0; i < t1; ++i) + if (object === $.toStringVisiting[i]) + return true; + return false; + }, + SubListIterable$(_iterable, _start, _endOrLength, $E) { + A.RangeError_checkNotNegative(_start, "start"); + if (_endOrLength != null) { + A.RangeError_checkNotNegative(_endOrLength, "end"); + if (_start > _endOrLength) + A.throwExpression(A.RangeError$range(_start, 0, _endOrLength, "start", null)); + } + return new A.SubListIterable(_iterable, _start, _endOrLength, $E._eval$1("SubListIterable<0>")); + }, + MappedIterable_MappedIterable(iterable, $function, $S, $T) { + if (type$.EfficientLengthIterable_dynamic._is(iterable)) + return new A.EfficientLengthMappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); + return new A.MappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("MappedIterable<1,2>")); + }, + IterableElementError_noElement() { + return new A.StateError("No element"); + }, + _CastIterableBase: function _CastIterableBase() { + }, + CastIterator: function CastIterator(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + CastIterable: function CastIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + _EfficientLengthCastIterable: function _EfficientLengthCastIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + _CastListBase: function _CastListBase() { + }, + CastList: function CastList(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + LateError: function LateError(t0) { + this.__internal$_message = t0; + }, + CodeUnits: function CodeUnits(t0) { + this.__internal$_string = t0; + }, + EfficientLengthIterable: function EfficientLengthIterable() { + }, + ListIterable: function ListIterable() { + }, + SubListIterable: function SubListIterable(t0, t1, t2, t3) { + var _ = this; + _.__internal$_iterable = t0; + _._start = t1; + _._endOrLength = t2; + _.$ti = t3; + }, + ListIterator: function ListIterator(t0, t1, t2) { + var _ = this; + _.__internal$_iterable = t0; + _.__internal$_length = t1; + _.__internal$_index = 0; + _.__internal$_current = null; + _.$ti = t2; + }, + MappedIterable: function MappedIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + EfficientLengthMappedIterable: function EfficientLengthMappedIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + MappedIterator: function MappedIterator(t0, t1, t2) { var _ = this; _.__internal$_current = null; _._iterator = t0; @@ -346,6 +694,8 @@ }, UnmodifiableListBase: function UnmodifiableListBase() { }, + __CastListBase__CastIterableBase_ListMixin: function __CastListBase__CastIterableBase_ListMixin() { + }, unminifyOrTag(rawClassName) { var preserved = init.mangledGlobalNames[rawClassName]; if (preserved != null) @@ -1375,6 +1725,12 @@ var future = rti._precomputed1; return future == null ? rti._precomputed1 = A._Universe__lookupInterfaceRti(universe, "Future", [rti._primary]) : future; }, + Rti__getIsSubtypeCache(rti) { + var probe = rti._isSubtypeCache; + if (probe != null) + return probe; + return rti._isSubtypeCache = new Map(); + }, Rti__isUnionOfFunctionType(rti) { var kind = rti._kind; if (kind === 6 || kind === 7 || kind === 8) @@ -1698,7 +2054,7 @@ var testRti = this; if (object == null) return A._nullIs(testRti); - return A._isSubtype(init.typeUniverse, A.instanceOrFunctionType(object, testRti), null, testRti, null); + return A.isSubtype(init.typeUniverse, A.instanceOrFunctionType(object, testRti), testRti); }, _generalNullableIsTestImplementation(object) { if (object == null) @@ -2657,6 +3013,16 @@ return typeArguments[index - 1]; throw A.wrapException(A.AssertionError$("Bad index " + index + " for " + environment.toString$0(0))); }, + isSubtype(universe, s, t) { + var result, + sCache = A.Rti__getIsSubtypeCache(s), + probe = sCache.get(t); + if (probe != null) + return probe; + result = A._isSubtype(universe, s, null, t, null); + sCache.set(t, result); + return result; + }, _isSubtype(universe, s, sEnv, t, tEnv) { var t1, sKind, leftTypeVariable, tKind, t2, sBounds, tBounds, sLength, i, sBound, tBound; if (s === t) @@ -2935,7 +3301,7 @@ var _ = this; _._as = t0; _._is = t1; - _._cachedRuntimeType = _._specializedTestResource = _._precomputed1 = null; + _._cachedRuntimeType = _._specializedTestResource = _._unsoundIsSubtypeCache = _._isSubtypeCache = _._precomputed1 = null; _._kind = 0; _._canonicalRecipe = _._bindCache = _._evalCache = _._rest = _._primary = null; }, @@ -3613,12 +3979,10 @@ throw A.wrapException("unreachable"); }, List_List$filled($length, fill, growable, $E) { - var result, t1, i; - if ($length > 4294967295) - A.throwExpression(A.RangeError$range($length, 0, 4294967295, "length", null)); - result = J.JSArray_markFixedList(A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")), $E); + var i, + result = growable ? J.JSArray_JSArray$growable($length, $E) : J.JSArray_JSArray$fixed($length, $E); if ($length !== 0 && fill != null) - for (t1 = result.length, i = 0; i < t1; ++i) + for (i = 0; i < result.length; ++i) result[i] = fill; return result; }, @@ -3631,6 +3995,17 @@ return list; return J.JSArray_markFixedList(list, $E); }, + List_List$of(elements, growable, $E) { + var t1 = A.List_List$_of(elements, $E); + return t1; + }, + List_List$_of(elements, $E) { + var t1, + list = A._setArrayType([], $E._eval$1("JSArray<0>")); + for (t1 = elements.get$iterator(elements); t1.moveNext$0();) + B.JSArray_methods.add$1(list, t1.get$current()); + return list; + }, List_List$unmodifiable(elements, $E) { var result = A.List_List$from(elements, false, $E); result.fixed$length = Array; @@ -5180,6 +5555,12 @@ NullRejectionException: function NullRejectionException(t0) { this.isUndefined = t0; }, + DefaultEquality: function DefaultEquality(t0) { + this.$ti = t0; + }, + IterableEquality: function IterableEquality(t0) { + this.$ti = t0; + }, _validateArgList(method, args) { var numArgs, i, numArgs0, message, t1, t2, t3, t4; for (numArgs = args.length, i = 1; i < numArgs; ++i) { @@ -5344,43 +5725,77 @@ _.rootPattern = t2; _.relativeRootPattern = t3; }, - throwLateFieldADI(fieldName) { - A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has been assigned during initialization."), new Error()); + Version___parse_tearOff(text) { + return A.Version_Version$parse(A._asString(text)); }, - join(part1, part2) { - var t1 = $.$get$context(), - parts = A._setArrayType([part1, part2, null, null, null, null, null, null, null, null, null, null, null, null, null, null], type$.JSArray_nullable_String); - A._validateArgList("join", parts); - return t1.joinAll$1(new A.WhereTypeIterable(parts, type$.WhereTypeIterable_String)); + Version_Version$parse(text) { + var major, minor, patch, preRelease, build, t1, t2, t3, t4, t5, exception, _null = null, + _s17_ = 'Could not parse "', + match = $.$get$completeVersion().firstMatch$1(text); + if (match == null) + throw A.wrapException(A.FormatException$(_s17_ + text + '".', _null, _null)); + try { + t1 = match._match; + if (1 >= t1.length) + return A.ioore(t1, 1); + t1 = t1[1]; + t1.toString; + major = A.int_parse(t1, _null); + t1 = match._match; + if (2 >= t1.length) + return A.ioore(t1, 2); + t1 = t1[2]; + t1.toString; + minor = A.int_parse(t1, _null); + t1 = match._match; + if (3 >= t1.length) + return A.ioore(t1, 3); + t1 = t1[3]; + t1.toString; + patch = A.int_parse(t1, _null); + t1 = match._match; + if (5 >= t1.length) + return A.ioore(t1, 5); + preRelease = t1[5]; + t1 = match._match; + if (8 >= t1.length) + return A.ioore(t1, 8); + build = t1[8]; + t1 = major; + t2 = minor; + t3 = patch; + t4 = preRelease; + t5 = build; + t4 = t4 == null ? A._setArrayType([], type$.JSArray_Object) : A.Version__splitParts(t4); + t5 = t5 == null ? A._setArrayType([], type$.JSArray_Object) : A.Version__splitParts(t5); + if (t1 < 0) + A.throwExpression(A.ArgumentError$("Major version must be non-negative.", _null)); + if (t2 < 0) + A.throwExpression(A.ArgumentError$("Minor version must be non-negative.", _null)); + if (t3 < 0) + A.throwExpression(A.ArgumentError$("Patch version must be non-negative.", _null)); + return new A.Version(t1, t2, t3, t4, t5, text); + } catch (exception) { + if (A.unwrapException(exception) instanceof A.FormatException) + throw A.wrapException(A.FormatException$(_s17_ + text + '".', _null, _null)); + else + throw exception; + } }, - isAlphabetic(char) { - var t1; - if (!(char >= 65 && char <= 90)) - t1 = char >= 97 && char <= 122; - else - t1 = true; - return t1; + Version__splitParts(text) { + var t1 = type$.MappedListIterable_String_Object; + return A.List_List$of(new A.MappedListIterable(A._setArrayType(text.split("."), type$.JSArray_String), type$.Object_Function_String._as(new A.Version__splitParts_closure()), t1), true, t1._eval$1("ListIterable.E")); }, - isDriveLetter(path, index) { - var t3, - t1 = path.length, - t2 = index + 2; - if (t1 < t2) - return false; - if (!(index >= 0 && index < t1)) - return A.ioore(path, index); - if (!A.isAlphabetic(path.charCodeAt(index))) - return false; - t3 = index + 1; - if (!(t3 < t1)) - return A.ioore(path, t3); - if (path.charCodeAt(t3) !== 58) - return false; - if (t1 === t2) - return true; - if (!(t2 >= 0 && t2 < t1)) - return A.ioore(path, t2); - return path.charCodeAt(t2) === 47; + Version: function Version(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.major = t0; + _.minor = t1; + _.patch = t2; + _.preRelease = t3; + _.build = t4; + _._version$_text = t5; + }, + Version__splitParts_closure: function Version__splitParts_closure() { }, main(args) { return A.main$body(args); @@ -5388,7 +5803,7 @@ main$body(args) { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.dynamic), - $async$returnValue, $async$handler = 2, $async$currentError, sdk, flavor, raw, os, architecture, version, channel, url, toolName, sdkPath, archivePath, extractedFolder, pubCache, error, t1, t2, exception, t3, t4, versionFilePath, $async$exception, $async$exception1; + $async$returnValue, $async$handler = 2, $async$currentError, sdk, flavor, raw, os, architecture, version, channel, versionPrefix, url, toolName, sdkPath, archivePath, extractedFolder, pubCache, error, t1, t2, exception, version0, t3, t4, versionFilePath, $async$exception, $async$exception1; var $async$main = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$currentError = $async$result; @@ -5420,67 +5835,89 @@ architecture = B.JSArray_methods.contains$1(B.List_x64_ia32_arm_arm64, A._asString(t2._as(t1.os).arch())) ? A._asString(t2._as(t1.os).arch()) : "x64"; version = null; channel = null; - $async$goto = J.$eq$(sdk, "stable") || J.$eq$(sdk, "beta") || J.$eq$(sdk, "dev") ? 7 : 9; + $async$goto = J.endsWith$1$s(sdk, ".x") ? 7 : 9; break; case 7: + // then + channel = "stable"; + versionPrefix = J.substring$2$s(sdk, 0, J.get$length$asx(sdk) - 2); + $async$goto = 10; + return A._asyncAwait(A.findLatestSdkForRelease(versionPrefix), $async$main); + case 10: + // returning from await. + version = $async$result; + // goto join + $async$goto = 8; + break; + case 9: + // else + $async$goto = J.$eq$(sdk, "stable") || J.$eq$(sdk, "beta") || J.$eq$(sdk, "dev") ? 11 : 13; + break; + case 11: // then channel = sdk; - $async$goto = A.boolConversionCheck(raw) ? 10 : 12; + $async$goto = A.boolConversionCheck(raw) ? 14 : 16; break; - case 10: + case 14: // then $async$result = "latest"; // goto join - $async$goto = 11; + $async$goto = 15; break; - case 12: + case 16: // else - $async$goto = 13; + $async$goto = 17; return A._asyncAwait(A.latestPublishedVersion(channel, flavor), $async$main); - case 13: + case 17: // returning from await. - case 11: + case 15: // join version = $async$result; // goto join - $async$goto = 8; + $async$goto = 12; break; - case 9: + case 13: // else - $async$goto = J.$eq$(sdk, "main") ? 14 : 16; + $async$goto = J.$eq$(sdk, "main") ? 18 : 20; break; - case 14: + case 18: // then - $async$handler = 18; + $async$handler = 22; channel = "main"; - $async$goto = 21; + $async$goto = 25; return A._asyncAwait(A.latestPublishedVersion(channel, flavor), $async$main); - case 21: + case 25: // returning from await. + version = $async$result; $async$handler = 4; // goto after finally - $async$goto = 20; + $async$goto = 24; break; - case 18: + case 22: // catch - $async$handler = 17; + $async$handler = 21; $async$exception = $async$currentError; channel = "be"; + $async$goto = 26; + return A._asyncAwait(A.latestPublishedVersion(channel, flavor), $async$main); + case 26: + // returning from await. + version0 = $async$result; + version = version0; // goto after finally - $async$goto = 20; + $async$goto = 24; break; - case 17: + case 21: // uncaught // goto catch $async$goto = 4; break; - case 20: + case 24: // after finally - version = "latest"; // goto join - $async$goto = 15; + $async$goto = 19; break; - case 16: + case 20: // else version = sdk; if (J.contains$1$asx(sdk, "dev")) @@ -5494,7 +5931,9 @@ break; } else channel = "stable"; - case 15: + case 19: + // join + case 12: // join case 8: // join @@ -5502,35 +5941,35 @@ url = string$.https_ + A.S(channel) + "/" + A.S(flavor) + "/" + A.S(version) + "/sdk/dartsdk-" + A.S(os) + "-" + A.S(architecture) + "-release.zip"; toolName = A.boolConversionCheck(raw) ? "dart_raw" : "dart"; sdkPath = !A.boolConversionCheck(raw) ? A._asString(t2._as(t1.toolCache).find(toolName, version, architecture)) : ""; - $async$goto = J.get$length$asx(sdkPath) !== 0 ? 22 : 24; + $async$goto = J.get$length$asx(sdkPath) !== 0 ? 27 : 29; break; - case 22: + case 27: // then t2._as(t1.core).info("Using cached sdk from " + A.S(sdkPath) + "."); // goto join - $async$goto = 23; + $async$goto = 28; break; - case 24: + case 29: // else t2._as(t1.core).info(A.S(url) + " ..."); t3 = type$.String; - $async$goto = 25; + $async$goto = 30; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).downloadTool(url)), t3), $async$main); - case 25: + case 30: // returning from await. archivePath = $async$result; - $async$goto = 26; + $async$goto = 31; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).extractZip(archivePath)), t3), $async$main); - case 26: + case 31: // returning from await. extractedFolder = $async$result; extractedFolder = A.join(extractedFolder, "dart-sdk"); - $async$goto = 27; + $async$goto = 32; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).cacheDir(extractedFolder, toolName, version, architecture)), t3), $async$main); - case 27: + case 32: // returning from await. sdkPath = $async$result; - case 23: + case 28: // join t3 = t2._as(t1.process); t4 = J.$eq$(os, "windows") ? "USERPROFILE" : "HOME"; @@ -5541,19 +5980,16 @@ t2._as(t1.core).addPath(A.join(sdkPath, "bin")); t2._as(t1.core).exportVariable("PUB_CACHE", pubCache); t2._as(t1.core).addPath(A.join(pubCache, "bin")); - $async$goto = 28; + $async$goto = 33; return A._asyncAwait(A.createPubOIDCToken(), $async$main); - case 28: + case 33: // returning from await. - if (A.boolConversionCheck(raw)) { - t3 = t2._as(t1.core); - versionFilePath = A.join(sdkPath, "version"); - t3.setOutput("dart-version", B.JSString_methods.trim$0(A._asString(t2._as(t1.fs).readFileSync(versionFilePath, "utf8")))); - } else - t2._as(t1.core).setOutput("dart-version", version); - $async$goto = 29; + t4 = t2._as(t1.core); + versionFilePath = A.join(sdkPath, "version"); + t4.setOutput("dart-version", B.JSString_methods.trim$0(A._asString(t2._as(t1.fs).readFileSync(versionFilePath, "utf8")))); + $async$goto = 34; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["--version"], type$.JSArray_String))), type$.dynamic), $async$main); - case 29: + case 34: // returning from await. $async$handler = 2; // goto after finally @@ -5618,329 +6054,135 @@ t2 = type$.JSObject; tokenRequestUrl = A._asStringQ(t2._as(t2._as(t1.process).env).ACTIONS_ID_TOKEN_REQUEST_URL); tokenRequestToken = A._asStringQ(t2._as(t2._as(t1.process).env).ACTIONS_ID_TOKEN_REQUEST_TOKEN); - if (tokenRequestUrl == null || tokenRequestToken == null) { - // goto return - $async$goto = 1; - break; - } - $async$goto = 3; - return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.core).getIDToken("https://pub.dev")), type$.String), $async$createPubOIDCToken); - case 3: - // returning from await. - token = $async$result; - t2._as(t1.core).exportVariable("PUB_TOKEN", token); - $async$goto = 4; - return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["pub", "token", "add", "https://pub.dev", "--env-var", "PUB_TOKEN"], type$.JSArray_String))), type$.dynamic), $async$createPubOIDCToken); - case 4: - // returning from await. - case 1: - // return - return A._asyncReturn($async$returnValue, $async$completer); - } - }); - return A._asyncStartSync($async$createPubOIDCToken, $async$completer); - }, - latestPublishedVersion(channel, flavor) { - var $async$goto = 0, - $async$completer = A._makeAsyncAwaitCompleter(type$.String), - $async$returnValue, t1, $async$temp1, $async$temp2; - var $async$latestPublishedVersion = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { - if ($async$errorCode === 1) - return A._asyncRethrow($async$result, $async$completer); - while (true) - switch ($async$goto) { - case 0: - // Function start - t1 = type$.JSObject; - $async$temp1 = type$.FutureOr_String; - $async$temp2 = t1; - $async$goto = 3; - return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(new self.HttpClient("setup-dart", A._setArrayType([], type$.JSArray_Object), type$.nullable_JSObject._as(A.jsify(A.LinkedHashMap_LinkedHashMap$_literal(["allowRedirects", true, "maxRedirects", 3, "allowRetries", true, "maxRetries", 3], type$.String, type$.Object))))).getJson(string$.https_ + channel + "/" + flavor + "/latest/VERSION")), t1), $async$latestPublishedVersion); - case 3: - // returning from await. - $async$returnValue = $async$temp1._as($async$temp2._as($async$result.result).version); - // goto return - $async$goto = 1; - break; - case 1: - // return - return A._asyncReturn($async$returnValue, $async$completer); - } - }); - return A._asyncStartSync($async$latestPublishedVersion, $async$completer); - } - }, - J = { - makeDispatchRecord(interceptor, proto, extension, indexability) { - return {i: interceptor, p: proto, e: extension, x: indexability}; - }, - getNativeInterceptor(object) { - var proto, objectProto, $constructor, interceptor, t1, - record = object[init.dispatchPropertyName]; - if (record == null) - if ($.initNativeDispatchFlag == null) { - A.initNativeDispatch(); - record = object[init.dispatchPropertyName]; - } - if (record != null) { - proto = record.p; - if (false === proto) - return record.i; - if (true === proto) - return object; - objectProto = Object.getPrototypeOf(object); - if (proto === objectProto) - return record.i; - if (record.e === objectProto) - throw A.wrapException(A.UnimplementedError$("Return interceptor for " + A.S(proto(object, record)))); - } - $constructor = object.constructor; - if ($constructor == null) - interceptor = null; - else { - t1 = $._JS_INTEROP_INTERCEPTOR_TAG; - if (t1 == null) - t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); - interceptor = $constructor[t1]; - } - if (interceptor != null) - return interceptor; - interceptor = A.lookupAndCacheInterceptor(object); - if (interceptor != null) - return interceptor; - if (typeof object == "function") - return B.JavaScriptFunction_methods; - proto = Object.getPrototypeOf(object); - if (proto == null) - return B.PlainJavaScriptObject_methods; - if (proto === Object.prototype) - return B.PlainJavaScriptObject_methods; - if (typeof $constructor == "function") { - t1 = $._JS_INTEROP_INTERCEPTOR_TAG; - if (t1 == null) - t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); - Object.defineProperty($constructor, t1, {value: B.UnknownJavaScriptObject_methods, enumerable: false, writable: true, configurable: true}); - return B.UnknownJavaScriptObject_methods; - } - return B.UnknownJavaScriptObject_methods; - }, - JSArray_markFixedList(list, $T) { - list.fixed$length = Array; - return list; - }, - JSString__isWhitespace(codeUnit) { - if (codeUnit < 256) - switch (codeUnit) { - case 9: - case 10: - case 11: - case 12: - case 13: - case 32: - case 133: - case 160: - return true; - default: - return false; - } - switch (codeUnit) { - case 5760: - case 8192: - case 8193: - case 8194: - case 8195: - case 8196: - case 8197: - case 8198: - case 8199: - case 8200: - case 8201: - case 8202: - case 8232: - case 8233: - case 8239: - case 8287: - case 12288: - case 65279: - return true; - default: - return false; - } - }, - JSString__skipLeadingWhitespace(string, index) { - var t1, codeUnit; - for (t1 = string.length; index < t1;) { - codeUnit = string.charCodeAt(index); - if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) - break; - ++index; - } - return index; - }, - JSString__skipTrailingWhitespace(string, index) { - var t1, index0, codeUnit; - for (t1 = string.length; index > 0; index = index0) { - index0 = index - 1; - if (!(index0 < t1)) - return A.ioore(string, index0); - codeUnit = string.charCodeAt(index0); - if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) - break; - } - return index; - }, - getInterceptor$(receiver) { - if (typeof receiver == "number") { - if (Math.floor(receiver) == receiver) - return J.JSInt.prototype; - return J.JSNumNotInt.prototype; - } - if (typeof receiver == "string") - return J.JSString.prototype; - if (receiver == null) - return J.JSNull.prototype; - if (typeof receiver == "boolean") - return J.JSBool.prototype; - if (Array.isArray(receiver)) - return J.JSArray.prototype; - if (typeof receiver != "object") { - if (typeof receiver == "function") - return J.JavaScriptFunction.prototype; - if (typeof receiver == "symbol") - return J.JavaScriptSymbol.prototype; - if (typeof receiver == "bigint") - return J.JavaScriptBigInt.prototype; - return receiver; - } - if (receiver instanceof A.Object) - return receiver; - return J.getNativeInterceptor(receiver); - }, - getInterceptor$asx(receiver) { - if (typeof receiver == "string") - return J.JSString.prototype; - if (receiver == null) - return receiver; - if (Array.isArray(receiver)) - return J.JSArray.prototype; - if (typeof receiver != "object") { - if (typeof receiver == "function") - return J.JavaScriptFunction.prototype; - if (typeof receiver == "symbol") - return J.JavaScriptSymbol.prototype; - if (typeof receiver == "bigint") - return J.JavaScriptBigInt.prototype; - return receiver; - } - if (receiver instanceof A.Object) - return receiver; - return J.getNativeInterceptor(receiver); - }, - getInterceptor$ax(receiver) { - if (receiver == null) - return receiver; - if (Array.isArray(receiver)) - return J.JSArray.prototype; - if (typeof receiver != "object") { - if (typeof receiver == "function") - return J.JavaScriptFunction.prototype; - if (typeof receiver == "symbol") - return J.JavaScriptSymbol.prototype; - if (typeof receiver == "bigint") - return J.JavaScriptBigInt.prototype; - return receiver; - } - if (receiver instanceof A.Object) - return receiver; - return J.getNativeInterceptor(receiver); - }, - getInterceptor$s(receiver) { - if (typeof receiver == "string") - return J.JSString.prototype; - if (receiver == null) - return receiver; - if (!(receiver instanceof A.Object)) - return J.UnknownJavaScriptObject.prototype; - return receiver; - }, - get$hashCode$(receiver) { - return J.getInterceptor$(receiver).get$hashCode(receiver); - }, - get$iterator$ax(receiver) { - return J.getInterceptor$ax(receiver).get$iterator(receiver); - }, - get$length$asx(receiver) { - return J.getInterceptor$asx(receiver).get$length(receiver); - }, - get$runtimeType$(receiver) { - return J.getInterceptor$(receiver).get$runtimeType(receiver); - }, - $eq$(receiver, a0) { - if (receiver == null) - return a0 == null; - if (typeof receiver != "object") - return a0 != null && receiver === a0; - return J.getInterceptor$(receiver).$eq(receiver, a0); - }, - allMatches$1$s(receiver, a0) { - return J.getInterceptor$s(receiver).allMatches$1(receiver, a0); - }, - codeUnitAt$1$s(receiver, a0) { - return J.getInterceptor$s(receiver).codeUnitAt$1(receiver, a0); - }, - contains$1$asx(receiver, a0) { - return J.getInterceptor$asx(receiver).contains$1(receiver, a0); - }, - elementAt$1$ax(receiver, a0) { - return J.getInterceptor$ax(receiver).elementAt$1(receiver, a0); - }, - map$1$1$ax(receiver, a0, $T1) { - return J.getInterceptor$ax(receiver).map$1$1(receiver, a0, $T1); - }, - toString$0$(receiver) { - return J.getInterceptor$(receiver).toString$0(receiver); - }, - Interceptor: function Interceptor() { - }, - JSBool: function JSBool() { - }, - JSNull: function JSNull() { - }, - JavaScriptObject: function JavaScriptObject() { - }, - LegacyJavaScriptObject: function LegacyJavaScriptObject() { - }, - PlainJavaScriptObject: function PlainJavaScriptObject() { - }, - UnknownJavaScriptObject: function UnknownJavaScriptObject() { - }, - JavaScriptFunction: function JavaScriptFunction() { - }, - JavaScriptBigInt: function JavaScriptBigInt() { - }, - JavaScriptSymbol: function JavaScriptSymbol() { + if (tokenRequestUrl == null || tokenRequestToken == null) { + // goto return + $async$goto = 1; + break; + } + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.core).getIDToken("https://pub.dev")), type$.String), $async$createPubOIDCToken); + case 3: + // returning from await. + token = $async$result; + t2._as(t1.core).exportVariable("PUB_TOKEN", token); + $async$goto = 4; + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["pub", "token", "add", "https://pub.dev", "--env-var", "PUB_TOKEN"], type$.JSArray_String))), type$.dynamic), $async$createPubOIDCToken); + case 4: + // returning from await. + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$createPubOIDCToken, $async$completer); }, - JSArray: function JSArray(t0) { - this.$ti = t0; + latestPublishedVersion(channel, flavor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, t1, $async$temp1, $async$temp2; + var $async$latestPublishedVersion = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.JSObject; + $async$temp1 = type$.FutureOr_String; + $async$temp2 = t1; + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t1._as(t1._as(new self.HttpClient("setup-dart", A._setArrayType([], type$.JSArray_Object), type$.nullable_JSObject._as(A.jsify(A.LinkedHashMap_LinkedHashMap$_literal(["allowRedirects", true, "maxRedirects", 3, "allowRetries", true, "maxRetries", 3], type$.String, type$.Object))))).getJson(string$.https_ + channel + "/" + flavor + "/latest/VERSION")), t1), $async$latestPublishedVersion); + case 3: + // returning from await. + $async$returnValue = $async$temp1._as($async$temp2._as($async$result.result).version); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$latestPublishedVersion, $async$completer); }, - JSUnmodifiableArray: function JSUnmodifiableArray(t0) { - this.$ti = t0; + findLatestSdkForRelease(sdkRelease) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, versions, semvers, t1, t2, paths, $async$temp1, $async$temp2, $async$temp3; + var $async$findLatestSdkForRelease = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.String; + t2 = type$.JSObject; + $async$temp1 = J; + $async$temp2 = type$.List_dynamic; + $async$temp3 = t2; + $async$goto = 3; + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(new self.HttpClient("setup-dart", A._setArrayType([], type$.JSArray_Object), type$.nullable_JSObject._as(A.jsify(A.LinkedHashMap_LinkedHashMap$_literal(["allowRedirects", true, "maxRedirects", 3, "allowRetries", true, "maxRetries", 3], t1, type$.Object))))).getJson("https://storage.googleapis.com/storage/v1/b/dart-archive/o?prefix=" + ("channels/stable/release/" + sdkRelease + ".") + "&delimiter=/")), t2), $async$findLatestSdkForRelease); + case 3: + // returning from await. + paths = $async$temp1.cast$1$0$ax($async$temp2._as($async$temp3._as($async$result.result).prefixes), t1); + t1 = paths.$ti; + t2 = t1._eval$1("MappedListIterable"); + versions = A.List_List$of(new A.MappedListIterable(paths, t1._eval$1("String(ListBase.E)")._as(new A.findLatestSdkForRelease_closure()), t2), true, t2._eval$1("ListIterable.E")); + t2 = A._arrayInstanceType(versions); + t1 = t2._eval$1("MappedListIterable<1,Version>"); + semvers = A.List_List$of(new A.MappedListIterable(versions, t2._eval$1("Version(1)")._as(A.version_Version___parse_tearOff$closure()), t1), true, t1._eval$1("ListIterable.E")); + B.JSArray_methods.sort$0(semvers); + $async$returnValue = B.JSArray_methods.get$last(semvers)._version$_text; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$findLatestSdkForRelease, $async$completer); }, - ArrayIterator: function ArrayIterator(t0, t1, t2) { - var _ = this; - _._iterable = t0; - _._length = t1; - _._index = 0; - _._current = null; - _.$ti = t2; + findLatestSdkForRelease_closure: function findLatestSdkForRelease_closure() { }, - JSNumber: function JSNumber() { + throwLateFieldADI(fieldName) { + A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has been assigned during initialization."), new Error()); }, - JSInt: function JSInt() { + join(part1, part2) { + var t1 = $.$get$context(), + parts = A._setArrayType([part1, part2, null, null, null, null, null, null, null, null, null, null, null, null, null, null], type$.JSArray_nullable_String); + A._validateArgList("join", parts); + return t1.joinAll$1(new A.WhereTypeIterable(parts, type$.WhereTypeIterable_String)); }, - JSNumNotInt: function JSNumNotInt() { + isAlphabetic(char) { + var t1; + if (!(char >= 65 && char <= 90)) + t1 = char >= 97 && char <= 122; + else + t1 = true; + return t1; }, - JSString: function JSString() { + isDriveLetter(path, index) { + var t3, + t1 = path.length, + t2 = index + 2; + if (t1 < t2) + return false; + if (!(index >= 0 && index < t1)) + return A.ioore(path, index); + if (!A.isAlphabetic(path.charCodeAt(index))) + return false; + t3 = index + 1; + if (!(t3 < t1)) + return A.ioore(path, t3); + if (path.charCodeAt(t3) !== 58) + return false; + if (t1 === t2) + return true; + if (!(t2 >= 0 && t2 < t1)) + return A.ioore(path, t2); + return path.charCodeAt(t2) === 47; } }, B = {}; @@ -6024,6 +6266,9 @@ } }; J.JSArray.prototype = { + cast$1$0(receiver, $R) { + return new A.CastList(receiver, A._arrayInstanceType(receiver)._eval$1("@<1>")._bind$1($R)._eval$1("CastList<1,2>")); + }, add$1(receiver, value) { A._arrayInstanceType(receiver)._precomputed1._as(value); if (!!receiver.fixed$length) @@ -6060,6 +6305,55 @@ return receiver[t1 - 1]; throw A.wrapException(A.IterableElementError_noElement()); }, + sort$1(receiver, compare) { + var len, a, b, undefineds, i, + t1 = A._arrayInstanceType(receiver); + t1._eval$1("int(1,1)?")._as(compare); + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("sort")); + len = receiver.length; + if (len < 2) + return; + if (compare == null) + compare = J._interceptors_JSArray__compareAny$closure(); + if (len === 2) { + a = receiver[0]; + b = receiver[1]; + t1 = compare.call$2(a, b); + if (typeof t1 !== "number") + return t1.$gt(); + if (t1 > 0) { + receiver[0] = b; + receiver[1] = a; + } + return; + } + if (t1._precomputed1._is(null)) { + for (undefineds = 0, i = 0; i < receiver.length; ++i) + if (receiver[i] === void 0) { + receiver[i] = null; + ++undefineds; + } + } else + undefineds = 0; + receiver.sort(A.convertDartClosureToJS(compare, 2)); + if (undefineds > 0) + this._replaceSomeNullsWithUndefined$1(receiver, undefineds); + }, + sort$0($receiver) { + return this.sort$1($receiver, null); + }, + _replaceSomeNullsWithUndefined$1(receiver, count) { + var i0, + i = receiver.length; + for (; i0 = i - 1, i > 0; i = i0) + if (receiver[i0] === null) { + receiver[i0] = void 0; + --count; + if (count === 0) + break; + } + }, contains$1(receiver, other) { var i; for (i = 0; i < receiver.length; ++i) @@ -6085,12 +6379,10 @@ return receiver[index]; }, $indexSet(receiver, index, value) { - var t1; A._arrayInstanceType(receiver)._precomputed1._as(value); if (!!receiver.immutable$list) A.throwExpression(A.UnsupportedError$("indexed set")); - t1 = receiver.length; - if (index >= t1) + if (!(index >= 0 && index < receiver.length)) throw A.wrapException(A.diagnoseIndexError(receiver, index)); receiver[index] = value; }, @@ -6127,6 +6419,33 @@ $isIterator: 1 }; J.JSNumber.prototype = { + compareTo$1(receiver, b) { + var bIsNegative; + A._asNum(b); + if (receiver < b) + return -1; + else if (receiver > b) + return 1; + else if (receiver === b) { + if (receiver === 0) { + bIsNegative = this.get$isNegative(b); + if (this.get$isNegative(receiver) === bIsNegative) + return 0; + if (this.get$isNegative(receiver)) + return -1; + return 1; + } + return 0; + } else if (isNaN(receiver)) { + if (isNaN(b)) + return 0; + return 1; + } else + return -1; + }, + get$isNegative(receiver) { + return receiver === 0 ? 1 / receiver < 0 : receiver < 0; + }, toString$0(receiver) { if (receiver === 0 && 1 / receiver < 0) return "-0.0"; @@ -6187,6 +6506,7 @@ get$runtimeType(receiver) { return A.createRuntimeType(type$.num); }, + $isComparable: 1, $isdouble: 1, $isnum: 1 }; @@ -6299,6 +6619,15 @@ contains$1(receiver, other) { return A.stringContainsUnchecked(receiver, other, 0); }, + compareTo$1(receiver, other) { + var t1; + A._asString(other); + if (receiver === other) + t1 = 0; + else + t1 = receiver < other ? -1 : 1; + return t1; + }, toString$0(receiver) { return receiver; }, @@ -6320,9 +6649,59 @@ return receiver.length; }, $isTrustedGetRuntimeType: 1, + $isComparable: 1, $isPattern: 1, $isString: 1 }; + A._CastIterableBase.prototype = { + get$iterator(_) { + var t1 = A._instanceType(this); + return new A.CastIterator(J.get$iterator$ax(this.get$_source()), t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("CastIterator<1,2>")); + }, + get$length(_) { + return J.get$length$asx(this.get$_source()); + }, + elementAt$1(_, index) { + return A._instanceType(this)._rest[1]._as(J.elementAt$1$ax(this.get$_source(), index)); + }, + toString$0(_) { + return J.toString$0$(this.get$_source()); + } + }; + A.CastIterator.prototype = { + moveNext$0() { + return this._source.moveNext$0(); + }, + get$current() { + return this.$ti._rest[1]._as(this._source.get$current()); + }, + $isIterator: 1 + }; + A.CastIterable.prototype = { + get$_source() { + return this._source; + } + }; + A._EfficientLengthCastIterable.prototype = {$isEfficientLengthIterable: 1}; + A._CastListBase.prototype = { + $index(_, index) { + return this.$ti._rest[1]._as(J.$index$asx(this._source, index)); + }, + $indexSet(_, index, value) { + var t1 = this.$ti; + J.$indexSet$ax(this._source, index, t1._precomputed1._as(t1._rest[1]._as(value))); + }, + $isEfficientLengthIterable: 1, + $isList: 1 + }; + A.CastList.prototype = { + cast$1$0(_, $R) { + return new A.CastList(this._source, this.$ti._eval$1("@<1>")._bind$1($R)._eval$1("CastList<1,2>")); + }, + get$_source() { + return this._source; + } + }; A.LateError.prototype = { toString$0(_) { return "LateInitializationError: " + this.__internal$_message; @@ -6415,9 +6794,8 @@ }, elementAt$1(_, index) { var _this = this, - realIndex = _this.get$_startIndex() + index, - t1 = _this.get$_endIndex(); - if (realIndex >= t1) + realIndex = _this.get$_startIndex() + index; + if (index < 0 || realIndex >= _this.get$_endIndex()) throw A.wrapException(A.IndexError$withLength(index, _this.get$length(_this), _this, "index")); return J.elementAt$1$ax(_this.__internal$_iterable, realIndex); } @@ -6457,6 +6835,10 @@ get$length(_) { var t1 = this.__internal$_iterable; return t1.get$length(t1); + }, + elementAt$1(_, index) { + var t1 = this.__internal$_iterable; + return this._f.call$1(t1.elementAt$1(t1, index)); } }; A.EfficientLengthMappedIterable.prototype = {$isEfficientLengthIterable: 1}; @@ -6536,6 +6918,7 @@ } }; A.UnmodifiableListBase.prototype = {}; + A.__CastListBase__CastIterableBase_ListMixin.prototype = {}; A.TypeErrorDecoder.prototype = { matchTypeError$1(message) { var result, t1, _this = this, @@ -6776,19 +7159,19 @@ call$1(o) { return this.getTag(o); }, - $signature: 7 + $signature: 8 }; A.initHooks_closure0.prototype = { call$2(o, tag) { return this.getUnknownTag(o, tag); }, - $signature: 8 + $signature: 9 }; A.initHooks_closure1.prototype = { call$1(tag) { return this.prototypeForTag(A._asString(tag)); }, - $signature: 9 + $signature: 10 }; A.JSSyntaxRegExp.prototype = { toString$0(_) { @@ -6802,6 +7185,12 @@ t1 = _this._nativeRegExp; return _this._nativeGlobalRegExp = A.JSSyntaxRegExp_makeNative(_this.pattern, t1.multiline, !t1.ignoreCase, t1.unicode, t1.dotAll, true); }, + firstMatch$1(string) { + var m = this._nativeRegExp.exec(string); + if (m == null) + return null; + return new A._MatchImplementation(m); + }, allMatches$1(_, string) { return new A._AllMatchesIterable(this, string, 0); }, @@ -6938,6 +7327,7 @@ return receiver[index]; }, $indexSet(receiver, index, value) { + A._asDouble(value); A._checkValidIndex(index, receiver, receiver.length); receiver[index] = value; }, @@ -6947,6 +7337,7 @@ }; A.NativeTypedArrayOfInt.prototype = { $indexSet(receiver, index, value) { + A._asInt(value); A._checkValidIndex(index, receiver, receiver.length); receiver[index] = value; }, @@ -7092,7 +7483,7 @@ t2 = this.span; t1.firstChild ? t1.removeChild(t2) : t1.appendChild(t2); }, - $signature: 10 + $signature: 11 }; A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = { call$0() { @@ -7155,13 +7546,13 @@ call$2(error, stackTrace) { this.bodyFunction.call$2(1, new A.ExceptionAndStackTrace(error, type$.StackTrace._as(stackTrace))); }, - $signature: 11 + $signature: 12 }; A._wrapJsFunctionForAsync_closure.prototype = { call$2(errorCode, result) { this.$protected(A._asInt(errorCode), result); }, - $signature: 12 + $signature: 13 }; A.AsyncError.prototype = { toString$0(_) { @@ -7417,7 +7808,7 @@ call$2(error, stackTrace) { this.$this._completeError$2(type$.Object._as(error), type$.StackTrace._as(stackTrace)); }, - $signature: 13 + $signature: 14 }; A._Future__chainForeignFuture_closure1.prototype = { call$0() { @@ -7482,7 +7873,7 @@ call$1(_) { return this.originalSource; }, - $signature: 14 + $signature: 15 }; A._Future__propagateToListeners_handleValueCallback.prototype = { call$0() { @@ -7776,6 +8167,9 @@ var t1 = A.instanceType(receiver); return new A.MappedListIterable(receiver, t1._bind$1($T)._eval$1("1(ListBase.E)")._as(f), t1._eval$1("@")._bind$1($T)._eval$1("MappedListIterable<1,2>")); }, + cast$1$0(receiver, $R) { + return new A.CastList(receiver, A.instanceType(receiver)._eval$1("@")._bind$1($R)._eval$1("CastList<1,2>")); + }, fillRange$3(receiver, start, end, fill) { var i; A.instanceType(receiver)._eval$1("ListBase.E?")._as(fill); @@ -7822,7 +8216,7 @@ t1._contents = t2 + ": "; t1._contents += A.S(v); }, - $signature: 15 + $signature: 16 }; A.Utf8Decoder__decoder_closure.prototype = { call$0() { @@ -8299,6 +8693,9 @@ } }; A.Iterable.prototype = { + cast$1$0(_, $R) { + return A.CastIterable_CastIterable(this, A._instanceType(this)._eval$1("Iterable.E"), $R); + }, map$1$1(_, toElement, $T) { var t1 = A._instanceType(this); return A.MappedIterable_MappedIterable(this, t1._bind$1($T)._eval$1("1(Iterable.E)")._as(toElement), t1._eval$1("Iterable.E"), $T); @@ -8373,13 +8770,13 @@ call$2(msg, position) { throw A.wrapException(A.FormatException$("Illegal IPv4 address, " + msg, this.host, position)); }, - $signature: 16 + $signature: 17 }; A.Uri_parseIPv6Address_error.prototype = { call$2(msg, position) { throw A.wrapException(A.FormatException$("Illegal IPv6 address, " + msg, this.host, position)); }, - $signature: 17 + $signature: 18 }; A.Uri_parseIPv6Address_parseHex.prototype = { call$2(start, end) { @@ -8391,7 +8788,7 @@ this.error.call$2("each part must be in the range of `0x0..0xFFFF`", start); return value; }, - $signature: 18 + $signature: 19 }; A._Uri.prototype = { get$_text() { @@ -8590,7 +8987,7 @@ B.NativeUint8List_methods.fillRange$3(t1, 0, 96, defaultTransition); return t1; }, - $signature: 19 + $signature: 20 }; A._createTables_setChars.prototype = { call$3(target, chars, transition) { @@ -8727,7 +9124,7 @@ } else return o; }, - $signature: 20 + $signature: 21 }; A.promiseToFuture_closure.prototype = { call$1(r) { @@ -8748,6 +9145,46 @@ return "Promise was rejected with a value of `" + (this.isUndefined ? "undefined" : "null") + "`."; } }; + A.DefaultEquality.prototype = {}; + A.IterableEquality.prototype = { + equals$2(elements1, elements2) { + var it1, t2, it2, hasNext, t3, t4, + t1 = this.$ti._eval$1("Iterable<1>?"); + t1._as(elements1); + t1._as(elements2); + if (elements1 === elements2) + return true; + t1 = A._arrayInstanceType(elements1); + it1 = new J.ArrayIterator(elements1, elements1.length, t1._eval$1("ArrayIterator<1>")); + t2 = A._arrayInstanceType(elements2); + it2 = new J.ArrayIterator(elements2, elements2.length, t2._eval$1("ArrayIterator<1>")); + for (t1 = t1._precomputed1, t2 = t2._precomputed1; true;) { + hasNext = it1.moveNext$0(); + if (hasNext !== it2.moveNext$0()) + return false; + if (!hasNext) + return true; + t3 = it1._current; + if (t3 == null) + t3 = t1._as(t3); + t4 = it2._current; + if (!J.$eq$(t3, t4 == null ? t2._as(t4) : t4)) + return false; + } + }, + hash$1(elements) { + var t1, hash, _i; + this.$ti._eval$1("Iterable<1>?")._as(elements); + for (t1 = elements.length, hash = 0, _i = 0; _i < elements.length; elements.length === t1 || (0, A.throwConcurrentModificationError)(elements), ++_i) { + hash = hash + J.get$hashCode$(elements[_i]) & 2147483647; + hash = hash + (hash << 10 >>> 0) & 2147483647; + hash ^= hash >>> 6; + } + hash = hash + (hash << 3 >>> 0) & 2147483647; + hash ^= hash >>> 11; + return hash + (hash << 15 >>> 0) & 2147483647; + } + }; A.Context.prototype = { joinAll$1(parts) { var t1, t2, t3, needsSeparator, isAbsoluteAndNotRootRelative, t4, t5, parsed, path, t6; @@ -8787,14 +9224,14 @@ call$1(part) { return A._asString(part) !== ""; }, - $signature: 21 + $signature: 22 }; A._validateArgList_closure.prototype = { call$1(arg) { A._asStringQ(arg); return arg == null ? "null" : '"' + arg + '"'; }, - $signature: 22 + $signature: 23 }; A.InternalStyle.prototype = { getRoot$1(path) { @@ -9013,39 +9450,145 @@ return "\\"; } }; + A.Version.prototype = { + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A.Version && _this.major === other.major && _this.minor === other.minor && _this.patch === other.patch && B.C_IterableEquality.equals$2(_this.preRelease, other.preRelease) && B.C_IterableEquality.equals$2(_this.build, other.build); + }, + get$hashCode(_) { + var _this = this; + return (_this.major ^ _this.minor ^ _this.patch ^ B.C_IterableEquality.hash$1(_this.preRelease) ^ B.C_IterableEquality.hash$1(_this.build)) >>> 0; + }, + compareTo$1(_, other) { + var t1, t2, t3, comparison, _this = this; + type$.VersionRange._as(other); + t1 = _this.major; + t2 = other.major; + if (t1 !== t2) + return B.JSInt_methods.compareTo$1(t1, t2); + t1 = _this.minor; + t2 = other.minor; + if (t1 !== t2) + return B.JSInt_methods.compareTo$1(t1, t2); + t1 = _this.patch; + t2 = other.patch; + if (t1 !== t2) + return B.JSInt_methods.compareTo$1(t1, t2); + t1 = _this.preRelease; + t2 = t1.length === 0; + if (t2 && other.preRelease.length !== 0) + return 1; + t3 = other.preRelease; + if (t3.length === 0 && !t2) + return -1; + comparison = _this._compareLists$2(t1, t3); + if (comparison !== 0) + return comparison; + t1 = _this.build; + t2 = t1.length === 0; + if (t2 && other.build.length !== 0) + return -1; + t3 = other.build; + if (t3.length === 0 && !t2) + return 1; + return _this._compareLists$2(t1, t3); + }, + toString$0(_) { + return this._version$_text; + }, + _compareLists$2(a, b) { + var i, t2, aPart, bPart, + t1 = type$.List_Object; + t1._as(a); + t1._as(b); + for (i = 0; t1 = a.length, t2 = b.length, i < Math.max(t1, t2); ++i) { + aPart = i < t1 ? a[i] : null; + bPart = i < t2 ? b[i] : null; + if (J.$eq$(aPart, bPart)) + continue; + if (aPart == null) + return -1; + if (bPart == null) + return 1; + if (typeof aPart == "number") + if (typeof bPart == "number") + return B.JSNumber_methods.compareTo$1(aPart, bPart); + else + return -1; + else if (typeof bPart == "number") + return 1; + else { + A._asString(aPart); + A._asString(bPart); + if (aPart === bPart) + t1 = 0; + else + t1 = aPart < bPart ? -1 : 1; + return t1; + } + } + return 0; + }, + $isComparable: 1, + $isVersionRange: 1 + }; + A.Version__splitParts_closure.prototype = { + call$1(part) { + var t1; + A._asString(part); + t1 = A.Primitives_parseInt(part, null); + return t1 == null ? part : t1; + }, + $signature: 24 + }; + A.findLatestSdkForRelease_closure.prototype = { + call$1(p) { + return B.JSArray_methods.get$last(A._asString(p).split("/")); + }, + $signature: 7 + }; (function aliases() { var _ = J.LegacyJavaScriptObject.prototype; _.super$LegacyJavaScriptObject$toString = _.toString$0; })(); (function installTearOffs() { - var _static_1 = hunkHelpers._static_1, + var _static_2 = hunkHelpers._static_2, + _static_1 = hunkHelpers._static_1, _static_0 = hunkHelpers._static_0; + _static_2(J, "_interceptors_JSArray__compareAny$closure", "JSArray__compareAny", 25); _static_1(A, "async__AsyncRun__scheduleImmediateJsOverride$closure", "_AsyncRun__scheduleImmediateJsOverride", 2); _static_1(A, "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", "_AsyncRun__scheduleImmediateWithSetImmediate", 2); _static_1(A, "async__AsyncRun__scheduleImmediateWithTimer$closure", "_AsyncRun__scheduleImmediateWithTimer", 2); _static_0(A, "async___startMicrotaskLoop$closure", "_startMicrotaskLoop", 0); - _static_1(A, "core_Uri_decodeComponent$closure", "Uri_decodeComponent", 23); + _static_1(A, "core_Uri_decodeComponent$closure", "Uri_decodeComponent", 7); + _static_1(A, "version_Version___parse_tearOff$closure", "Version___parse_tearOff", 26); })(); (function inheritance() { var _mixin = hunkHelpers.mixin, _inherit = hunkHelpers.inherit, _inheritMany = hunkHelpers.inheritMany; _inherit(A.Object, null); - _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Error, A.ListBase, A.Iterable, A.ListIterator, A.MappedIterator, A.WhereIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.Closure, A.MapBase, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A.AsyncError, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A._StreamIterator, A._Zone, A._HashMapKeyIterator, A.Codec, A.Converter, A._Utf8Decoder, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.NullRejectionException, A.Context, A.Style, A.ParsedPath]); + _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Iterable, A.CastIterator, A.Error, A.ListBase, A.ListIterator, A.MappedIterator, A.WhereIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A.Closure, A.MapBase, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A.AsyncError, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A._StreamIterator, A._Zone, A._HashMapKeyIterator, A.Codec, A.Converter, A._Utf8Decoder, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.Null, A._StringStackTrace, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.NullRejectionException, A.DefaultEquality, A.IterableEquality, A.Context, A.Style, A.ParsedPath, A.Version]); _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]); _inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]); _inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction]); _inherit(J.JSUnmodifiableArray, J.JSArray); _inheritMany(J.JSNumber, [J.JSInt, J.JSNumNotInt]); + _inheritMany(A.Iterable, [A._CastIterableBase, A.EfficientLengthIterable, A.MappedIterable, A.WhereIterable, A.WhereTypeIterable, A._AllMatchesIterable, A._StringAllMatchesIterable]); + _inheritMany(A._CastIterableBase, [A.CastIterable, A.__CastListBase__CastIterableBase_ListMixin]); + _inherit(A._EfficientLengthCastIterable, A.CastIterable); + _inherit(A._CastListBase, A.__CastListBase__CastIterableBase_ListMixin); + _inherit(A.CastList, A._CastListBase); _inheritMany(A.Error, [A.LateError, A.TypeError, A.JsNoSuchMethodError, A.UnknownJsTypeError, A._CyclicInitializationError, A.RuntimeError, A.AssertionError, A._Error, A.ArgumentError, A.UnsupportedError, A.UnimplementedError, A.StateError, A.ConcurrentModificationError]); _inherit(A.UnmodifiableListBase, A.ListBase); _inherit(A.CodeUnits, A.UnmodifiableListBase); - _inheritMany(A.Iterable, [A.EfficientLengthIterable, A.MappedIterable, A.WhereIterable, A.WhereTypeIterable, A._AllMatchesIterable, A._StringAllMatchesIterable]); _inheritMany(A.EfficientLengthIterable, [A.ListIterable, A.LinkedHashMapKeyIterable, A._HashMapKeyIterable]); _inheritMany(A.ListIterable, [A.SubListIterable, A.MappedListIterable]); _inherit(A.EfficientLengthMappedIterable, A.MappedIterable); _inherit(A.NullError, A.TypeError); - _inheritMany(A.Closure, [A.Closure0Args, A.Closure2Args, A.TearOffClosure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._awaitOnObject_closure, A._Future__chainForeignFuture_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A._createTables_setChars, A._createTables_setRange, A.jsify__convert, A.promiseToFuture_closure, A.promiseToFuture_closure0, A.Context_joinAll_closure, A._validateArgList_closure]); + _inheritMany(A.Closure, [A.Closure0Args, A.Closure2Args, A.TearOffClosure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._awaitOnObject_closure, A._Future__chainForeignFuture_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A._createTables_setChars, A._createTables_setRange, A.jsify__convert, A.promiseToFuture_closure, A.promiseToFuture_closure0, A.Context_joinAll_closure, A._validateArgList_closure, A.Version__splitParts_closure, A.findLatestSdkForRelease_closure]); _inheritMany(A.TearOffClosure, [A.StaticClosure, A.BoundClosure]); _inherit(A._AssertionError, A.AssertionError); _inheritMany(A.MapBase, [A.JsLinkedHashMap, A._HashMap]); @@ -9071,6 +9614,7 @@ _inherit(A.InternalStyle, A.Style); _inheritMany(A.InternalStyle, [A.PosixStyle, A.UrlStyle, A.WindowsStyle]); _mixin(A.UnmodifiableListBase, A.UnmodifiableListMixin); + _mixin(A.__CastListBase__CastIterableBase_ListMixin, A.ListBase); _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A.ListBase); _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin, A.ListBase); @@ -9080,13 +9624,13 @@ typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []}, mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List"}, mangledNames: {}, - types: ["~()", "~(@)", "~(~())", "Null(@)", "Null()", "@()", "~(Uint8List,String,int)", "@(@)", "@(@,String)", "@(String)", "Null(~())", "Null(@,StackTrace)", "~(int,@)", "Null(Object,StackTrace)", "_Future<@>(@)", "~(Object?,Object?)", "~(String,int)", "~(String,int?)", "int(int,int)", "Uint8List(@,@)", "Object?(Object?)", "bool(String)", "String(String?)", "String(String)"], + types: ["~()", "~(@)", "~(~())", "Null(@)", "Null()", "@()", "~(Uint8List,String,int)", "String(String)", "@(@)", "@(@,String)", "@(String)", "Null(~())", "Null(@,StackTrace)", "~(int,@)", "Null(Object,StackTrace)", "_Future<@>(@)", "~(Object?,Object?)", "~(String,int)", "~(String,int?)", "int(int,int)", "Uint8List(@,@)", "Object?(Object?)", "bool(String)", "String(String?)", "Object(String)", "int(@,@)", "Version(String)"], interceptorsByTag: null, leafTags: null, arrayRti: Symbol("$ti") }; - A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JavaScriptObject":{"JSObject":[]},"LegacyJavaScriptObject":{"JSObject":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"]},"ArrayIterator":{"Iterator":["1"]},"JSNumber":{"double":[],"num":[]},"JSInt":{"double":[],"int":[],"num":[],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Pattern":[],"TrustedGetRuntimeType":[]},"LateError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"UnmodifiableListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"ListBase.E":"int","UnmodifiableListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"ListIterator":{"Iterator":["1"]},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedIterator":{"Iterator":["2"]},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2","ListIterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereIterator":{"Iterator":["1"]},"WhereTypeIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereTypeIterator":{"Iterator":["1"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_AssertionError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"]},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"JSSyntaxRegExp":{"RegExp":[],"Pattern":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"_AllMatchesIterator":{"Iterator":["RegExpMatch"]},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"_StringAllMatchesIterator":{"Iterator":["Match"]},"NativeByteBuffer":{"JSObject":[],"ByteBuffer":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JSObject":[]},"NativeByteData":{"ByteData":[],"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JSObject":[]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"JavaScriptIndexingBehavior":["double"],"List":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"ListBase":["double"],"Float32List":[],"JavaScriptIndexingBehavior":["double"],"List":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeFloat64List":{"ListBase":["double"],"Float64List":[],"JavaScriptIndexingBehavior":["double"],"List":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeInt16List":{"ListBase":["int"],"Int16List":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt32List":{"ListBase":["int"],"Int32List":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt8List":{"ListBase":["int"],"Int8List":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint16List":{"ListBase":["int"],"Uint16List":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint32List":{"ListBase":["int"],"Uint32List":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8ClampedList":{"ListBase":["int"],"Uint8ClampedList":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8List":{"ListBase":["int"],"Uint8List":[],"JavaScriptIndexingBehavior":["int"],"List":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"_Future":{"Future":["1"]},"AsyncError":{"Error":[]},"_AsyncCompleter":{"_Completer":["1"]},"_Zone":{"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_HashMap":{"MapBase":["1","2"],"Map":["1","2"]},"_IdentityHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"Map":["1","2"]},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashMapKeyIterator":{"Iterator":["1"]},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"Base64Codec":{"Codec":["List","String"]},"Encoding":{"Codec":["String","List"]},"Utf8Codec":{"Codec":["String","List"]},"double":{"num":[]},"int":{"num":[]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"RegExpMatch":{"Match":[]},"String":{"Pattern":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"PosixStyle":{"InternalStyle":[]},"UrlStyle":{"InternalStyle":[]},"WindowsStyle":{"InternalStyle":[]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]}}')); - A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"EfficientLengthIterable":1,"UnmodifiableListBase":1,"NativeTypedArray":1,"Converter":2}')); + A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"JavaScriptObject":{"JSObject":[]},"LegacyJavaScriptObject":{"JSObject":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"EfficientLengthIterable":["1"],"JSObject":[],"Iterable":["1"]},"ArrayIterator":{"Iterator":["1"]},"JSNumber":{"double":[],"num":[],"Comparable":["num"]},"JSInt":{"double":[],"int":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Comparable":["String"],"Pattern":[],"TrustedGetRuntimeType":[]},"_CastIterableBase":{"Iterable":["2"]},"CastIterator":{"Iterator":["2"]},"CastIterable":{"_CastIterableBase":["1","2"],"Iterable":["2"],"Iterable.E":"2"},"_EfficientLengthCastIterable":{"CastIterable":["1","2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"_CastListBase":{"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"]},"CastList":{"_CastListBase":["1","2"],"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","Iterable.E":"2"},"LateError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"UnmodifiableListMixin":["int"],"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"ListBase.E":"int","UnmodifiableListMixin.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1","ListIterable.E":"1"},"ListIterator":{"Iterator":["1"]},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedIterator":{"Iterator":["2"]},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2","ListIterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereIterator":{"Iterator":["1"]},"WhereTypeIterable":{"Iterable":["1"],"Iterable.E":"1"},"WhereTypeIterator":{"Iterator":["1"]},"UnmodifiableListBase":{"ListBase":["1"],"UnmodifiableListMixin":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"_AssertionError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"LinkedHashMap":["1","2"],"Map":["1","2"]},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"LinkedHashMapKeyIterator":{"Iterator":["1"]},"JSSyntaxRegExp":{"RegExp":[],"Pattern":[]},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"_AllMatchesIterator":{"Iterator":["RegExpMatch"]},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"_StringAllMatchesIterator":{"Iterator":["Match"]},"NativeByteBuffer":{"JSObject":[],"ByteBuffer":[],"TrustedGetRuntimeType":[]},"NativeTypedData":{"JSObject":[]},"NativeByteData":{"ByteData":[],"JSObject":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"],"JSObject":[]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"]},"NativeFloat32List":{"ListBase":["double"],"Float32List":[],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeFloat64List":{"ListBase":["double"],"Float64List":[],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"JSObject":[],"Iterable":["double"],"FixedLengthListMixin":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeInt16List":{"ListBase":["int"],"Int16List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt32List":{"ListBase":["int"],"Int32List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt8List":{"ListBase":["int"],"Int8List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint16List":{"ListBase":["int"],"Uint16List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint32List":{"ListBase":["int"],"Uint32List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8ClampedList":{"ListBase":["int"],"Uint8ClampedList":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8List":{"ListBase":["int"],"Uint8List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"JSObject":[],"Iterable":["int"],"FixedLengthListMixin":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"_Future":{"Future":["1"]},"AsyncError":{"Error":[]},"_AsyncCompleter":{"_Completer":["1"]},"_Zone":{"Zone":[]},"_RootZone":{"_Zone":[],"Zone":[]},"_HashMap":{"MapBase":["1","2"],"Map":["1","2"]},"_IdentityHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"Map":["1","2"]},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_HashMapKeyIterator":{"Iterator":["1"]},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"Base64Codec":{"Codec":["List","String"]},"Encoding":{"Codec":["String","List"]},"Utf8Codec":{"Codec":["String","List"]},"double":{"num":[],"Comparable":["num"]},"int":{"num":[],"Comparable":["num"]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"num":{"Comparable":["num"]},"RegExpMatch":{"Match":[]},"String":{"Comparable":["String"],"Pattern":[]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_StringStackTrace":{"StackTrace":[]},"StringBuffer":{"StringSink":[]},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"PosixStyle":{"InternalStyle":[]},"UrlStyle":{"InternalStyle":[]},"WindowsStyle":{"InternalStyle":[]},"Version":{"VersionRange":[],"Comparable":["VersionRange"]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"VersionRange":{"Comparable":["VersionRange"]}}')); + A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"UnmodifiableListBase":1,"__CastListBase__CastIterableBase_ListMixin":2,"NativeTypedArray":1,"Converter":2}')); var string$ = { Error_: "Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type", https_: "https://storage.googleapis.com/dart-archive/channels/" @@ -9097,6 +9641,7 @@ AsyncError: findType("AsyncError"), ByteBuffer: findType("ByteBuffer"), ByteData: findType("ByteData"), + Comparable_dynamic: findType("Comparable<@>"), EfficientLengthIterable_dynamic: findType("EfficientLengthIterable<@>"), Error: findType("Error"), Float32List: findType("Float32List"), @@ -9120,11 +9665,15 @@ JSObject: findType("JSObject"), JavaScriptFunction: findType("JavaScriptFunction"), JavaScriptIndexingBehavior_dynamic: findType("JavaScriptIndexingBehavior<@>"), + List_Object: findType("List"), List_String: findType("List"), + List_dynamic: findType("List<@>"), List_int: findType("List"), + MappedListIterable_String_Object: findType("MappedListIterable"), MappedListIterable_String_dynamic: findType("MappedListIterable"), Null: findType("Null"), Object: findType("Object"), + Object_Function_String: findType("Object(String)"), Record: findType("Record"), RegExpMatch: findType("RegExpMatch"), StackTrace: findType("StackTrace"), @@ -9137,6 +9686,7 @@ Uint8List: findType("Uint8List"), UnknownJavaScriptObject: findType("UnknownJavaScriptObject"), Uri: findType("Uri"), + VersionRange: findType("VersionRange"), WhereTypeIterable_String: findType("WhereTypeIterable"), _Future_dynamic: findType("_Future<@>"), _IdentityHashMap_of_nullable_Object_and_nullable_Object: findType("_IdentityHashMap"), @@ -9165,6 +9715,7 @@ B.Interceptor_methods = J.Interceptor.prototype; B.JSArray_methods = J.JSArray.prototype; B.JSInt_methods = J.JSInt.prototype; + B.JSNumber_methods = J.JSNumber.prototype; B.JSString_methods = J.JSString.prototype; B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype; B.JavaScriptObject_methods = J.JavaScriptObject.prototype; @@ -9173,6 +9724,8 @@ B.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype; B.C_Base64Encoder = new A.Base64Encoder(); B.C_Base64Codec = new A.Base64Codec(); + B.C_DefaultEquality = new A.DefaultEquality(A.findType("DefaultEquality<0&>")); + B.C_IterableEquality = new A.IterableEquality(A.findType("IterableEquality")); B.C_JS_CONST = function getTagFallback(o) { var s = Object.prototype.toString.call(o); return s.substring(8, s.length - 1); @@ -9397,6 +9950,8 @@ _lazyFinal($, "Style_windows", "$get$Style_windows", () => new A.WindowsStyle(A.RegExp_RegExp("[/\\\\]"), A.RegExp_RegExp("[^/\\\\]$"), A.RegExp_RegExp("^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])"), A.RegExp_RegExp("^[/\\\\](?![/\\\\])"))); _lazyFinal($, "Style_url", "$get$Style_url", () => new A.UrlStyle(A.RegExp_RegExp("/"), A.RegExp_RegExp("(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$"), A.RegExp_RegExp("[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*"), A.RegExp_RegExp("^/"))); _lazyFinal($, "Style_platform", "$get$Style_platform", () => A.Style__getPlatformStyle()); + _lazyFinal($, "startVersion", "$get$startVersion", () => A.RegExp_RegExp("^(\\d+)\\.(\\d+)\\.(\\d+)(-([0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*))?(\\+([0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*))?")); + _lazyFinal($, "completeVersion", "$get$completeVersion", () => A.RegExp_RegExp($.$get$startVersion().pattern + "$")); })(); (function nativeSupport() { !function() { @@ -9449,6 +10004,9 @@ Function.prototype.call$1$1 = function(a) { return this(a); }; + Function.prototype.call$1$0 = function() { + return this(); + }; convertAllToFastObject(holders); convertToFastObject($); (function(callback) { diff --git a/dist/sig.txt b/dist/sig.txt index e470ffc..3f36bfa 100644 --- a/dist/sig.txt +++ b/dist/sig.txt @@ -1 +1 @@ -C101968925A261FBCDF2AFA30D38A662 +4851367C299B4A77E33C437F57AEBF33 diff --git a/lib/main.dart b/lib/main.dart index 3ea6982..b38a7d8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,6 +6,7 @@ import 'dart:js_interop'; import 'dart:js_util'; import 'package:path/path.dart' as path; +import 'package:pub_semver/pub_semver.dart'; import 'node/actions/core.dart'; import 'node/actions/exec.dart'; @@ -46,7 +47,13 @@ void main(List args) async { String version; String channel; - if (sdk == 'stable' || sdk == 'beta' || sdk == 'dev') { + if (sdk.endsWith('.x')) { + channel = 'stable'; + + // Find the latest version for 'sdk'. + final versionPrefix = sdk.substring(0, sdk.length - '.x'.length); + version = await findLatestSdkForRelease(versionPrefix); + } else if (sdk == 'stable' || sdk == 'beta' || sdk == 'dev') { channel = sdk; version = raw ? 'latest' : (await latestPublishedVersion(channel, flavor)); @@ -55,11 +62,11 @@ void main(List args) async { // rename from `be` to `main` (also tracked as b/299435467). try { channel = 'main'; - await latestPublishedVersion(channel, flavor); + version = await latestPublishedVersion(channel, flavor); } catch (_) { channel = 'be'; + version = await latestPublishedVersion(channel, flavor); } - version = 'latest'; } else { version = sdk; @@ -115,11 +122,7 @@ void main(List args) async { await createPubOIDCToken(); // Configure the outputs. - if (raw) { - core.setOutput('dart-version', getVersionFromSdk(sdkPath)); - } else { - core.setOutput('dart-version', version); - } + core.setOutput('dart-version', getVersionFromSdk(sdkPath)); // Report success; print version. await promiseToFuture(exec.exec( @@ -207,3 +210,43 @@ Future latestPublishedVersion(String channel, String flavor) async { var result = getProperty(response, 'result'); return getProperty(result, 'version'); } + +/// Find the latest SDK patch version for the given SDK release. +/// +/// [sdkRelease] must be in the form of `major.minor` (e.g., `2.19`). +Future findLatestSdkForRelease(String sdkRelease) async { + final filePrefix = 'channels/stable/release/$sdkRelease.'; + final url = 'https://storage.googleapis.com/storage/v1/b/dart-archive/o' + '?prefix=$filePrefix&delimiter=/'; + + final http = HttpClient( + 'setup-dart', + [].toJS, + jsify({ + 'allowRedirects': true, + 'maxRedirects': 3, + 'allowRetries': true, + 'maxRetries': 3, + }) as JSObject?, + ); + + // { + // "kind": "storage#objects", + // "prefixes": [ + // "channels/stable/release/2.19.0/", + // "channels/stable/release/2.19.1/", + // ... + // "channels/stable/release/2.19.6/" + // ] + // } + var response = await promiseToFuture(http.getJson(url)); + var result = getProperty(response, 'result'); + + final paths = (getProperty(result, 'prefixes') as List).cast(); + final versions = paths.map((p) => p.split('/').last).toList(); + + // Sort versions by semver and return the highest version. + final semvers = versions.map(Version.parse).toList(); + semvers.sort(); + return semvers.last.toString(); +} diff --git a/pubspec.yaml b/pubspec.yaml index f7b23e9..730d430 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,6 +8,7 @@ environment: dependencies: path: ^1.8.0 + pub_semver: ^2.1.0 dev_dependencies: args: ^2.4.0 From 0026abd21e9489e4f0a3b6d6a0ec4c4d2b420577 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Sat, 16 Sep 2023 12:25:08 -0700 Subject: [PATCH 2/8] revert changes to raw flavor --- dist/index.mjs | 209 ++++++++++++++++++++++++++++------------------ dist/main.cjs | 12 +-- dist/sig.txt | 2 +- lib/main.dart | 10 ++- package-lock.json | 8 +- package.json | 2 +- 6 files changed, 145 insertions(+), 98 deletions(-) diff --git a/dist/index.mjs b/dist/index.mjs index 00dd09b..2cb76e0 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -554,7 +554,7 @@ class OidcClient { .catch(error => { throw new Error(`Failed to get ID Token. \n Error Code : ${error.statusCode}\n - Error Message: ${error.result.message}`); + Error Message: ${error.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -1935,6 +1935,19 @@ class HttpClientResponse { })); }); } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on('data', (chunk) => { + chunks.push(chunk); + }); + this.message.on('end', () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { @@ -2438,7 +2451,13 @@ function getProxyUrl(reqUrl) { } })(); if (proxyVar) { - return new URL(proxyVar); + try { + return new URL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new URL(`http://${proxyVar}`); + } } else { return undefined; @@ -2449,6 +2468,10 @@ function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; @@ -2474,13 +2497,24 @@ function checkBypass(reqUrl) { .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { return true; } } return false; } exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} //# sourceMappingURL=proxy.js.map /***/ }), @@ -2519,11 +2553,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; const fs = __importStar(__nccwpck_require__(7147)); const path = __importStar(__nccwpck_require__(1017)); -_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +_a = fs.promises +// export const {open} = 'fs' +, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +// export const {open} = 'fs' exports.IS_WINDOWS = process.platform === 'win32'; +// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 +exports.UV_FS_O_EXLOCK = 0x10000000; +exports.READONLY = fs.constants.O_RDONLY; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { @@ -2703,12 +2743,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; const assert_1 = __nccwpck_require__(9491); -const childProcess = __importStar(__nccwpck_require__(2081)); const path = __importStar(__nccwpck_require__(1017)); -const util_1 = __nccwpck_require__(3837); const ioUtil = __importStar(__nccwpck_require__(573)); -const exec = util_1.promisify(childProcess.exec); -const execFile = util_1.promisify(childProcess.execFile); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -2789,61 +2825,23 @@ exports.mv = mv; function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { - // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another - // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. // Check for invalid characters // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file if (/[*"<>|]/.test(inputPath)) { throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); } - try { - const cmdPath = ioUtil.getCmdPath(); - if (yield ioUtil.isDirectory(inputPath, true)) { - yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { - env: { inputPath } - }); - } - else { - yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { - env: { inputPath } - }); - } - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } - // Shelling out fails to remove a symlink folder with missing source, this unlink catches that - try { - yield ioUtil.unlink(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } } - else { - let isDir = false; - try { - isDir = yield ioUtil.isDirectory(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - return; - } - if (isDir) { - yield execFile(`rm`, [`-rf`, `${inputPath}`]); - } - else { - yield ioUtil.unlink(inputPath); - } + try { + // note if path does not exist, error is silent + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } + catch (err) { + throw new Error(`File was unable to be removed ${err}`); } }); } @@ -4024,8 +4022,11 @@ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 +var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + // The actual regexps go on exports.re var re = exports.re = [] +var safeRe = exports.safeRe = [] var src = exports.src = [] var t = exports.tokens = {} var R = 0 @@ -4034,6 +4035,31 @@ function tok (n) { t[n] = R++ } +var LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +var safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +function makeSafeRe (value) { + for (var i = 0; i < safeRegexReplacements.length; i++) { + var token = safeRegexReplacements[i][0] + var max = safeRegexReplacements[i][1] + value = value + .split(token + '*').join(token + '{0,' + max + '}') + .split(token + '+').join(token + '{1,' + max + '}') + } + return value +} + // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. @@ -4043,14 +4069,14 @@ function tok (n) { tok('NUMERICIDENTIFIER') src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*' tok('NUMERICIDENTIFIERLOOSE') -src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+' +src[t.NUMERICIDENTIFIERLOOSE] = '\\d+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. tok('NONNUMERICIDENTIFIER') -src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' +src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*' // ## Main Version // Three dot-separated numeric identifiers. @@ -4092,7 +4118,7 @@ src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + // Any combination of digits, letters, or hyphens. tok('BUILDIDENTIFIER') -src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+' +src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata @@ -4172,6 +4198,7 @@ src[t.COERCE] = '(^|[^\\d])' + '(?:$|[^\\d])' tok('COERCERTL') re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g') +safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g') // Tilde ranges. // Meaning is "reasonably at or greater than" @@ -4181,6 +4208,7 @@ src[t.LONETILDE] = '(?:~>?)' tok('TILDETRIM') src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+' re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g') +safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g') var tildeTrimReplace = '$1~' tok('TILDE') @@ -4196,6 +4224,7 @@ src[t.LONECARET] = '(?:\\^)' tok('CARETTRIM') src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+' re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g') +safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g') var caretTrimReplace = '$1^' tok('CARET') @@ -4217,6 +4246,7 @@ src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + // this one has to use the /g flag re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g') +safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` @@ -4245,6 +4275,14 @@ for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) + + // Replace all greedy whitespace to prevent regex dos issues. These regex are + // used internally via the safeRe object since all inputs in this library get + // normalized first to trim and collapse all extra whitespace. The original + // regexes are exported for userland consumption and lower level usage. A + // future breaking change could export the safer regex only with a note that + // all input should have extra whitespace removed. + safeRe[i] = new RegExp(makeSafeRe(src[i])) } } @@ -4269,7 +4307,7 @@ function parse (version, options) { return null } - var r = options.loose ? re[t.LOOSE] : re[t.FULL] + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL] if (!r.test(version)) { return null } @@ -4324,7 +4362,7 @@ function SemVer (version, options) { this.options = options this.loose = !!options.loose - var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) @@ -4769,6 +4807,7 @@ function Comparator (comp, options) { return new Comparator(comp, options) } + comp = comp.trim().split(/\s+/).join(' ') debug('comparator', comp, options) this.options = options this.loose = !!options.loose @@ -4785,7 +4824,7 @@ function Comparator (comp, options) { var ANY = {} Comparator.prototype.parse = function (comp) { - var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] var m = comp.match(r) if (!m) { @@ -4909,9 +4948,16 @@ function Range (range, options) { this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease - // First, split based on boolean or || + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. this.raw = range - this.set = range.split(/\s*\|\|\s*/).map(function (range) { + .trim() + .split(/\s+/) + .join(' ') + + // First, split based on boolean or || + this.set = this.raw.split('||').map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason @@ -4919,7 +4965,7 @@ function Range (range, options) { }) if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range) + throw new TypeError('Invalid SemVer Range: ' + this.raw) } this.format() @@ -4938,20 +4984,19 @@ Range.prototype.toString = function () { Range.prototype.parseRange = function (range) { var loose = this.options.loose - range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, safeRe[t.COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') @@ -4959,7 +5004,7 @@ Range.prototype.parseRange = function (range) { // At this point, the range is completely trimmed and // ready to be split into comparators. - var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) @@ -5059,7 +5104,7 @@ function replaceTildes (comp, options) { } function replaceTilde (comp, options) { - var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret @@ -5100,7 +5145,7 @@ function replaceCarets (comp, options) { function replaceCaret (comp, options) { debug('caret', comp, options) - var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret @@ -5159,7 +5204,7 @@ function replaceXRanges (comp, options) { function replaceXRange (comp, options) { comp = comp.trim() - var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) @@ -5234,7 +5279,7 @@ function replaceXRange (comp, options) { function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[t.STAR], '') + return comp.trim().replace(safeRe[t.STAR], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) @@ -5560,7 +5605,7 @@ function coerce (version, options) { var match = null if (!options.rtl) { - match = version.match(re[t.COERCE]) + match = version.match(safeRe[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. @@ -5571,17 +5616,17 @@ function coerce (version, options) { // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. var next - while ((next = re[t.COERCERTL].exec(version)) && + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } - re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state - re[t.COERCERTL].lastIndex = -1 + safeRe[t.COERCERTL].lastIndex = -1 } if (match === null) { diff --git a/dist/main.cjs b/dist/main.cjs index 8ea91a8..6cbdb74 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -5803,7 +5803,7 @@ main$body(args) { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.dynamic), - $async$returnValue, $async$handler = 2, $async$currentError, sdk, flavor, raw, os, architecture, version, channel, versionPrefix, url, toolName, sdkPath, archivePath, extractedFolder, pubCache, error, t1, t2, exception, version0, t3, t4, versionFilePath, $async$exception, $async$exception1; + $async$returnValue, $async$handler = 2, $async$currentError, sdk, flavor, raw, os, architecture, version, channel, versionPrefix, url, toolName, sdkPath, archivePath, extractedFolder, pubCache, e, t1, t2, exception, t3, t4, versionFilePath, $async$exception, $async$exception1; var $async$main = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$currentError = $async$result; @@ -5888,7 +5888,6 @@ return A._asyncAwait(A.latestPublishedVersion(channel, flavor), $async$main); case 25: // returning from await. - version = $async$result; $async$handler = 4; // goto after finally $async$goto = 24; @@ -5902,8 +5901,6 @@ return A._asyncAwait(A.latestPublishedVersion(channel, flavor), $async$main); case 26: // returning from await. - version0 = $async$result; - version = version0; // goto after finally $async$goto = 24; break; @@ -5914,6 +5911,7 @@ break; case 24: // after finally + version = "latest"; // goto join $async$goto = 19; break; @@ -5999,9 +5997,11 @@ // catch $async$handler = 3; $async$exception1 = $async$currentError; - error = A.unwrapException($async$exception1); + e = A.unwrapException($async$exception1); t1 = self; - type$.JSObject._as(t1.core).setFailed(A.S(error)); + t2 = type$.JSObject; + t2._as(t1.core).error(A.S(e)); + t2._as(t1.core).setFailed(A.S(e)); // goto after finally $async$goto = 6; break; diff --git a/dist/sig.txt b/dist/sig.txt index 3f36bfa..6da5b42 100644 --- a/dist/sig.txt +++ b/dist/sig.txt @@ -1 +1 @@ -4851367C299B4A77E33C437F57AEBF33 +5146EC504C34CF623AC70BDB8BB5D1F6 diff --git a/lib/main.dart b/lib/main.dart index b38a7d8..f7cbcd4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -62,11 +62,12 @@ void main(List args) async { // rename from `be` to `main` (also tracked as b/299435467). try { channel = 'main'; - version = await latestPublishedVersion(channel, flavor); + await latestPublishedVersion(channel, flavor); } catch (_) { channel = 'be'; - version = await latestPublishedVersion(channel, flavor); + await latestPublishedVersion(channel, flavor); } + version = 'latest'; } else { version = sdk; @@ -129,8 +130,9 @@ void main(List args) async { 'dart', ['--version'.toJS].toJS, )); - } catch (error) { - core.setFailed('$error'); + } catch (e) { + core.error('$e'); + core.setFailed('$e'); } } diff --git a/package-lock.json b/package-lock.json index 33ff359..1701304 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,16 +9,16 @@ "version": "0.0.0", "license": "BSD", "dependencies": { - "@actions/core": "^1.10.0", + "@actions/core": "^1.10.1", "@actions/exec": "^1.1.1", "@actions/http-client": "^2.1.1", "@actions/tool-cache": "^2.0.1" } }, "node_modules/@actions/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", - "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz", + "integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==", "dependencies": { "@actions/http-client": "^2.0.1", "uuid": "^8.3.2" diff --git a/package.json b/package.json index f78f3a4..3d840c5 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ ], "license": "BSD", "dependencies": { - "@actions/core": "^1.10.0", + "@actions/core": "^1.10.1", "@actions/exec": "^1.1.1", "@actions/http-client": "^2.1.1", "@actions/tool-cache": "^2.0.1" From 42243670f57b815f54a172b4c536d7b271def022 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Sat, 16 Sep 2023 12:29:17 -0700 Subject: [PATCH 3/8] add print statements --- dist/main.cjs | 68 +++++++++++++++++++++++++++++++++------------------ dist/sig.txt | 2 +- lib/main.dart | 10 +++++++- 3 files changed, 54 insertions(+), 26 deletions(-) diff --git a/dist/main.cjs b/dist/main.cjs index 6cbdb74..a48241e 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -4225,6 +4225,9 @@ B.JSArray_methods.add$1(parts, penultimateString); B.JSArray_methods.add$1(parts, ultimateString); }, + print(object) { + A.printString(A.S(object)); + }, Uri_parse(uri) { var delta, indices, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, isSimple, scheme, t1, t2, schemeAuth, queryStart0, pathStart0, userInfoStart, userInfo, host, portNumber, port, path, query, _null = null, end = uri.length; @@ -5846,6 +5849,7 @@ case 10: // returning from await. version = $async$result; + A.print("[version=" + A.S(version) + "]"); // goto join $async$goto = 8; break; @@ -5897,10 +5901,6 @@ $async$handler = 21; $async$exception = $async$currentError; channel = "be"; - $async$goto = 26; - return A._asyncAwait(A.latestPublishedVersion(channel, flavor), $async$main); - case 26: - // returning from await. // goto after finally $async$goto = 24; break; @@ -5939,35 +5939,35 @@ url = string$.https_ + A.S(channel) + "/" + A.S(flavor) + "/" + A.S(version) + "/sdk/dartsdk-" + A.S(os) + "-" + A.S(architecture) + "-release.zip"; toolName = A.boolConversionCheck(raw) ? "dart_raw" : "dart"; sdkPath = !A.boolConversionCheck(raw) ? A._asString(t2._as(t1.toolCache).find(toolName, version, architecture)) : ""; - $async$goto = J.get$length$asx(sdkPath) !== 0 ? 27 : 29; + $async$goto = J.get$length$asx(sdkPath) !== 0 ? 26 : 28; break; - case 27: + case 26: // then t2._as(t1.core).info("Using cached sdk from " + A.S(sdkPath) + "."); // goto join - $async$goto = 28; + $async$goto = 27; break; - case 29: + case 28: // else t2._as(t1.core).info(A.S(url) + " ..."); t3 = type$.String; - $async$goto = 30; + $async$goto = 29; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).downloadTool(url)), t3), $async$main); - case 30: + case 29: // returning from await. archivePath = $async$result; - $async$goto = 31; + $async$goto = 30; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).extractZip(archivePath)), t3), $async$main); - case 31: + case 30: // returning from await. extractedFolder = $async$result; extractedFolder = A.join(extractedFolder, "dart-sdk"); - $async$goto = 32; + $async$goto = 31; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.toolCache).cacheDir(extractedFolder, toolName, version, architecture)), t3), $async$main); - case 32: + case 31: // returning from await. sdkPath = $async$result; - case 28: + case 27: // join t3 = t2._as(t1.process); t4 = J.$eq$(os, "windows") ? "USERPROFILE" : "HOME"; @@ -5978,16 +5978,16 @@ t2._as(t1.core).addPath(A.join(sdkPath, "bin")); t2._as(t1.core).exportVariable("PUB_CACHE", pubCache); t2._as(t1.core).addPath(A.join(pubCache, "bin")); - $async$goto = 33; + $async$goto = 32; return A._asyncAwait(A.createPubOIDCToken(), $async$main); - case 33: + case 32: // returning from await. t4 = t2._as(t1.core); versionFilePath = A.join(sdkPath, "version"); t4.setOutput("dart-version", B.JSString_methods.trim$0(A._asString(t2._as(t1.fs).readFileSync(versionFilePath, "utf8")))); - $async$goto = 34; + $async$goto = 33; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["--version"], type$.JSArray_String))), type$.dynamic), $async$main); - case 34: + case 33: // returning from await. $async$handler = 2; // goto after finally @@ -6108,7 +6108,7 @@ findLatestSdkForRelease(sdkRelease) { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.String), - $async$returnValue, versions, semvers, t1, t2, paths, $async$temp1, $async$temp2, $async$temp3; + $async$returnValue, t1, t2, result, paths, versions, semvers, $async$temp1; var $async$findLatestSdkForRelease = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) return A._asyncRethrow($async$result, $async$completer); @@ -6116,23 +6116,28 @@ switch ($async$goto) { case 0: // Function start + A.print("[sdkRelease=" + sdkRelease + "]"); t1 = type$.String; t2 = type$.JSObject; - $async$temp1 = J; - $async$temp2 = type$.List_dynamic; - $async$temp3 = t2; + $async$temp1 = t2; $async$goto = 3; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(new self.HttpClient("setup-dart", A._setArrayType([], type$.JSArray_Object), type$.nullable_JSObject._as(A.jsify(A.LinkedHashMap_LinkedHashMap$_literal(["allowRedirects", true, "maxRedirects", 3, "allowRetries", true, "maxRetries", 3], t1, type$.Object))))).getJson("https://storage.googleapis.com/storage/v1/b/dart-archive/o?prefix=" + ("channels/stable/release/" + sdkRelease + ".") + "&delimiter=/")), t2), $async$findLatestSdkForRelease); case 3: // returning from await. - paths = $async$temp1.cast$1$0$ax($async$temp2._as($async$temp3._as($async$result.result).prefixes), t1); + result = $async$temp1._as($async$result.result); + A.print(result); + paths = J.cast$1$0$ax(type$.List_dynamic._as(result.prefixes), t1); + A.print(paths); t1 = paths.$ti; t2 = t1._eval$1("MappedListIterable"); versions = A.List_List$of(new A.MappedListIterable(paths, t1._eval$1("String(ListBase.E)")._as(new A.findLatestSdkForRelease_closure()), t2), true, t2._eval$1("ListIterable.E")); + A.print(versions); t2 = A._arrayInstanceType(versions); t1 = t2._eval$1("MappedListIterable<1,Version>"); semvers = A.List_List$of(new A.MappedListIterable(versions, t2._eval$1("Version(1)")._as(A.version_Version___parse_tearOff$closure()), t1), true, t1._eval$1("ListIterable.E")); + A.print(semvers); B.JSArray_methods.sort$0(semvers); + A.print(semvers); $async$returnValue = B.JSArray_methods.get$last(semvers)._version$_text; // goto return $async$goto = 1; @@ -6146,6 +6151,21 @@ }, findLatestSdkForRelease_closure: function findLatestSdkForRelease_closure() { }, + printString(string) { + if (typeof dartPrint == "function") { + dartPrint(string); + return; + } + if (typeof console == "object" && typeof console.log != "undefined") { + console.log(string); + return; + } + if (typeof print == "function") { + print(string); + return; + } + throw "Unable to print message: " + String(string); + }, throwLateFieldADI(fieldName) { A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has been assigned during initialization."), new Error()); }, diff --git a/dist/sig.txt b/dist/sig.txt index 6da5b42..2a00234 100644 --- a/dist/sig.txt +++ b/dist/sig.txt @@ -1 +1 @@ -5146EC504C34CF623AC70BDB8BB5D1F6 +F229B73DA2CEE60F5C9CAB6658E7DC4F diff --git a/lib/main.dart b/lib/main.dart index f7cbcd4..c1af3b8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -53,6 +53,7 @@ void main(List args) async { // Find the latest version for 'sdk'. final versionPrefix = sdk.substring(0, sdk.length - '.x'.length); version = await findLatestSdkForRelease(versionPrefix); + print('[version=$version]'); } else if (sdk == 'stable' || sdk == 'beta' || sdk == 'dev') { channel = sdk; version = @@ -65,7 +66,6 @@ void main(List args) async { await latestPublishedVersion(channel, flavor); } catch (_) { channel = 'be'; - await latestPublishedVersion(channel, flavor); } version = 'latest'; } else { @@ -217,6 +217,8 @@ Future latestPublishedVersion(String channel, String flavor) async { /// /// [sdkRelease] must be in the form of `major.minor` (e.g., `2.19`). Future findLatestSdkForRelease(String sdkRelease) async { + print('[sdkRelease=$sdkRelease]'); + final filePrefix = 'channels/stable/release/$sdkRelease.'; final url = 'https://storage.googleapis.com/storage/v1/b/dart-archive/o' '?prefix=$filePrefix&delimiter=/'; @@ -244,11 +246,17 @@ Future findLatestSdkForRelease(String sdkRelease) async { var response = await promiseToFuture(http.getJson(url)); var result = getProperty(response, 'result'); + print(result); + final paths = (getProperty(result, 'prefixes') as List).cast(); + print(paths); final versions = paths.map((p) => p.split('/').last).toList(); + print(versions); // Sort versions by semver and return the highest version. final semvers = versions.map(Version.parse).toList(); + print(semvers); semvers.sort(); + print(semvers); return semvers.last.toString(); } From 6926a463b2fff1fb01c37d93bd6bd9a34747ea45 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Sat, 16 Sep 2023 12:35:32 -0700 Subject: [PATCH 4/8] trim last path element --- dist/main.cjs | 6 +++++- dist/sig.txt | 2 +- lib/main.dart | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/main.cjs b/dist/main.cjs index a48241e..8274634 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -9565,7 +9565,11 @@ }; A.findLatestSdkForRelease_closure.prototype = { call$1(p) { - return B.JSArray_methods.get$last(A._asString(p).split("/")); + var t1 = A._setArrayType(A._asString(p).split("/"), type$.JSArray_String); + if (0 >= t1.length) + return A.ioore(t1, -1); + t1.pop(); + return B.JSArray_methods.get$last(t1); }, $signature: 7 }; diff --git a/dist/sig.txt b/dist/sig.txt index 2a00234..1ae3362 100644 --- a/dist/sig.txt +++ b/dist/sig.txt @@ -1 +1 @@ -F229B73DA2CEE60F5C9CAB6658E7DC4F +F833626974DDE6E215F7004EFBC7E02B diff --git a/lib/main.dart b/lib/main.dart index c1af3b8..172cf95 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -250,7 +250,7 @@ Future findLatestSdkForRelease(String sdkRelease) async { final paths = (getProperty(result, 'prefixes') as List).cast(); print(paths); - final versions = paths.map((p) => p.split('/').last).toList(); + final versions = paths.map((p) => (p.split('/')..removeLast()).last).toList(); print(versions); // Sort versions by semver and return the highest version. From 0cb0bb3bda0f12f0f066bc6b8b9cb018addc297f Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Sat, 16 Sep 2023 12:44:06 -0700 Subject: [PATCH 5/8] remove print statements --- dist/main.cjs | 49 ++++++++++++++----------------------------------- dist/sig.txt | 2 +- lib/main.dart | 21 ++++++++------------- 3 files changed, 23 insertions(+), 49 deletions(-) diff --git a/dist/main.cjs b/dist/main.cjs index 8274634..c67fe55 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -4225,9 +4225,6 @@ B.JSArray_methods.add$1(parts, penultimateString); B.JSArray_methods.add$1(parts, ultimateString); }, - print(object) { - A.printString(A.S(object)); - }, Uri_parse(uri) { var delta, indices, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, isSimple, scheme, t1, t2, schemeAuth, queryStart0, pathStart0, userInfoStart, userInfo, host, portNumber, port, path, query, _null = null, end = uri.length; @@ -5826,7 +5823,7 @@ if (J.get$length$asx(flavor) === 0) flavor = J.$eq$(sdk, "main") ? "raw" : "release"; else if (!J.$eq$(flavor, "raw") && !J.$eq$(flavor, "release")) { - t2._as(t1.core).setFailed("Unrecognized build flavor '" + A.S(flavor) + "'."); + A._fail("Unrecognized build flavor '" + A.S(flavor) + "'."); // goto return $async$goto = 1; break; @@ -5849,7 +5846,6 @@ case 10: // returning from await. version = $async$result; - A.print("[version=" + A.S(version) + "]"); // goto join $async$goto = 8; break; @@ -5923,7 +5919,7 @@ else if (J.contains$1$asx(sdk, "beta")) channel = "beta"; else if (J.contains$1$asx(sdk, "main")) { - t2._as(t1.core).setFailed("Versions cannot be specified for main channel builds."); + A._fail("Versions cannot be specified for main channel builds."); // goto return $async$goto = 1; break; @@ -5998,10 +5994,7 @@ $async$handler = 3; $async$exception1 = $async$currentError; e = A.unwrapException($async$exception1); - t1 = self; - t2 = type$.JSObject; - t2._as(t1.core).error(A.S(e)); - t2._as(t1.core).setFailed(A.S(e)); + A._fail(A.S(e)); // goto after finally $async$goto = 6; break; @@ -6108,7 +6101,7 @@ findLatestSdkForRelease(sdkRelease) { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.String), - $async$returnValue, t1, t2, result, paths, versions, semvers, $async$temp1; + $async$returnValue, versions, semvers, t1, t2, paths, $async$temp1, $async$temp2, $async$temp3; var $async$findLatestSdkForRelease = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) return A._asyncRethrow($async$result, $async$completer); @@ -6116,28 +6109,23 @@ switch ($async$goto) { case 0: // Function start - A.print("[sdkRelease=" + sdkRelease + "]"); t1 = type$.String; t2 = type$.JSObject; - $async$temp1 = t2; + $async$temp1 = J; + $async$temp2 = type$.List_dynamic; + $async$temp3 = t2; $async$goto = 3; return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(new self.HttpClient("setup-dart", A._setArrayType([], type$.JSArray_Object), type$.nullable_JSObject._as(A.jsify(A.LinkedHashMap_LinkedHashMap$_literal(["allowRedirects", true, "maxRedirects", 3, "allowRetries", true, "maxRetries", 3], t1, type$.Object))))).getJson("https://storage.googleapis.com/storage/v1/b/dart-archive/o?prefix=" + ("channels/stable/release/" + sdkRelease + ".") + "&delimiter=/")), t2), $async$findLatestSdkForRelease); case 3: // returning from await. - result = $async$temp1._as($async$result.result); - A.print(result); - paths = J.cast$1$0$ax(type$.List_dynamic._as(result.prefixes), t1); - A.print(paths); + paths = $async$temp1.cast$1$0$ax($async$temp2._as($async$temp3._as($async$result.result).prefixes), t1); t1 = paths.$ti; t2 = t1._eval$1("MappedListIterable"); versions = A.List_List$of(new A.MappedListIterable(paths, t1._eval$1("String(ListBase.E)")._as(new A.findLatestSdkForRelease_closure()), t2), true, t2._eval$1("ListIterable.E")); - A.print(versions); t2 = A._arrayInstanceType(versions); t1 = t2._eval$1("MappedListIterable<1,Version>"); semvers = A.List_List$of(new A.MappedListIterable(versions, t2._eval$1("Version(1)")._as(A.version_Version___parse_tearOff$closure()), t1), true, t1._eval$1("ListIterable.E")); - A.print(semvers); B.JSArray_methods.sort$0(semvers); - A.print(semvers); $async$returnValue = B.JSArray_methods.get$last(semvers)._version$_text; // goto return $async$goto = 1; @@ -6149,22 +6137,13 @@ }); return A._asyncStartSync($async$findLatestSdkForRelease, $async$completer); }, - findLatestSdkForRelease_closure: function findLatestSdkForRelease_closure() { + _fail(message) { + var t1 = self, + t2 = type$.JSObject; + t2._as(t1.core).error(message); + t2._as(t1.core).setFailed(message); }, - printString(string) { - if (typeof dartPrint == "function") { - dartPrint(string); - return; - } - if (typeof console == "object" && typeof console.log != "undefined") { - console.log(string); - return; - } - if (typeof print == "function") { - print(string); - return; - } - throw "Unable to print message: " + String(string); + findLatestSdkForRelease_closure: function findLatestSdkForRelease_closure() { }, throwLateFieldADI(fieldName) { A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has been assigned during initialization."), new Error()); diff --git a/dist/sig.txt b/dist/sig.txt index 1ae3362..6f44c33 100644 --- a/dist/sig.txt +++ b/dist/sig.txt @@ -1 +1 @@ -F833626974DDE6E215F7004EFBC7E02B +BA237C666BF0A9A8A0840D9A015AF090 diff --git a/lib/main.dart b/lib/main.dart index 172cf95..8a06a18 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -29,7 +29,7 @@ void main(List args) async { if (flavor.isEmpty) { flavor = sdk == 'main' ? 'raw' : 'release'; } else if (flavor != 'raw' && flavor != 'release') { - core.setFailed("Unrecognized build flavor '$flavor'."); + _fail("Unrecognized build flavor '$flavor'."); return; } final raw = flavor == 'raw'; @@ -53,7 +53,6 @@ void main(List args) async { // Find the latest version for 'sdk'. final versionPrefix = sdk.substring(0, sdk.length - '.x'.length); version = await findLatestSdkForRelease(versionPrefix); - print('[version=$version]'); } else if (sdk == 'stable' || sdk == 'beta' || sdk == 'dev') { channel = sdk; version = @@ -77,7 +76,7 @@ void main(List args) async { } else if (sdk.contains('beta')) { channel = 'beta'; } else if (sdk.contains('main')) { - core.setFailed('Versions cannot be specified for main channel builds.'); + _fail('Versions cannot be specified for main channel builds.'); return; } else { channel = 'stable'; @@ -131,8 +130,7 @@ void main(List args) async { ['--version'.toJS].toJS, )); } catch (e) { - core.error('$e'); - core.setFailed('$e'); + _fail('$e'); } } @@ -217,8 +215,6 @@ Future latestPublishedVersion(String channel, String flavor) async { /// /// [sdkRelease] must be in the form of `major.minor` (e.g., `2.19`). Future findLatestSdkForRelease(String sdkRelease) async { - print('[sdkRelease=$sdkRelease]'); - final filePrefix = 'channels/stable/release/$sdkRelease.'; final url = 'https://storage.googleapis.com/storage/v1/b/dart-archive/o' '?prefix=$filePrefix&delimiter=/'; @@ -246,17 +242,16 @@ Future findLatestSdkForRelease(String sdkRelease) async { var response = await promiseToFuture(http.getJson(url)); var result = getProperty(response, 'result'); - print(result); - final paths = (getProperty(result, 'prefixes') as List).cast(); - print(paths); final versions = paths.map((p) => (p.split('/')..removeLast()).last).toList(); - print(versions); // Sort versions by semver and return the highest version. final semvers = versions.map(Version.parse).toList(); - print(semvers); semvers.sort(); - print(semvers); return semvers.last.toString(); } + +void _fail(String message) { + core.error(message); + core.setFailed(message); +} From 60b915e5d9ed677aa61a0e64bd811c3f5401d2dd Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Sat, 16 Sep 2023 12:58:06 -0700 Subject: [PATCH 6/8] update to the latest package:dart_flutter_team_lints --- dist/main.cjs | 4 ++-- dist/sig.txt | 2 +- lib/main.dart | 4 ++-- pubspec.yaml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/main.cjs b/dist/main.cjs index c67fe55..3a1e43c 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -5982,7 +5982,7 @@ versionFilePath = A.join(sdkPath, "version"); t4.setOutput("dart-version", B.JSString_methods.trim$0(A._asString(t2._as(t1.fs).readFileSync(versionFilePath, "utf8")))); $async$goto = 33; - return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["--version"], type$.JSArray_String))), type$.dynamic), $async$main); + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["--version"], type$.JSArray_String))), type$.void), $async$main); case 33: // returning from await. $async$handler = 2; @@ -6059,7 +6059,7 @@ token = $async$result; t2._as(t1.core).exportVariable("PUB_TOKEN", token); $async$goto = 4; - return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["pub", "token", "add", "https://pub.dev", "--env-var", "PUB_TOKEN"], type$.JSArray_String))), type$.dynamic), $async$createPubOIDCToken); + return A._asyncAwait(A.promiseToFuture(t2._as(t2._as(t1.exec).exec("dart", A._setArrayType(["pub", "token", "add", "https://pub.dev", "--env-var", "PUB_TOKEN"], type$.JSArray_String))), type$.void), $async$createPubOIDCToken); case 4: // returning from await. case 1: diff --git a/dist/sig.txt b/dist/sig.txt index 6f44c33..82f052f 100644 --- a/dist/sig.txt +++ b/dist/sig.txt @@ -1 +1 @@ -BA237C666BF0A9A8A0840D9A015AF090 +289E547227CCE48CBC1FCE1AEF86592A diff --git a/lib/main.dart b/lib/main.dart index 8a06a18..4bad49d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -125,7 +125,7 @@ void main(List args) async { core.setOutput('dart-version', getVersionFromSdk(sdkPath)); // Report success; print version. - await promiseToFuture(exec.exec( + await promiseToFuture(exec.exec( 'dart', ['--version'.toJS].toJS, )); @@ -169,7 +169,7 @@ Future createPubOIDCToken() async { core.exportVariable('PUB_TOKEN', token); - await promiseToFuture(exec.exec( + await promiseToFuture(exec.exec( 'dart', [ 'pub'.toJS, diff --git a/pubspec.yaml b/pubspec.yaml index 730d430..2fe441f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,4 +13,4 @@ dependencies: dev_dependencies: args: ^2.4.0 crypto: ^3.0.0 - dart_flutter_team_lints: ^1.0.0 + dart_flutter_team_lints: ^2.0.0 From 358531fd5d0dd3885d23f8683189273e0567de64 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 27 Sep 2023 16:47:15 -0700 Subject: [PATCH 7/8] change the wildcard format to '2.19' --- .github/workflows/dart.yml | 2 +- CHANGELOG.md | 2 +- README.md | 4 ++-- action.yml | 6 ++---- dist/main.cjs | 20 ++++++++++---------- dist/sig.txt | 2 +- lib/main.dart | 8 ++++---- 7 files changed, 21 insertions(+), 23 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 9307b30..22e1ae6 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -94,7 +94,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - sdk: [2.19.x, 3.1.x] + sdk: [2.19, 3.1] fail-fast: false steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e13c35..e54287a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v1.5.2-wip +## v1.6.0 * Add support for specifying a wildcard format for provisioning the latest patch release of an SDK. diff --git a/README.md b/README.md index 8afa828..77013b9 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ The action takes the following inputs: * A release channel, which will install the latest build from that channel. Available channels are `stable`, `beta`, `dev`, and `main`. See the [Dart SDK archive](https://dart.dev/get-dart/archive) for details. - * A wildcard form for the latest patch release for a specific SDK version. - E.g., `2.19.x` will get the latest patch release for the 2.19 SDK. + * An SDK release version - e.g. `2.19` or `3.1`. This will install the + latest patch release for that specific release version. * A specific SDK version, e.g. `2.19.0` or `2.12.0-1.4.beta`. * `flavor`: Which build flavor to setup. diff --git a/action.yml b/action.yml index 8242d33..5d3e1a2 100644 --- a/action.yml +++ b/action.yml @@ -7,10 +7,8 @@ inputs: sdk: description: >- This can be either the channel to install (i.e., 'stable', 'beta', 'dev'), - a wildcard format for the latest patch release (i.e., `2.19.x`, `3.1.x`), - or a specific sdk version to install (i.e, '2.19.1', '3.0.0-1.4.beta'). - Using one of the named channels instead of a version will give you the - latest version published of that channel. + an SDK release version (i.e., `2.19`, `3.1`), or a specific SDK version + (i.e, '2.19.1', '3.0.0-1.4.beta'). required: false default: "stable" architecture: diff --git a/dist/main.cjs b/dist/main.cjs index 3a1e43c..3973f14 100644 --- a/dist/main.cjs +++ b/dist/main.cjs @@ -1,4 +1,4 @@ -// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.2.0-170.0.dev. +// Generated by dart2js (NullSafetyMode.sound, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.2.0-199.0.dev. // The code supports the following hooks: // dartPrint(message): // if this function is defined it is called instead of the Dart [print] @@ -504,14 +504,11 @@ elementAt$1$ax(receiver, a0) { return J.getInterceptor$ax(receiver).elementAt$1(receiver, a0); }, - endsWith$1$s(receiver, a0) { - return J.getInterceptor$s(receiver).endsWith$1(receiver, a0); - }, map$1$1$ax(receiver, a0, $T1) { return J.getInterceptor$ax(receiver).map$1$1(receiver, a0, $T1); }, - substring$2$s(receiver, a0, a1) { - return J.getInterceptor$s(receiver).substring$2(receiver, a0, a1); + split$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).split$1(receiver, a0); }, toString$0$(receiver) { return J.getInterceptor$(receiver).toString$0(receiver); @@ -5803,7 +5800,7 @@ main$body(args) { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.dynamic), - $async$returnValue, $async$handler = 2, $async$currentError, sdk, flavor, raw, os, architecture, version, channel, versionPrefix, url, toolName, sdkPath, archivePath, extractedFolder, pubCache, e, t1, t2, exception, t3, t4, versionFilePath, $async$exception, $async$exception1; + $async$returnValue, $async$handler = 2, $async$currentError, sdk, flavor, raw, os, architecture, version, channel, url, toolName, sdkPath, archivePath, extractedFolder, pubCache, e, t1, t2, exception, t3, t4, versionFilePath, $async$exception, $async$exception1; var $async$main = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) { $async$currentError = $async$result; @@ -5835,14 +5832,13 @@ architecture = B.JSArray_methods.contains$1(B.List_x64_ia32_arm_arm64, A._asString(t2._as(t1.os).arch())) ? A._asString(t2._as(t1.os).arch()) : "x64"; version = null; channel = null; - $async$goto = J.endsWith$1$s(sdk, ".x") ? 7 : 9; + $async$goto = J.split$1$s(sdk, ".").length === 2 ? 7 : 9; break; case 7: // then channel = "stable"; - versionPrefix = J.substring$2$s(sdk, 0, J.get$length$asx(sdk) - 2); $async$goto = 10; - return A._asyncAwait(A.findLatestSdkForRelease(versionPrefix), $async$main); + return A._asyncAwait(A.findLatestSdkForRelease(sdk), $async$main); case 10: // returning from await. version = $async$result; @@ -6543,6 +6539,10 @@ return false; return other === this.substring$1(receiver, t1 - otherLength); }, + split$1(receiver, pattern) { + var t1 = A._setArrayType(receiver.split(pattern), type$.JSArray_String); + return t1; + }, replaceRange$3(receiver, start, end, replacement) { var e = A.RangeError_checkValidRange(start, end, receiver.length); return receiver.substring(0, start) + replacement + receiver.substring(e); diff --git a/dist/sig.txt b/dist/sig.txt index 82f052f..4d8bc24 100644 --- a/dist/sig.txt +++ b/dist/sig.txt @@ -1 +1 @@ -289E547227CCE48CBC1FCE1AEF86592A +593DCF2BE4538C54412F6D8B0953D4B3 diff --git a/lib/main.dart b/lib/main.dart index 4bad49d..7e58c1d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -47,12 +47,12 @@ void main(List args) async { String version; String channel; - if (sdk.endsWith('.x')) { + if (sdk.split('.').length == 2) { + // Handle the wildcard (`2.19`, `3.1`, ...) format. channel = 'stable'; - // Find the latest version for 'sdk'. - final versionPrefix = sdk.substring(0, sdk.length - '.x'.length); - version = await findLatestSdkForRelease(versionPrefix); + // Find the latest version for the given sdk release. + version = await findLatestSdkForRelease(sdk); } else if (sdk == 'stable' || sdk == 'beta' || sdk == 'dev') { channel = sdk; version = From 22f2a70a69609d1c35b4b557af5b49ce5402496c Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 28 Sep 2023 20:32:52 -0700 Subject: [PATCH 8/8] review feedback --- .github/workflows/dart.yml | 4 ++-- CHANGELOG.md | 4 ++-- README.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 22e1ae6..dae5275 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -89,8 +89,8 @@ jobs: dart hello.dart - run: dart --version - # Test using wildcard versions for the sdk parameter. - test_release_wildcards: + # Test getting the latest patch release for a major.minor sdk parameter. + test_latest_patch_release: runs-on: ubuntu-latest strategy: matrix: diff --git a/CHANGELOG.md b/CHANGELOG.md index e54287a..d0a67e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## v1.6.0 -* Add support for specifying a wildcard format for provisioning the latest patch - release of an SDK. +* Enable provisioning of the latest Dart SDK patch release by specifying just + the major and minor version (e.g. `3.2`). ## v1.5.1 diff --git a/README.md b/README.md index 77013b9..99dc19f 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - sdk: [3.1.x, stable, beta, dev] + sdk: [3.1, stable, beta, dev] steps: - uses: actions/checkout@v3 - uses: dart-lang/setup-dart@v1