diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index e00e6457782407..64eb7ddad23988 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -34,7 +34,7 @@ jobs: if: github.event.pull_request.draft == false strategy: matrix: - windows: [windows-2019] + windows: [windows-2019, windows-2022] fail-fast: false runs-on: ${{ matrix.windows }} steps: diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index 5c127eb482d2f7..3dd8d01565c8cb 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -37,7 +37,7 @@ permissions: jobs: coverage-windows: if: github.event.pull_request.draft == false - runs-on: windows-2019 + runs-on: windows-2022 steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index a056aa705bd246..ab7902eec9709e 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -78,8 +78,8 @@ jobs: ./tools/update-undici.sh fi - id: postject - subsystem: deps - label: dependencies + subsystem: test + label: test run: | NEW_VERSION=$(npm view postject dist-tags.latest) CURRENT_VERSION=$(node -p "require('./test/fixtures/postject-copy/node_modules/postject/package.json').version") diff --git a/.mailmap b/.mailmap index 458458f3bacf76..3734a39085e322 100644 --- a/.mailmap +++ b/.mailmap @@ -4,6 +4,7 @@ Aaron Heckmann Aayush Ahuja Abe Fettig Abhimanyu Vashisht +Adam Langley Akhil Marsonya Akhil Marsonya <16393876+marsonya@users.noreply.github.com> Akito Ito diff --git a/AUTHORS b/AUTHORS index 0ac475b8289dc0..71fc5dc4ed7b89 100644 --- a/AUTHORS +++ b/AUTHORS @@ -908,7 +908,7 @@ Jeff Harris Alexander Makarenko Drew Folta Dmitriy Lazarev -Adam Langley +Adam Langley Kári Tristan Helgason Manuel Valls Prayag Verma @@ -3595,5 +3595,15 @@ Aaron Friel Vaishno Chaitanya Jonathan Diaz <50384299+jdiaz-dev@users.noreply.github.com> Mike Roth +Almeida +Kevin Eady <8634912+KevinEady@users.noreply.github.com> +Mordy Tikotzky +vitpavlenko +Tim Gerk +Suyash Nayan <89125422+7suyash7@users.noreply.github.com> +0xflotus <0xflotus@gmail.com> +Alec Mev +Miguel Teixeira +José Dapena Paz # Generated by tools/update-authors.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index a5a237ca0fa58c..9cfe09a722b1c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,7 +33,8 @@ release. -18.14.2
+18.15.0
+18.14.2
18.14.1
18.14.0
18.13.0
diff --git a/Makefile b/Makefile index 94013466239e9c..41a8dc13e0a4f4 100644 --- a/Makefile +++ b/Makefile @@ -595,6 +595,12 @@ test-message: test-build test-wpt: all $(PYTHON) tools/test.py $(PARALLEL_ARGS) wpt +.PHONY: test-wpt-report +test-wpt-report: + $(RM) -r out/wpt + mkdir -p out/wpt + WPT_REPORT=1 $(PYTHON) tools/test.py --shell $(NODE) $(PARALLEL_ARGS) wpt + .PHONY: test-simple test-simple: | cctest # Depends on 'all'. $(PYTHON) tools/test.py $(PARALLEL_ARGS) parallel sequential diff --git a/README.md b/README.md index fb3f183934db00..50876a6b0f820c 100644 --- a/README.md +++ b/README.md @@ -324,8 +324,6 @@ For information about the governance of the Node.js project, see **Adrian Estrada** <> (he/him) * [erickwendel](https://github.com/erickwendel) - **Erick Wendel** <> (he/him) -* [evanlucas](https://github.com/evanlucas) - - **Evan Lucas** <> (he/him) * [fhinkel](https://github.com/fhinkel) - **Franziska Hinkelmann** <> (she/her) * [F3n67u](https://github.com/F3n67u) - @@ -512,6 +510,8 @@ For information about the governance of the Node.js project, see **Alexander Makarenko** <> * [eugeneo](https://github.com/eugeneo) - **Eugene Ostroukhov** <> +* [evanlucas](https://github.com/evanlucas) - + **Evan Lucas** <> (he/him) * [firedfox](https://github.com/firedfox) - **Daniel Wang** <> * [Fishrock123](https://github.com/Fishrock123) - diff --git a/benchmark/.eslintrc.yaml b/benchmark/.eslintrc.yaml index 821b2381d3e215..f7325c20e7c870 100644 --- a/benchmark/.eslintrc.yaml +++ b/benchmark/.eslintrc.yaml @@ -5,11 +5,29 @@ env: es6: true rules: - comma-dangle: [error, { - arrays: always-multiline, - exports: only-multiline, - functions: only-multiline, - imports: only-multiline, - objects: only-multiline, - }] prefer-arrow-callback: error + +overrides: + - files: + - async_hooks/*.js + - buffers/*.js + - buffers-fill/*.js + - crypto/*.js + - fs/*.js + - http/*.js + - http2/*.js + - misc/*.js + - module/*.js + - net/*.js + - path/*.js + - process/*.js + - url/*.js + - util/*.js + rules: + comma-dangle: [error, { + arrays: always-multiline, + exports: always-multiline, + functions: only-multiline, + imports: always-multiline, + objects: only-multiline, + }] diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index e8c5ee7711ab33..3c8997e73a8d2d 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -106,7 +106,7 @@ class TestDoubleBenchmarker { const scheme = options.scheme || 'http'; const env = { test_url: `${scheme}://127.0.0.1:${options.port}${options.path}`, - ...process.env + ...process.env, }; const child = child_process.fork(this.executable, @@ -203,7 +203,7 @@ exports.run = function(options, callback) { connections: 100, duration: 5, benchmarker: exports.default_http_benchmarker, - ...options + ...options, }; if (!options.benchmarker) { callback(new Error('Could not locate required http benchmarker. See ' + diff --git a/benchmark/assert/deepequal-map.js b/benchmark/assert/deepequal-map.js index 77408e3d103475..0b08c82c499a57 100644 --- a/benchmark/assert/deepequal-map.js +++ b/benchmark/assert/deepequal-map.js @@ -46,7 +46,7 @@ function main({ n, len, method, strict }) { } case 'deepEqual_mixed': { const values = array.map( - (_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123] + (_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123], ); benchmark(strict ? deepStrictEqual : deepEqual, n, values); break; @@ -67,7 +67,7 @@ function main({ n, len, method, strict }) { } case 'notDeepEqual_mixed': { const values = array.map( - (_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123] + (_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123], ); const values2 = values.slice(0); values2[0] = ['w00t', 123]; diff --git a/benchmark/blob/blob.js b/benchmark/blob/blob.js index e63a18c84830ce..7e5ea5d7cc2fae 100644 --- a/benchmark/blob/blob.js +++ b/benchmark/blob/blob.js @@ -5,7 +5,7 @@ const { Blob } = require('buffer'); const bench = common.createBenchmark(main, { bytes: [128, 1024, 1024 ** 2], n: [1e6], - operation: ['text', 'arrayBuffer'] + operation: ['text', 'arrayBuffer'], }); async function run(n, bytes, operation) { diff --git a/benchmark/blob/file.js b/benchmark/blob/file.js index 42f866b1ad8ce8..001de1be1157f9 100644 --- a/benchmark/blob/file.js +++ b/benchmark/blob/file.js @@ -5,7 +5,7 @@ const { File } = require('buffer'); const bench = common.createBenchmark(main, { bytes: [128, 1024, 1024 ** 2], n: [1e6], - operation: ['text', 'arrayBuffer'] + operation: ['text', 'arrayBuffer'], }); const options = { diff --git a/benchmark/buffers/buffer-copy.js b/benchmark/buffers/buffer-copy.js index 164f31420766d5..054f72ef41cf7f 100644 --- a/benchmark/buffers/buffer-copy.js +++ b/benchmark/buffers/buffer-copy.js @@ -5,6 +5,12 @@ const bench = common.createBenchmark(main, { bytes: [0, 8, 128, 32 * 1024], partial: ['true', 'false'], n: [6e6] +}, { + combinationFilter: (p) => { + return (p.partial === 'false' && p.bytes === 0) || + (p.partial !== 'false' && p.bytes !== 0); + }, + test: { partial: 'false', bytes: 0 }, }); function main({ n, bytes, partial }) { diff --git a/benchmark/buffers/buffer-indexof.js b/benchmark/buffers/buffer-indexof.js index 4c0993a1ef0ef9..1b02a8bb7d9d38 100644 --- a/benchmark/buffers/buffer-indexof.js +++ b/benchmark/buffers/buffer-indexof.js @@ -19,9 +19,14 @@ const searchStrings = [ const bench = common.createBenchmark(main, { search: searchStrings, - encoding: ['utf8', 'ucs2'], + encoding: ['undefined', 'utf8', 'ucs2'], type: ['buffer', 'string'], n: [5e4] +}, { + combinationFilter: (p) => { + return (p.type === 'buffer' && p.encoding === 'undefined') || + (p.type !== 'buffer' && p.encoding !== 'undefined'); + }, }); function main({ n, search, encoding, type }) { diff --git a/benchmark/buffers/buffer-tostring.js b/benchmark/buffers/buffer-tostring.js index 98d6ab3fa08311..ac4e7f6c86e010 100644 --- a/benchmark/buffers/buffer-tostring.js +++ b/benchmark/buffers/buffer-tostring.js @@ -3,10 +3,15 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - encoding: ['utf8', 'ascii', 'latin1', 'hex', 'UCS-2'], + encoding: ['', 'utf8', 'ascii', 'latin1', 'hex', 'UCS-2'], args: [0, 1, 3], len: [1, 64, 1024], n: [1e6] +}, { + combinationFilter: (p) => { + return (p.args === 0 && p.encoding === '') || + (p.args !== 0 && p.encoding !== ''); + }, }); function main({ encoding, args, len, n }) { diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index f750e2cf3e68f2..f68cd6962c7a5e 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -9,7 +9,7 @@ if (!isWindows) messagesLength.push(32768); const bench = common.createBenchmark(childProcessExecStdout, { len: messagesLength, - dur: [5] + dur: [5], }); function childProcessExecStdout({ dur, len }) { diff --git a/benchmark/child_process/child-process-read-ipc.js b/benchmark/child_process/child-process-read-ipc.js index 280505026cd02e..dd8332d9817be4 100644 --- a/benchmark/child_process/child-process-read-ipc.js +++ b/benchmark/child_process/child-process-read-ipc.js @@ -15,7 +15,7 @@ if (process.argv[2] === 'child') { 64, 256, 1024, 4096, 16384, 65536, 65536 << 4, 65536 << 6 - 1, ], - dur: [5] + dur: [5], }); const spawn = require('child_process').spawn; diff --git a/benchmark/child_process/child-process-read.js b/benchmark/child_process/child-process-read.js index 01e9846be22b56..0364009d5320ed 100644 --- a/benchmark/child_process/child-process-read.js +++ b/benchmark/child_process/child-process-read.js @@ -14,7 +14,7 @@ if (os.platform() !== 'win32') const bench = common.createBenchmark(main, { len: messagesLength, - dur: [5] + dur: [5], }); function main({ dur, len }) { diff --git a/benchmark/child_process/spawn-echo.js b/benchmark/child_process/spawn-echo.js index 8f5c80cd23ba18..9b5a32d01ca8b3 100644 --- a/benchmark/child_process/spawn-echo.js +++ b/benchmark/child_process/spawn-echo.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1000] + n: [1000], }); const spawn = require('child_process').spawn; diff --git a/benchmark/cluster/echo.js b/benchmark/cluster/echo.js index 9def87cf8b0e98..bedfa063257d63 100644 --- a/benchmark/cluster/echo.js +++ b/benchmark/cluster/echo.js @@ -8,7 +8,7 @@ if (cluster.isMaster) { payload: ['string', 'object'], sendsPerBroadcast: [1, 10], serialization: ['json', 'advanced'], - n: [1e5] + n: [1e5], }); function main({ @@ -16,7 +16,7 @@ if (cluster.isMaster) { workers, sendsPerBroadcast, payload, - serialization + serialization, }) { const expectedPerBroadcast = sendsPerBroadcast * workers; let readies = 0; diff --git a/benchmark/common.js b/benchmark/common.js index 918eaa5e0adbb4..71c11e21aea1e0 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -3,6 +3,10 @@ const child_process = require('child_process'); const http_benchmarkers = require('./_http-benchmarkers.js'); +function allow() { + return true; +} + class Benchmark { constructor(fn, configs, options = {}) { // Used to make sure a benchmark only start a timer once @@ -31,9 +35,17 @@ class Benchmark { this.flags = this.flags.concat(options.flags); } + if (typeof options.combinationFilter === 'function') + this.combinationFilter = options.combinationFilter; + else + this.combinationFilter = allow; + // The configuration list as a queue of jobs this.queue = this._queue(this.options); + if (this.queue.length === 0) + return; + // The configuration of the current job, head of the queue this.config = this.queue[0]; @@ -96,7 +108,7 @@ class Benchmark { cliOptions[key] = []; cliOptions[key].push( // Infer the type from the config object and parse accordingly - typeof configs[key][0] === 'number' ? +value : value + typeof configs[key][0] === 'number' ? +value : value, ); } else { extraOptions[key] = value; @@ -108,6 +120,7 @@ class Benchmark { _queue(options) { const queue = []; const keys = Object.keys(options); + const { combinationFilter } = this; // Perform a depth-first walk through all options to generate a // configuration list that contains all combinations. @@ -131,7 +144,15 @@ class Benchmark { if (keyIndex + 1 < keys.length) { recursive(keyIndex + 1, currConfig); } else { - queue.push(currConfig); + // Check if we should allow the current combination + const allowed = combinationFilter({ ...currConfig }); + if (typeof allowed !== 'boolean') { + throw new TypeError( + 'Combination filter must always return a boolean', + ); + } + if (allowed) + queue.push(currConfig); } } } @@ -162,7 +183,7 @@ class Benchmark { } this.config.benchmarker = used_benchmarker; this.report(result, elapsed); - } + }, ); } diff --git a/benchmark/compare.js b/benchmark/compare.js index 169948e006d660..503901f607ef02 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -71,7 +71,7 @@ if (showProgress) { const job = queue[i]; const child = fork(path.resolve(__dirname, job.filename), cli.optional.set, { - execPath: cli.optional[job.binary] + execPath: cli.optional[job.binary], }); child.on('message', (data) => { diff --git a/benchmark/dgram/array-vs-concat.js b/benchmark/dgram/array-vs-concat.js index ae9a759a983c04..b5662acfc4033b 100644 --- a/benchmark/dgram/array-vs-concat.js +++ b/benchmark/dgram/array-vs-concat.js @@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, { num: [100], chunks: [1, 2, 4, 8], type: ['concat', 'multi'], - dur: [5] + dur: [5], }); function main({ dur, len, num, type, chunks }) { diff --git a/benchmark/dgram/multi-buffer.js b/benchmark/dgram/multi-buffer.js index add77cd7845ce1..945d02c2d1c0e7 100644 --- a/benchmark/dgram/multi-buffer.js +++ b/benchmark/dgram/multi-buffer.js @@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, { num: [100], chunks: [1, 2, 4, 8], type: ['send', 'recv'], - dur: [5] + dur: [5], }); function main({ dur, len, num, type, chunks }) { diff --git a/benchmark/dgram/offset-length.js b/benchmark/dgram/offset-length.js index eea0b75b773ca8..ac0fee731eab20 100644 --- a/benchmark/dgram/offset-length.js +++ b/benchmark/dgram/offset-length.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { len: [1, 64, 256, 1024], num: [100], type: ['send', 'recv'], - dur: [5] + dur: [5], }); function main({ dur, len, num, type }) { diff --git a/benchmark/dgram/single-buffer.js b/benchmark/dgram/single-buffer.js index b02f785bb052f2..6a7fa3dde22942 100644 --- a/benchmark/dgram/single-buffer.js +++ b/benchmark/dgram/single-buffer.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { len: [1, 64, 256, 1024], num: [100], type: ['send', 'recv'], - dur: [5] + dur: [5], }); function main({ dur, len, num, type }) { diff --git a/benchmark/diagnostics_channel/http.js b/benchmark/diagnostics_channel/http.js index 55fac8a706df15..caf37a05a45c3b 100644 --- a/benchmark/diagnostics_channel/http.js +++ b/benchmark/diagnostics_channel/http.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { chunks: 4, connections: [50, 500], chunkedEnc: 1, - duration: 5 + duration: 5, }); function main({ apm, connections, duration, type, len, chunks, chunkedEnc }) { @@ -24,7 +24,7 @@ function main({ apm, connections, duration, type, len, chunks, chunkedEnc }) { bench.http({ path, connections, - duration + duration, }, () => { server.close(); if (done) done(); @@ -44,14 +44,14 @@ function patch() { if (name === 'request') { als.enterWith({ url: req.url, - start: process.hrtime.bigint() + start: process.hrtime.bigint(), }); res.on('finish', () => { times.push({ ...als.getStore(), statusCode: res.statusCode, - end: process.hrtime.bigint() + end: process.hrtime.bigint(), }); }); } @@ -74,7 +74,7 @@ function diagnostics_channel() { function onStart(req) { als.enterWith({ url: req.url, - start: process.hrtime.bigint() + start: process.hrtime.bigint(), }); } @@ -82,7 +82,7 @@ function diagnostics_channel() { times.push({ ...als.getStore(), statusCode: res.statusCode, - end: process.hrtime.bigint() + end: process.hrtime.bigint(), }); } diff --git a/benchmark/diagnostics_channel/publish.js b/benchmark/diagnostics_channel/publish.js index 31a770c8627919..3a30012ba692b8 100644 --- a/benchmark/diagnostics_channel/publish.js +++ b/benchmark/diagnostics_channel/publish.js @@ -16,7 +16,7 @@ function main({ n, subscribers }) { } const data = { - foo: 'bar' + foo: 'bar', }; bench.start(); diff --git a/benchmark/dns/lookup-promises.js b/benchmark/dns/lookup-promises.js index a74c856cd3461a..e67a5ab9a7ae7f 100644 --- a/benchmark/dns/lookup-promises.js +++ b/benchmark/dns/lookup-promises.js @@ -6,7 +6,7 @@ const { lookup } = require('dns').promises; const bench = common.createBenchmark(main, { name: ['127.0.0.1', '::1'], all: ['true', 'false'], - n: [5e6] + n: [5e6], }); function main({ name, n, all }) { diff --git a/benchmark/dns/lookup.js b/benchmark/dns/lookup.js index 691daa8a879e2b..c9d1c0f7c39aa2 100644 --- a/benchmark/dns/lookup.js +++ b/benchmark/dns/lookup.js @@ -6,7 +6,7 @@ const lookup = require('dns').lookup; const bench = common.createBenchmark(main, { name: ['127.0.0.1', '::1'], all: ['true', 'false'], - n: [5e6] + n: [5e6], }); function main({ name, n, all }) { diff --git a/benchmark/domain/domain-fn-args.js b/benchmark/domain/domain-fn-args.js index 18906a9ce64099..d55658ccdbaabd 100644 --- a/benchmark/domain/domain-fn-args.js +++ b/benchmark/domain/domain-fn-args.js @@ -4,7 +4,7 @@ const domain = require('domain'); const bench = common.createBenchmark(main, { args: [0, 1, 2, 3], - n: [10] + n: [10], }); const bdomain = domain.create(); diff --git a/benchmark/error/node-error.js b/benchmark/error/node-error.js index f672522b2d0a65..3a0aef91f04a06 100644 --- a/benchmark/error/node-error.js +++ b/benchmark/error/node-error.js @@ -5,14 +5,14 @@ const common = require('../common'); const bench = common.createBenchmark(main, { n: [1e7], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ n }) { const { codes: { ERR_INVALID_STATE, - } + }, } = require('internal/errors'); bench.start(); for (let i = 0; i < n; ++i) diff --git a/benchmark/es/defaultparams-bench.js b/benchmark/es/defaultparams-bench.js index fde4cb11ad448a..4befe99177175b 100644 --- a/benchmark/es/defaultparams-bench.js +++ b/benchmark/es/defaultparams-bench.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['withoutdefaults', 'withdefaults'], - n: [1e8] + n: [1e8], }); function oldStyleDefaults(x, y) { diff --git a/benchmark/es/destructuring-bench.js b/benchmark/es/destructuring-bench.js index d412b82757f083..10b61f44b3dcfa 100644 --- a/benchmark/es/destructuring-bench.js +++ b/benchmark/es/destructuring-bench.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['swap', 'destructure'], - n: [1e8] + n: [1e8], }); function runSwapManual(n) { diff --git a/benchmark/es/destructuring-object-bench.js b/benchmark/es/destructuring-object-bench.js index 29c83bd188e89d..23cc8ace1109fc 100644 --- a/benchmark/es/destructuring-object-bench.js +++ b/benchmark/es/destructuring-object-bench.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['normal', 'destructureObject'], - n: [1e8] + n: [1e8], }); function runNormal(n) { diff --git a/benchmark/es/foreach-bench.js b/benchmark/es/foreach-bench.js index 86bd8dff4c0a2c..63280d1c9a9d00 100644 --- a/benchmark/es/foreach-bench.js +++ b/benchmark/es/foreach-bench.js @@ -5,7 +5,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['for', 'for-of', 'for-in', 'forEach'], count: [5, 10, 20, 100], - n: [5e6] + n: [5e6], }); function useFor(n, items, count) { diff --git a/benchmark/es/map-bench.js b/benchmark/es/map-bench.js index 7e5e8824bfecb5..63e58c07d474e0 100644 --- a/benchmark/es/map-bench.js +++ b/benchmark/es/map-bench.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { 'object', 'nullProtoObject', 'nullProtoLiteralObject', 'storageObject', 'fakeMap', 'map', ], - n: [1e6] + n: [1e6], }); function runObject(n) { @@ -72,7 +72,7 @@ function fakeMap() { get(key) { return m[`$${key}`]; }, set(key, val) { m[`$${key}`] = val; }, get size() { return Object.keys(m).length; }, - has(key) { return Object.hasOwn(m, `$${key}`); } + has(key) { return Object.hasOwn(m, `$${key}`); }, }; } diff --git a/benchmark/es/restparams-bench.js b/benchmark/es/restparams-bench.js index 8129bc92533332..219bbdd725f4bb 100644 --- a/benchmark/es/restparams-bench.js +++ b/benchmark/es/restparams-bench.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['copy', 'rest', 'arguments'], - n: [1e8] + n: [1e8], }); function copyArguments() { diff --git a/benchmark/es/spread-assign.js b/benchmark/es/spread-assign.js index c34bb93e762d12..f0dcd56bb606b1 100644 --- a/benchmark/es/spread-assign.js +++ b/benchmark/es/spread-assign.js @@ -6,7 +6,7 @@ const util = require('util'); const bench = common.createBenchmark(main, { method: ['spread', 'assign', '_extend'], count: [5, 10, 20], - n: [1e6] + n: [1e6], }); function main({ n, context, count, rest, method }) { diff --git a/benchmark/es/spread-bench.js b/benchmark/es/spread-bench.js index 284debdfa09ad8..c5191a7879a9e4 100644 --- a/benchmark/es/spread-bench.js +++ b/benchmark/es/spread-bench.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { count: [5, 10, 20], context: ['context', 'null'], rest: [0, 1], - n: [5e6] + n: [5e6], }); function makeTest(count, rest) { diff --git a/benchmark/esm/cjs-parse.js b/benchmark/esm/cjs-parse.js index 325b362a057112..aae8109c2d4e54 100644 --- a/benchmark/esm/cjs-parse.js +++ b/benchmark/esm/cjs-parse.js @@ -9,7 +9,7 @@ const benchmarkDirectory = path.resolve(tmpdir.path, 'benchmark-esm-parse'); const bench = common.createBenchmark(main, { - n: [1e2] + n: [1e2], }); async function main({ n }) { diff --git a/benchmark/events/ee-listeners.js b/benchmark/events/ee-listeners.js index 9de8d04a175b4b..5d21322d09ec7b 100644 --- a/benchmark/events/ee-listeners.js +++ b/benchmark/events/ee-listeners.js @@ -5,7 +5,7 @@ const EventEmitter = require('events').EventEmitter; const bench = common.createBenchmark(main, { n: [5e6], listeners: [5, 50], - raw: ['true', 'false'] + raw: ['true', 'false'], }); function main({ n, listeners, raw }) { diff --git a/benchmark/events/ee-once.js b/benchmark/events/ee-once.js index bd0a39565332b2..a8767c8e54e2d5 100644 --- a/benchmark/events/ee-once.js +++ b/benchmark/events/ee-once.js @@ -4,7 +4,7 @@ const EventEmitter = require('events').EventEmitter; const bench = common.createBenchmark(main, { n: [2e7], - argc: [0, 1, 4, 5] + argc: [0, 1, 4, 5], }); function main({ n, argc }) { diff --git a/benchmark/events/eventtarget.js b/benchmark/events/eventtarget.js index d2c3ad034ff9b4..a834678d2c0fd4 100644 --- a/benchmark/events/eventtarget.js +++ b/benchmark/events/eventtarget.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e6], - listeners: [1, 5, 10] + listeners: [1, 5, 10], }, { flags: ['--expose-internals'] }); function main({ n, listeners }) { diff --git a/benchmark/https/simple.js b/benchmark/https/simple.js index 243546c346f484..3b4af7caf63192 100644 --- a/benchmark/https/simple.js +++ b/benchmark/https/simple.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { c: [50, 500], chunkedEnc: [1, 0], benchmarker: ['test-double-https'], - duration: 5 + duration: 5, }); function main({ type, len, chunks, c, chunkedEnc, duration }) { @@ -21,7 +21,7 @@ function main({ type, len, chunks, c, chunkedEnc, duration }) { path, connections: c, scheme: 'https', - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/napi/function_call/index.js b/benchmark/napi/function_call/index.js index 1e1d159c8ad83a..cde4c7ae223945 100644 --- a/benchmark/napi/function_call/index.js +++ b/benchmark/napi/function_call/index.js @@ -38,7 +38,7 @@ assert(js() === cxx()); const bench = common.createBenchmark(main, { type: ['js', 'cxx', 'napi'], - n: [1e6, 1e7, 5e7] + n: [1e6, 1e7, 5e7], }); function main({ n, type }) { diff --git a/benchmark/os/cpus.js b/benchmark/os/cpus.js index a8aa3ab6cbf46f..5637e786346847 100644 --- a/benchmark/os/cpus.js +++ b/benchmark/os/cpus.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const cpus = require('os').cpus; const bench = common.createBenchmark(main, { - n: [3e4] + n: [3e4], }); function main({ n }) { diff --git a/benchmark/os/loadavg.js b/benchmark/os/loadavg.js index 802e3c99ec0a59..db88c7127aa48e 100644 --- a/benchmark/os/loadavg.js +++ b/benchmark/os/loadavg.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const loadavg = require('os').loadavg; const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/os/networkInterfaces.js b/benchmark/os/networkInterfaces.js index 12e956b7f05ddc..114e47508cfed4 100644 --- a/benchmark/os/networkInterfaces.js +++ b/benchmark/os/networkInterfaces.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const networkInterfaces = require('os').networkInterfaces; const bench = common.createBenchmark(main, { - n: [1e4] + n: [1e4], }); function main({ n }) { diff --git a/benchmark/perf_hooks/resourcetiming.js b/benchmark/perf_hooks/resourcetiming.js index c71cfeae7ef06b..ddc40767b16196 100644 --- a/benchmark/perf_hooks/resourcetiming.js +++ b/benchmark/perf_hooks/resourcetiming.js @@ -18,7 +18,7 @@ function createTimingInfo({ endTime = 0, encodedBodySize = 0, decodedBodySize = 0, - finalConnectionTimingInfo = null + finalConnectionTimingInfo = null, }) { if (finalConnectionTimingInfo !== null) { finalConnectionTimingInfo.domainLookupStartTime = @@ -61,7 +61,7 @@ function test() { 'http://localhost:8080', 'fetch', {}, - '' + '', ); } diff --git a/benchmark/policy/policy-startup.js b/benchmark/policy/policy-startup.js index 1588123d8007d9..9ee84fff4d0452 100644 --- a/benchmark/policy/policy-startup.js +++ b/benchmark/policy/policy-startup.js @@ -4,11 +4,11 @@ const common = require('../common.js'); const configs = { - n: [1024] + n: [1024], }; const options = { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }; const bench = common.createBenchmark(main, configs, options); @@ -25,12 +25,12 @@ function main(conf) { integrity: `sha256-${hash(`// ./_${i}`, 'sha256')}`, dependencies: Object.fromEntries(Array.from({ // Average 3 deps per 4 modules - length: Math.floor((i % 4) / 2) + length: Math.floor((i % 4) / 2), }, (_, ii) => { return [`_${ii}`, `./_${i - ii}`]; })), }]; - }) + }), ); const json = JSON.parse(JSON.stringify({ resources }), (_, o) => { if (o && typeof o === 'object') { diff --git a/benchmark/querystring/querystring-stringify.js b/benchmark/querystring/querystring-stringify.js index d1b724fcf2c14d..28b72a68506fd1 100644 --- a/benchmark/querystring/querystring-stringify.js +++ b/benchmark/querystring/querystring-stringify.js @@ -12,22 +12,22 @@ function main({ type, n }) { noencode: { foo: 'bar', baz: 'quux', - xyzzy: 'thud' + xyzzy: 'thud', }, encodemany: { '\u0080\u0083\u0089': 'bar', '\u008C\u008E\u0099': 'quux', - 'xyzzy': '\u00A5q\u00A3r' + 'xyzzy': '\u00A5q\u00A3r', }, encodelast: { foo: 'bar', baz: 'quux', - xyzzy: 'thu\u00AC' + xyzzy: 'thu\u00AC', }, array: { foo: [], baz: ['bar'], - xyzzy: ['bar', 'quux', 'thud'] + xyzzy: ['bar', 'quux', 'thud'], }, multiprimitives: { foo: false, diff --git a/benchmark/run.js b/benchmark/run.js index a3c9da12f8b9c8..0b63fb930bb000 100644 --- a/benchmark/run.js +++ b/benchmark/run.js @@ -42,7 +42,7 @@ if (format === 'csv') { const filename = benchmarks[i]; const child = fork( path.resolve(__dirname, filename), - cli.test ? ['--test'] : cli.optional.set + cli.test ? ['--test'] : cli.optional.set, ); if (format !== 'csv') { diff --git a/benchmark/streams/creation.js b/benchmark/streams/creation.js index 760ab5c89dca96..0fb0b1ddb696ea 100644 --- a/benchmark/streams/creation.js +++ b/benchmark/streams/creation.js @@ -9,7 +9,7 @@ const { const bench = common.createBenchmark(main, { n: [50e6], - kind: ['duplex', 'readable', 'transform', 'writable'] + kind: ['duplex', 'readable', 'transform', 'writable'], }); function main({ n, kind }) { diff --git a/benchmark/streams/destroy.js b/benchmark/streams/destroy.js index c6811139d8c443..c0717b1dd03a68 100644 --- a/benchmark/streams/destroy.js +++ b/benchmark/streams/destroy.js @@ -9,7 +9,7 @@ const { const bench = common.createBenchmark(main, { n: [1e6], - kind: ['duplex', 'readable', 'transform', 'writable'] + kind: ['duplex', 'readable', 'transform', 'writable'], }); function main({ n, kind }) { diff --git a/benchmark/streams/pipe-object-mode.js b/benchmark/streams/pipe-object-mode.js index 33588819f00a6c..f6f0e5a6ba0016 100644 --- a/benchmark/streams/pipe-object-mode.js +++ b/benchmark/streams/pipe-object-mode.js @@ -4,7 +4,7 @@ const common = require('../common'); const { Readable, Writable } = require('stream'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/streams/pipe.js b/benchmark/streams/pipe.js index 0df1afdbe10134..a19267b4244993 100644 --- a/benchmark/streams/pipe.js +++ b/benchmark/streams/pipe.js @@ -4,7 +4,7 @@ const common = require('../common'); const { Readable, Writable } = require('stream'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/streams/readable-async-iterator.js b/benchmark/streams/readable-async-iterator.js index 3d06eda7458105..e8e8355444069a 100644 --- a/benchmark/streams/readable-async-iterator.js +++ b/benchmark/streams/readable-async-iterator.js @@ -21,7 +21,7 @@ async function main({ n, sync }) { this.push(1); }); } - } + }, }); bench.start(); diff --git a/benchmark/streams/readable-bigread.js b/benchmark/streams/readable-bigread.js index 1bd1dab4edb07f..0d963c6803299e 100644 --- a/benchmark/streams/readable-bigread.js +++ b/benchmark/streams/readable-bigread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [1e3] + n: [1e3], }); function main({ n }) { diff --git a/benchmark/streams/readable-bigunevenread.js b/benchmark/streams/readable-bigunevenread.js index 684986a778aba2..f02c464d71cf9a 100644 --- a/benchmark/streams/readable-bigunevenread.js +++ b/benchmark/streams/readable-bigunevenread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [1e3] + n: [1e3], }); function main({ n }) { diff --git a/benchmark/streams/readable-boundaryread.js b/benchmark/streams/readable-boundaryread.js index edc90d04de161d..5872c62f4aebd1 100644 --- a/benchmark/streams/readable-boundaryread.js +++ b/benchmark/streams/readable-boundaryread.js @@ -5,7 +5,7 @@ const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { n: [200e1], - type: ['string', 'buffer'] + type: ['string', 'buffer'], }); function main({ n, type }) { diff --git a/benchmark/streams/readable-readall.js b/benchmark/streams/readable-readall.js index d14fd7756586e9..b62b1d05b13876 100644 --- a/benchmark/streams/readable-readall.js +++ b/benchmark/streams/readable-readall.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [50e2] + n: [50e2], }); function main({ n }) { diff --git a/benchmark/streams/readable-unevenread.js b/benchmark/streams/readable-unevenread.js index 9da8410131bfff..f12c89617c0a52 100644 --- a/benchmark/streams/readable-unevenread.js +++ b/benchmark/streams/readable-unevenread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [1e3] + n: [1e3], }); function main({ n }) { diff --git a/benchmark/streams/writable-manywrites.js b/benchmark/streams/writable-manywrites.js index 025a5017ee6446..e6ab65162c366c 100644 --- a/benchmark/streams/writable-manywrites.js +++ b/benchmark/streams/writable-manywrites.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { sync: ['yes', 'no'], writev: ['yes', 'no'], callback: ['yes', 'no'], - len: [1024, 32 * 1024] + len: [1024, 32 * 1024], }); function main({ n, sync, writev, callback, len }) { diff --git a/benchmark/string_decoder/string-decoder-create.js b/benchmark/string_decoder/string-decoder-create.js index 641e562fdeab3d..efd01e8bbe7e61 100644 --- a/benchmark/string_decoder/string-decoder-create.js +++ b/benchmark/string_decoder/string-decoder-create.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { encoding: [ 'ascii', 'utf8', 'utf-8', 'base64', 'ucs2', 'UTF-8', 'AscII', 'UTF-16LE', ], - n: [25e6] + n: [25e6], }); function main({ encoding, n }) { diff --git a/benchmark/string_decoder/string-decoder.js b/benchmark/string_decoder/string-decoder.js index afc0dde62e7937..8acb9c15bfd6f3 100644 --- a/benchmark/string_decoder/string-decoder.js +++ b/benchmark/string_decoder/string-decoder.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { encoding: ['ascii', 'utf8', 'base64-utf8', 'base64-ascii', 'utf16le'], inLen: [32, 128, 1024, 4096], chunkLen: [16, 64, 256, 1024], - n: [25e5] + n: [25e5], }); const UTF8_ALPHA = 'Blåbærsyltetøy'; diff --git a/benchmark/timers/immediate.js b/benchmark/timers/immediate.js index 3bd4c097dce5a0..ccd26b86759c1c 100644 --- a/benchmark/timers/immediate.js +++ b/benchmark/timers/immediate.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [5e6], - type: ['depth', 'depth1', 'breadth', 'breadth1', 'breadth4', 'clear'] + type: ['depth', 'depth1', 'breadth', 'breadth1', 'breadth4', 'clear'], }); function main({ n, type }) { diff --git a/benchmark/timers/set-immediate-breadth-args.js b/benchmark/timers/set-immediate-breadth-args.js index 6d556f9186b7c7..cdfeebe94a07a7 100644 --- a/benchmark/timers/set-immediate-breadth-args.js +++ b/benchmark/timers/set-immediate-breadth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/timers/set-immediate-breadth.js b/benchmark/timers/set-immediate-breadth.js index 87bf9ee2c39479..a39b34acfce40e 100644 --- a/benchmark/timers/set-immediate-breadth.js +++ b/benchmark/timers/set-immediate-breadth.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e7] + n: [1e7], }); function main({ n }) { diff --git a/benchmark/timers/set-immediate-depth-args.js b/benchmark/timers/set-immediate-depth-args.js index a01a400d5f4bc5..a6563d439afcd1 100644 --- a/benchmark/timers/set-immediate-depth-args.js +++ b/benchmark/timers/set-immediate-depth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/timers/timers-cancel-unpooled.js b/benchmark/timers/timers-cancel-unpooled.js index 70f8fd96c9cbf1..2e627a0367402e 100644 --- a/benchmark/timers/timers-cancel-unpooled.js +++ b/benchmark/timers/timers-cancel-unpooled.js @@ -4,7 +4,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { n: [1e6], - direction: ['start', 'end'] + direction: ['start', 'end'], }); function main({ n, direction }) { diff --git a/benchmark/timers/timers-insert-unpooled.js b/benchmark/timers/timers-insert-unpooled.js index 5ee255b5e15fd2..ece457e38974bd 100644 --- a/benchmark/timers/timers-insert-unpooled.js +++ b/benchmark/timers/timers-insert-unpooled.js @@ -4,7 +4,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { n: [1e6], - direction: ['start', 'end'] + direction: ['start', 'end'], }); function main({ direction, n }) { diff --git a/benchmark/tls/convertprotocols.js b/benchmark/tls/convertprotocols.js index 87c447436a44db..8a8a44facb80f9 100644 --- a/benchmark/tls/convertprotocols.js +++ b/benchmark/tls/convertprotocols.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const tls = require('tls'); const bench = common.createBenchmark(main, { - n: [1, 50000] + n: [1, 50000], }); function main({ n }) { diff --git a/benchmark/tls/secure-pair.js b/benchmark/tls/secure-pair.js index 08be1f7e46f8ba..1c5dd732d1ca9e 100644 --- a/benchmark/tls/secure-pair.js +++ b/benchmark/tls/secure-pair.js @@ -3,9 +3,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { dur: [5], securing: ['SecurePair', 'TLSSocket', 'clear'], - size: [100, 1024, 1024 * 1024] + size: [100, 1024, 1024 * 1024], }, { - flags: ['--no-warnings'] + flags: ['--no-warnings'], }); const fixtures = require('../../test/common/fixtures'); diff --git a/benchmark/tls/throughput-c2s.js b/benchmark/tls/throughput-c2s.js index 023b42cbeda685..bf71f92aecbcfc 100644 --- a/benchmark/tls/throughput-c2s.js +++ b/benchmark/tls/throughput-c2s.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { dur: [5], type: ['buf', 'asc', 'utf'], - size: [100, 1024, 1024 * 1024, 4 * 1024 * 1024, 16 * 1024 * 1024] + size: [100, 1024, 1024 * 1024, 4 * 1024 * 1024, 16 * 1024 * 1024], }); const fixtures = require('../../test/common/fixtures'); diff --git a/benchmark/tls/throughput-s2c.js b/benchmark/tls/throughput-s2c.js index d3018cf851db75..7fb93c304b20f4 100644 --- a/benchmark/tls/throughput-s2c.js +++ b/benchmark/tls/throughput-s2c.js @@ -5,7 +5,7 @@ const bench = common.createBenchmark(main, { type: ['buf', 'asc', 'utf'], sendchunklen: [256, 32 * 1024, 128 * 1024, 16 * 1024 * 1024], recvbuflen: [0, 64 * 1024, 1024 * 1024], - recvbufgenfn: ['true', 'false'] + recvbufgenfn: ['true', 'false'], }); const fixtures = require('../../test/common/fixtures'); @@ -68,8 +68,8 @@ function main({ dur, type, sendchunklen, recvbuflen, recvbufgenfn }) { buffer, callback: function(nread, buf) { received += nread; - } - } + }, + }, }; } diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js index db50306485aec3..b398bdb3c3d193 100644 --- a/benchmark/tls/tls-connect.js +++ b/benchmark/tls/tls-connect.js @@ -5,7 +5,7 @@ const tls = require('tls'); const common = require('../common.js'); const bench = common.createBenchmark(main, { concurrency: [1, 10], - dur: [5] + dur: [5], }); let clientConn = 0; @@ -43,7 +43,7 @@ function onConnection(conn) { function makeConnection() { const options = { port: common.PORT, - rejectUnauthorized: false + rejectUnauthorized: false, }; const conn = tls.connect(options, () => { clientConn++; diff --git a/benchmark/url/whatwgurl-to-and-from-path.js b/benchmark/url/whatwgurl-to-and-from-path.js new file mode 100644 index 00000000000000..3b87c0670a8fee --- /dev/null +++ b/benchmark/url/whatwgurl-to-and-from-path.js @@ -0,0 +1,30 @@ +'use strict'; +const common = require('../common.js'); +const { fileURLToPath, pathToFileURL } = require('node:url'); +const isWindows = process.platform === 'win32'; + +const bench = common.createBenchmark(main, { + input: isWindows ? [ + 'file:///c/', + ] : [ + 'file:///dev/null', + 'file:///dev/null?key=param&bool', + 'file:///dev/null?key=param&bool#hash', + ], + method: isWindows ? [ + 'fileURLToPath', + ] : [ + 'fileURLToPath', + 'pathToFileURL', + ], + n: [5e6], +}); + +function main({ n, input, method }) { + method = method === 'fileURLOrPath' ? fileURLToPath : pathToFileURL; + bench.start(); + for (let i = 0; i < n; i++) { + method(input); + } + bench.end(n); +} diff --git a/benchmark/v8/get-stats.js b/benchmark/v8/get-stats.js index d5ce102774df6e..21c6efb2f8588d 100644 --- a/benchmark/v8/get-stats.js +++ b/benchmark/v8/get-stats.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { 'getHeapStatistics', 'getHeapSpaceStatistics', ], - n: [1e6] + n: [1e6], }); function main({ method, n }) { diff --git a/benchmark/v8/serialize.js b/benchmark/v8/serialize.js index 331c576a1b490b..c370da49ea7cca 100644 --- a/benchmark/v8/serialize.js +++ b/benchmark/v8/serialize.js @@ -5,7 +5,7 @@ const v8 = require('v8'); const bench = common.createBenchmark(main, { len: [256, 1024 * 16, 1024 * 512], - n: [1e6] + n: [1e6], }); function main({ n, len }) { diff --git a/benchmark/vm/create-context.js b/benchmark/vm/create-context.js index d74cafe6a0a7b0..d9e948f2c9c2e0 100644 --- a/benchmark/vm/create-context.js +++ b/benchmark/vm/create-context.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [100] + n: [100], }); const vm = require('vm'); diff --git a/benchmark/vm/run-in-context.js b/benchmark/vm/run-in-context.js index 980a08e7e56e8c..1234c5609832e7 100644 --- a/benchmark/vm/run-in-context.js +++ b/benchmark/vm/run-in-context.js @@ -5,7 +5,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1], breakOnSigint: [0, 1], - withSigintListener: [0, 1] + withSigintListener: [0, 1], }); const vm = require('vm'); diff --git a/benchmark/vm/run-in-this-context.js b/benchmark/vm/run-in-this-context.js index c612c1ea49ecf6..517812ecfc95e6 100644 --- a/benchmark/vm/run-in-this-context.js +++ b/benchmark/vm/run-in-this-context.js @@ -5,7 +5,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1], breakOnSigint: [0, 1], - withSigintListener: [0, 1] + withSigintListener: [0, 1], }); const vm = require('vm'); diff --git a/benchmark/webstreams/creation.js b/benchmark/webstreams/creation.js index 085faba8b89864..babd9101b60439 100644 --- a/benchmark/webstreams/creation.js +++ b/benchmark/webstreams/creation.js @@ -9,7 +9,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { n: [50e3], - kind: ['ReadableStream', 'TransformStream', 'WritableStream'] + kind: ['ReadableStream', 'TransformStream', 'WritableStream'], }); let rs, ws, ts; diff --git a/benchmark/webstreams/pipe-to.js b/benchmark/webstreams/pipe-to.js index a41b31b5e127ec..2b765bf2051569 100644 --- a/benchmark/webstreams/pipe-to.js +++ b/benchmark/webstreams/pipe-to.js @@ -23,7 +23,7 @@ async function main({ n, highWaterMarkR, highWaterMarkW }) { } else { controller.close(); } - } + }, }); const ws = new WritableStream({ highWaterMark: highWaterMarkW, diff --git a/benchmark/webstreams/readable-async-iterator.js b/benchmark/webstreams/readable-async-iterator.js index 0d7e4737e3a15a..8cdc4785db3dac 100644 --- a/benchmark/webstreams/readable-async-iterator.js +++ b/benchmark/webstreams/readable-async-iterator.js @@ -13,7 +13,7 @@ async function main({ n }) { const rs = new ReadableStream({ pull: function(controller) { controller.enqueue(1); - } + }, }); let x = 0; diff --git a/benchmark/worker/atomics-wait.js b/benchmark/worker/atomics-wait.js index a771b1813731ed..7270f9f01c98ec 100644 --- a/benchmark/worker/atomics-wait.js +++ b/benchmark/worker/atomics-wait.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e7] + n: [1e7], }); function main({ n }) { diff --git a/benchmark/worker/echo.js b/benchmark/worker/echo.js index 7988ffc7e121eb..face91b2b35d23 100644 --- a/benchmark/worker/echo.js +++ b/benchmark/worker/echo.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { workers: [1], payload: ['string', 'object'], sendsPerBroadcast: [1, 10], - n: [1e5] + n: [1e5], }); const workerPath = path.resolve(__dirname, '..', 'fixtures', 'echo.worker.js'); diff --git a/benchmark/worker/messageport.js b/benchmark/worker/messageport.js index 2f0d6f0621e8c8..d689c0d18d3bae 100644 --- a/benchmark/worker/messageport.js +++ b/benchmark/worker/messageport.js @@ -5,7 +5,7 @@ const { MessageChannel } = require('worker_threads'); const bench = common.createBenchmark(main, { payload: ['string', 'object'], style: ['eventtarget', 'eventemitter'], - n: [1e6] + n: [1e6], }); function main(conf) { diff --git a/benchmark/zlib/createInflate.js b/benchmark/zlib/createInflate.js index 30ccaef7a14fb2..a7aa6882cf432a 100644 --- a/benchmark/zlib/createInflate.js +++ b/benchmark/zlib/createInflate.js @@ -5,7 +5,7 @@ const zlib = require('zlib'); const bench = common.createBenchmark(main, { inputLen: [16 * 1024 * 1024], chunkLen: [1024], - n: [1e2] + n: [1e2], }); function main({ n, inputLen, chunkLen }) { diff --git a/benchmark/zlib/creation.js b/benchmark/zlib/creation.js index c2d063c20d8d02..90b22780d2d312 100644 --- a/benchmark/zlib/creation.js +++ b/benchmark/zlib/creation.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { 'BrotliCompress', 'BrotliDecompress', ], options: ['true', 'false'], - n: [5e5] + n: [5e5], }); function main({ n, type, options }) { diff --git a/benchmark/zlib/deflate.js b/benchmark/zlib/deflate.js index 5baedc924d4bc8..ab9ff333224a0e 100644 --- a/benchmark/zlib/deflate.js +++ b/benchmark/zlib/deflate.js @@ -5,7 +5,7 @@ const zlib = require('zlib'); const bench = common.createBenchmark(main, { method: ['createDeflate', 'deflate', 'deflateSync'], inputLen: [1024], - n: [4e5] + n: [4e5], }); function main({ n, method, inputLen }) { diff --git a/benchmark/zlib/inflate.js b/benchmark/zlib/inflate.js index e4642b394468a9..a65b00f78a5059 100644 --- a/benchmark/zlib/inflate.js +++ b/benchmark/zlib/inflate.js @@ -5,7 +5,7 @@ const zlib = require('zlib'); const bench = common.createBenchmark(main, { method: ['inflate', 'inflateSync'], inputLen: [1024], - n: [4e5] + n: [4e5], }); function main({ n, method, inputLen }) { diff --git a/benchmark/zlib/pipe.js b/benchmark/zlib/pipe.js index 76b0ddc6c65a25..a9c86e3de660a9 100644 --- a/benchmark/zlib/pipe.js +++ b/benchmark/zlib/pipe.js @@ -7,12 +7,12 @@ const bench = common.createBenchmark(main, { inputLen: [1024], duration: [5], type: ['string', 'buffer'], - algorithm: ['gzip', 'brotli'] + algorithm: ['gzip', 'brotli'], }, { test: { inputLen: 1024, - duration: 0.2 - } + duration: 0.2, + }, }); function main({ inputLen, duration, type, algorithm }) { diff --git a/common.gypi b/common.gypi index 5372c8d42de531..782c871cffe453 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.22', + 'v8_embedder_string': '-node.25', ##### V8 defaults for Node.js ##### diff --git a/deps/acorn/acorn/CHANGELOG.md b/deps/acorn/acorn/CHANGELOG.md index cf40d7cfd13ce2..ac78102da6ada7 100644 --- a/deps/acorn/acorn/CHANGELOG.md +++ b/deps/acorn/acorn/CHANGELOG.md @@ -1,3 +1,13 @@ +## 8.8.2 (2023-01-23) + +### Bug fixes + +Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`. + +Fix an exception when passing no option object to `parse` or `new Parser`. + +Fix incorrect parse error on `if (0) let\n[astral identifier char]`. + ## 8.8.1 (2022-10-24) ### Bug fixes diff --git a/deps/acorn/acorn/dist/acorn.d.ts b/deps/acorn/acorn/dist/acorn.d.ts index d6d5b824c3e5c8..870d59d814c1f9 100644 --- a/deps/acorn/acorn/dist/acorn.d.ts +++ b/deps/acorn/acorn/dist/acorn.d.ts @@ -11,7 +11,7 @@ declare namespace acorn { [Symbol.iterator](): Iterator } - type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 'latest' + type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 'latest' interface Options { ecmaVersion: ecmaVersion diff --git a/deps/acorn/acorn/dist/acorn.js b/deps/acorn/acorn/dist/acorn.js index 5a291db1552038..f623ebc9e3cf7a 100644 --- a/deps/acorn/acorn/dist/acorn.js +++ b/deps/acorn/acorn/dist/acorn.js @@ -5,13 +5,13 @@ })(this, (function (exports) { 'use strict'; // This file was generated. Do not modify manually! - var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; + var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; // This file was generated. Do not modify manually! - var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; + var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; // This file was generated. Do not modify manually! - var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; // This file was generated. Do not modify manually! var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; @@ -56,6 +56,7 @@ pos += set[i + 1]; if (pos >= code) { return true } } + return false } // Test whether a given character code starts an identifier. @@ -441,7 +442,7 @@ if (options.allowReserved == null) { options.allowReserved = options.ecmaVersion < 5; } - if (opts.allowHashBang == null) + if (!opts || opts.allowHashBang == null) { options.allowHashBang = options.ecmaVersion >= 14; } if (isArray(options.onToken)) { @@ -841,10 +842,10 @@ // Statement) is allowed here. If context is not empty then only a Statement // is allowed. However, `let [` is an explicit negative lookahead for // ExpressionStatement, so special-case it first. - if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral + if (nextCh === 91 || nextCh === 92) { return true } // '[', '/' if (context) { return false } - if (nextCh === 123) { return true } // '{' + if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral if (isIdentifierStart(nextCh, true)) { var pos = next + 1; while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } @@ -1577,7 +1578,7 @@ }; pp$8.parseClassSuper = function(node) { - node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; }; pp$8.enterClassBody = function() { @@ -3122,7 +3123,7 @@ if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); - this.parsePropertyName(prop, refDestructuringErrors); + this.parsePropertyName(prop); } else { isAsync = false; } @@ -3371,7 +3372,7 @@ // when parsing properties), it will also convert keywords into // identifiers. - pp$5.parseIdent = function(liberal, isBinding) { + pp$5.parseIdent = function(liberal) { var node = this.startNode(); if (this.type === types$1.name) { node.name = this.value; @@ -3614,8 +3615,8 @@ return newNode }; - // This file contains Unicode properties extracted from the ECMAScript - // specification. The lists are extracted like so: + // This file contains Unicode properties extracted from the ECMAScript specification. + // The lists are extracted like so: // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) // #table-binary-unicode-properties @@ -3624,12 +3625,15 @@ var ecma11BinaryProperties = ecma10BinaryProperties; var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; var ecma13BinaryProperties = ecma12BinaryProperties; + var ecma14BinaryProperties = ecma13BinaryProperties; + var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, 11: ecma11BinaryProperties, 12: ecma12BinaryProperties, - 13: ecma13BinaryProperties + 13: ecma13BinaryProperties, + 14: ecma14BinaryProperties }; // #table-unicode-general-category-values @@ -3641,12 +3645,15 @@ var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; + var ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm"; + var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, 11: ecma11ScriptValues, 12: ecma12ScriptValues, - 13: ecma13ScriptValues + 13: ecma13ScriptValues, + 14: ecma14ScriptValues }; var data = {}; @@ -3665,7 +3672,7 @@ d.nonBinary.scx = d.nonBinary.Script_Extensions; } - for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { + for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) { var ecmaVersion = list[i]; buildUnicodeData(ecmaVersion); @@ -3676,7 +3683,7 @@ var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; + this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; @@ -5438,8 +5445,6 @@ codePos, "Invalid escape sequence in template string" ); - - return null } default: if (ch >= 48 && ch <= 55) { @@ -5527,7 +5532,7 @@ // Acorn is a tiny, fast JavaScript parser written in JavaScript. - var version = "8.8.1"; + var version = "8.8.2"; Parser.acorn = { Parser: Parser, @@ -5600,6 +5605,4 @@ exports.tokenizer = tokenizer; exports.version = version; - Object.defineProperty(exports, '__esModule', { value: true }); - })); diff --git a/deps/acorn/acorn/dist/acorn.mjs b/deps/acorn/acorn/dist/acorn.mjs index 7ddf96b2a8ebed..1d7e1f9f530b64 100644 --- a/deps/acorn/acorn/dist/acorn.mjs +++ b/deps/acorn/acorn/dist/acorn.mjs @@ -1,11 +1,11 @@ // This file was generated. Do not modify manually! -var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; // This file was generated. Do not modify manually! -var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938]; +var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191]; // This file was generated. Do not modify manually! -var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; +var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; // This file was generated. Do not modify manually! var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; @@ -50,6 +50,7 @@ function isInAstralSet(code, set) { pos += set[i + 1]; if (pos >= code) { return true } } + return false } // Test whether a given character code starts an identifier. @@ -435,7 +436,7 @@ function getOptions(opts) { if (options.allowReserved == null) { options.allowReserved = options.ecmaVersion < 5; } - if (opts.allowHashBang == null) + if (!opts || opts.allowHashBang == null) { options.allowHashBang = options.ecmaVersion >= 14; } if (isArray(options.onToken)) { @@ -835,10 +836,10 @@ pp$8.isLet = function(context) { // Statement) is allowed here. If context is not empty then only a Statement // is allowed. However, `let [` is an explicit negative lookahead for // ExpressionStatement, so special-case it first. - if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral + if (nextCh === 91 || nextCh === 92) { return true } // '[', '/' if (context) { return false } - if (nextCh === 123) { return true } // '{' + if (nextCh === 123 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '{', astral if (isIdentifierStart(nextCh, true)) { var pos = next + 1; while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; } @@ -1571,7 +1572,7 @@ pp$8.parseClassId = function(node, isStatement) { }; pp$8.parseClassSuper = function(node) { - node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; + node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null; }; pp$8.enterClassBody = function() { @@ -3116,7 +3117,7 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) { if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); - this.parsePropertyName(prop, refDestructuringErrors); + this.parsePropertyName(prop); } else { isAsync = false; } @@ -3365,7 +3366,7 @@ pp$5.checkUnreserved = function(ref) { // when parsing properties), it will also convert keywords into // identifiers. -pp$5.parseIdent = function(liberal, isBinding) { +pp$5.parseIdent = function(liberal) { var node = this.startNode(); if (this.type === types$1.name) { node.name = this.value; @@ -3608,8 +3609,8 @@ pp$2.copyNode = function(node) { return newNode }; -// This file contains Unicode properties extracted from the ECMAScript -// specification. The lists are extracted like so: +// This file contains Unicode properties extracted from the ECMAScript specification. +// The lists are extracted like so: // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) // #table-binary-unicode-properties @@ -3618,12 +3619,15 @@ var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; var ecma11BinaryProperties = ecma10BinaryProperties; var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; var ecma13BinaryProperties = ecma12BinaryProperties; +var ecma14BinaryProperties = ecma13BinaryProperties; + var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, 11: ecma11BinaryProperties, 12: ecma12BinaryProperties, - 13: ecma13BinaryProperties + 13: ecma13BinaryProperties, + 14: ecma14BinaryProperties }; // #table-unicode-general-category-values @@ -3635,12 +3639,15 @@ var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Han var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"; var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith"; +var ecma14ScriptValues = ecma13ScriptValues + " Kawi Nag_Mundari Nagm"; + var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, 11: ecma11ScriptValues, 12: ecma12ScriptValues, - 13: ecma13ScriptValues + 13: ecma13ScriptValues, + 14: ecma14ScriptValues }; var data = {}; @@ -3659,7 +3666,7 @@ function buildUnicodeData(ecmaVersion) { d.nonBinary.scx = d.nonBinary.Script_Extensions; } -for (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) { +for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) { var ecmaVersion = list[i]; buildUnicodeData(ecmaVersion); @@ -3670,7 +3677,7 @@ var pp$1 = Parser.prototype; var RegExpValidationState = function RegExpValidationState(parser) { this.parser = parser; this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : ""); - this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion]; + this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; @@ -5432,8 +5439,6 @@ pp.readEscapedChar = function(inTemplate) { codePos, "Invalid escape sequence in template string" ); - - return null } default: if (ch >= 48 && ch <= 55) { @@ -5521,7 +5526,7 @@ pp.readWord = function() { // Acorn is a tiny, fast JavaScript parser written in JavaScript. -var version = "8.8.1"; +var version = "8.8.2"; Parser.acorn = { Parser: Parser, diff --git a/deps/acorn/acorn/dist/bin.js b/deps/acorn/acorn/dist/bin.js index 8e645009450b64..0bf3e5f8d12bda 100644 --- a/deps/acorn/acorn/dist/bin.js +++ b/deps/acorn/acorn/dist/bin.js @@ -4,8 +4,7 @@ var path = require('path'); var fs = require('fs'); var acorn = require('./acorn.js'); -function _interopNamespace(e) { - if (e && e.__esModule) return e; +function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { @@ -18,11 +17,11 @@ function _interopNamespace(e) { } }); } - n["default"] = e; + n.default = e; return Object.freeze(n); } -var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn); +var acorn__namespace = /*#__PURE__*/_interopNamespaceDefault(acorn); var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false; var options = {}; diff --git a/deps/acorn/acorn/package.json b/deps/acorn/acorn/package.json index 579d89f5fff463..ff5daca7f87f31 100644 --- a/deps/acorn/acorn/package.json +++ b/deps/acorn/acorn/package.json @@ -16,7 +16,7 @@ ], "./package.json": "./package.json" }, - "version": "8.8.1", + "version": "8.8.2", "engines": { "node": ">=0.4.0" }, diff --git a/deps/uvwasi/include/uvwasi.h b/deps/uvwasi/include/uvwasi.h index 7fceca3aff3e6b..6d97c88537aa1e 100644 --- a/deps/uvwasi/include/uvwasi.h +++ b/deps/uvwasi/include/uvwasi.h @@ -10,7 +10,7 @@ extern "C" { #define UVWASI_VERSION_MAJOR 0 #define UVWASI_VERSION_MINOR 0 -#define UVWASI_VERSION_PATCH 14 +#define UVWASI_VERSION_PATCH 15 #define UVWASI_VERSION_HEX ((UVWASI_VERSION_MAJOR << 16) | \ (UVWASI_VERSION_MINOR << 8) | \ (UVWASI_VERSION_PATCH)) diff --git a/deps/uvwasi/src/clocks.c b/deps/uvwasi/src/clocks.c index 8dc5d6557ed2b5..b10765da196563 100644 --- a/deps/uvwasi/src/clocks.c +++ b/deps/uvwasi/src/clocks.c @@ -11,38 +11,23 @@ #include "uv_mapping.h" -#define UVWASI__WIN_TIME_AND_RETURN(handle, time) \ +#define UVWASI__WIN_TIME_AND_RETURN(handle, get_times, time) \ do { \ FILETIME create; \ FILETIME exit; \ FILETIME system; \ FILETIME user; \ - SYSTEMTIME sys_system; \ - SYSTEMTIME sys_user; \ - if (0 == GetProcessTimes((handle), &create, &exit, &system, &user)) { \ + if (0 == get_times((handle), &create, &exit, &system, &user)) { \ return uvwasi__translate_uv_error( \ uv_translate_sys_error(GetLastError()) \ ); \ } \ \ - if (0 == FileTimeToSystemTime(&system, &sys_system)) { \ - return uvwasi__translate_uv_error( \ - uv_translate_sys_error(GetLastError()) \ - ); \ - } \ - \ - if (0 == FileTimeToSystemTime(&user, &sys_user)) { \ - return uvwasi__translate_uv_error( \ - uv_translate_sys_error(GetLastError()) \ - ); \ - } \ - \ - (time) = (((uvwasi_timestamp_t)(sys_system.wHour * 3600) + \ - (sys_system.wMinute * 60) + sys_system.wSecond) * NANOS_PER_SEC) + \ - ((uvwasi_timestamp_t)(sys_system.wMilliseconds) * 1000000) + \ - (((uvwasi_timestamp_t)(sys_user.wHour * 3600) + \ - (sys_user.wMinute * 60) + sys_user.wSecond) * NANOS_PER_SEC) + \ - ((uvwasi_timestamp_t)(sys_user.wMilliseconds) * 1000000); \ + /* FILETIME times are in units of 100 nanoseconds */ \ + (time) = (((uvwasi_timestamp_t) \ + system.dwHighDateTime << 32 | system.dwLowDateTime) * 100 + \ + ((uvwasi_timestamp_t) \ + user.dwHighDateTime << 32 | user.dwLowDateTime) * 100); \ return UVWASI_ESUCCESS; \ } while (0) @@ -137,7 +122,7 @@ uvwasi_errno_t uvwasi__clock_gettime_realtime(uvwasi_timestamp_t* time) { uvwasi_errno_t uvwasi__clock_gettime_process_cputime(uvwasi_timestamp_t* time) { #if defined(_WIN32) - UVWASI__WIN_TIME_AND_RETURN(GetCurrentProcess(), *time); + UVWASI__WIN_TIME_AND_RETURN(GetCurrentProcess(), GetProcessTimes, *time); #elif defined(CLOCK_PROCESS_CPUTIME_ID) && \ !defined(__APPLE__) && \ !defined(__sun) @@ -150,7 +135,7 @@ uvwasi_errno_t uvwasi__clock_gettime_process_cputime(uvwasi_timestamp_t* time) { uvwasi_errno_t uvwasi__clock_gettime_thread_cputime(uvwasi_timestamp_t* time) { #if defined(_WIN32) - UVWASI__WIN_TIME_AND_RETURN(GetCurrentThread(), *time); + UVWASI__WIN_TIME_AND_RETURN(GetCurrentThread(), GetThreadTimes, *time); #elif defined(__APPLE__) UVWASI__OSX_THREADTIME_AND_RETURN(*time); #elif defined(CLOCK_THREAD_CPUTIME_ID) && !defined(__sun) && !defined(__PASE__) diff --git a/deps/v8/src/compiler/fast-api-calls.cc b/deps/v8/src/compiler/fast-api-calls.cc index 54dc22e99c864e..55a27f3c4cecb6 100644 --- a/deps/v8/src/compiler/fast-api-calls.cc +++ b/deps/v8/src/compiler/fast-api-calls.cc @@ -83,6 +83,13 @@ OverloadsResolutionResult ResolveOverloads( bool CanOptimizeFastSignature(const CFunctionInfo* c_signature) { USE(c_signature); +#if defined(V8_OS_MACOS) && defined(V8_TARGET_ARCH_ARM64) + // On MacArm64 hardware we don't support passing of arguments on the stack. + if (c_signature->ArgumentCount() > 8) { + return false; + } +#endif // defined(V8_OS_MACOS) && defined(V8_TARGET_ARCH_ARM64) + #ifndef V8_ENABLE_FP_PARAMS_IN_C_LINKAGE if (c_signature->ReturnInfo().GetType() == CTypeInfo::Type::kFloat32 || c_signature->ReturnInfo().GetType() == CTypeInfo::Type::kFloat64) { diff --git a/deps/v8/src/d8/d8-test.cc b/deps/v8/src/d8/d8-test.cc index 270d51f7fe2257..1917026b32c39e 100644 --- a/deps/v8/src/d8/d8-test.cc +++ b/deps/v8/src/d8/d8-test.cc @@ -456,6 +456,19 @@ class FastCApiObject { } #ifdef V8_USE_SIMULATOR_WITH_GENERIC_C_CALLS + static AnyCType AddAll32BitIntFastCallback_8ArgsPatch( + AnyCType receiver, AnyCType should_fallback, AnyCType arg1_i32, + AnyCType arg2_i32, AnyCType arg3_i32, AnyCType arg4_u32, + AnyCType arg5_u32, AnyCType arg6_u32, AnyCType arg7_u32, + AnyCType arg8_u32, AnyCType options) { + AnyCType ret; + ret.int32_value = AddAll32BitIntFastCallback_8Args( + receiver.object_value, should_fallback.bool_value, arg1_i32.int32_value, + arg2_i32.int32_value, arg3_i32.int32_value, arg4_u32.uint32_value, + arg5_u32.uint32_value, arg6_u32.uint32_value, arg7_u32.uint32_value, + arg8_u32.uint32_value, *options.options_value); + return ret; + } static AnyCType AddAll32BitIntFastCallback_6ArgsPatch( AnyCType receiver, AnyCType should_fallback, AnyCType arg1_i32, AnyCType arg2_i32, AnyCType arg3_i32, AnyCType arg4_u32, @@ -479,6 +492,26 @@ class FastCApiObject { } #endif // V8_USE_SIMULATOR_WITH_GENERIC_C_CALLS + static int AddAll32BitIntFastCallback_8Args( + Local receiver, bool should_fallback, int32_t arg1_i32, + int32_t arg2_i32, int32_t arg3_i32, uint32_t arg4_u32, uint32_t arg5_u32, + uint32_t arg6_u32, uint32_t arg7_u32, uint32_t arg8_u32, + FastApiCallbackOptions& options) { + FastCApiObject* self = UnwrapObject(receiver); + CHECK_SELF_OR_FALLBACK(0); + self->fast_call_count_++; + + if (should_fallback) { + options.fallback = true; + return 0; + } + + int64_t result = static_cast(arg1_i32) + arg2_i32 + arg3_i32 + + arg4_u32 + arg5_u32 + arg6_u32 + arg7_u32 + arg8_u32; + if (result > INT_MAX) return INT_MAX; + if (result < INT_MIN) return INT_MIN; + return static_cast(result); + } static int AddAll32BitIntFastCallback_6Args( Local receiver, bool should_fallback, int32_t arg1_i32, int32_t arg2_i32, int32_t arg3_i32, uint32_t arg4_u32, uint32_t arg5_u32, @@ -516,24 +549,29 @@ class FastCApiObject { HandleScope handle_scope(isolate); + Local context = isolate->GetCurrentContext(); double sum = 0; if (args.Length() > 1 && args[1]->IsNumber()) { - sum += args[1]->Int32Value(isolate->GetCurrentContext()).FromJust(); + sum += args[1]->Int32Value(context).FromJust(); } if (args.Length() > 2 && args[2]->IsNumber()) { - sum += args[2]->Int32Value(isolate->GetCurrentContext()).FromJust(); + sum += args[2]->Int32Value(context).FromJust(); } if (args.Length() > 3 && args[3]->IsNumber()) { - sum += args[3]->Int32Value(isolate->GetCurrentContext()).FromJust(); + sum += args[3]->Int32Value(context).FromJust(); } if (args.Length() > 4 && args[4]->IsNumber()) { - sum += args[4]->Uint32Value(isolate->GetCurrentContext()).FromJust(); + sum += args[4]->Uint32Value(context).FromJust(); } if (args.Length() > 5 && args[5]->IsNumber()) { - sum += args[5]->Uint32Value(isolate->GetCurrentContext()).FromJust(); + sum += args[5]->Uint32Value(context).FromJust(); } if (args.Length() > 6 && args[6]->IsNumber()) { - sum += args[6]->Uint32Value(isolate->GetCurrentContext()).FromJust(); + sum += args[6]->Uint32Value(context).FromJust(); + } + if (args.Length() > 7 && args[7]->IsNumber() && args[8]->IsNumber()) { + sum += args[7]->Uint32Value(context).FromJust(); + sum += args[8]->Uint32Value(context).FromJust(); } args.GetReturnValue().Set(Number::New(isolate, sum)); @@ -804,6 +842,9 @@ Local Shell::CreateTestFastCApiTemplate(Isolate* isolate) { signature, 1, ConstructorBehavior::kThrow, SideEffectType::kHasSideEffect, {add_all_invalid_overloads, 2})); + CFunction add_all_32bit_int_8args_c_func = CFunction::Make( + FastCApiObject::AddAll32BitIntFastCallback_8Args V8_IF_USE_SIMULATOR( + FastCApiObject::AddAll32BitIntFastCallback_8ArgsPatch)); CFunction add_all_32bit_int_6args_c_func = CFunction::Make( FastCApiObject::AddAll32BitIntFastCallback_6Args V8_IF_USE_SIMULATOR( FastCApiObject::AddAll32BitIntFastCallback_6ArgsPatch)); @@ -820,6 +861,20 @@ Local Shell::CreateTestFastCApiTemplate(Isolate* isolate) { signature, 1, ConstructorBehavior::kThrow, SideEffectType::kHasSideEffect, {c_function_overloads, 2})); + api_obj_ctor->PrototypeTemplate()->Set( + isolate, "overloaded_add_all_8args", + FunctionTemplate::New( + isolate, FastCApiObject::AddAll32BitIntSlowCallback, Local(), + signature, 1, ConstructorBehavior::kThrow, + SideEffectType::kHasSideEffect, &add_all_32bit_int_8args_c_func)); + + api_obj_ctor->PrototypeTemplate()->Set( + isolate, "overloaded_add_all_32bit_int_no_sig", + FunctionTemplate::NewWithCFunctionOverloads( + isolate, FastCApiObject::AddAll32BitIntSlowCallback, Local(), + Local(), 1, ConstructorBehavior::kThrow, + SideEffectType::kHasSideEffect, {c_function_overloads, 2})); + CFunction add_all_no_options_c_func = CFunction::Make( FastCApiObject::AddAllFastCallbackNoOptions V8_IF_USE_SIMULATOR( FastCApiObject::AddAllFastCallbackNoOptionsPatch)); diff --git a/deps/v8/src/numbers/conversions.cc b/deps/v8/src/numbers/conversions.cc index 0683402794dbe7..93f5ba7be50a75 100644 --- a/deps/v8/src/numbers/conversions.cc +++ b/deps/v8/src/numbers/conversions.cc @@ -12,6 +12,7 @@ #include "src/base/numbers/dtoa.h" #include "src/base/numbers/strtod.h" #include "src/base/platform/wrappers.h" +#include "src/base/small-vector.h" #include "src/bigint/bigint.h" #include "src/common/assert-scope.h" #include "src/handles/handles.h" @@ -970,6 +971,23 @@ class StringToBigIntHelper : public StringToIntHelper { UNREACHABLE(); } + // Used for converting BigInt literals. The scanner has already checked + // that the literal is valid and not too big, so this always succeeds. + std::unique_ptr DecimalString(bigint::Processor* processor) { + DCHECK_EQ(behavior_, Behavior::kLiteral); + this->ParseInt(); + DCHECK_EQ(this->state(), State::kDone); + int num_digits = accumulator_.ResultLength(); + base::SmallVector digit_storage(num_digits); + bigint::RWDigits digits(digit_storage.data(), num_digits); + processor->FromString(digits, &accumulator_); + int num_chars = bigint::ToStringResultLength(digits, 10, false); + std::unique_ptr out(new char[num_chars + 1]); + processor->ToString(out.get(), &num_chars, digits, 10, false); + out[num_chars] = '\0'; + return out; + } + private: template void ParseInternal(Char start) { @@ -1018,6 +1036,13 @@ template EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE) MaybeHandle BigIntLiteral(LocalIsolate* isolate, const char* string); +std::unique_ptr BigIntLiteralToDecimal( + LocalIsolate* isolate, base::Vector literal) { + StringToBigIntHelper helper(nullptr, literal.begin(), + literal.length()); + return helper.DecimalString(isolate->bigint_processor()); +} + const char* DoubleToCString(double v, base::Vector buffer) { switch (FPCLASSIFY_NAMESPACE::fpclassify(v)) { case FP_NAN: diff --git a/deps/v8/src/numbers/conversions.h b/deps/v8/src/numbers/conversions.h index 9232de93cafe90..fce0d726544527 100644 --- a/deps/v8/src/numbers/conversions.h +++ b/deps/v8/src/numbers/conversions.h @@ -119,6 +119,8 @@ const int kDoubleToCStringMinBufferSize = 100; V8_EXPORT_PRIVATE const char* DoubleToCString(double value, base::Vector buffer); +V8_EXPORT_PRIVATE std::unique_ptr BigIntLiteralToDecimal( + LocalIsolate* isolate, base::Vector literal); // Convert an int to a null-terminated string. The returned string is // located inside the buffer, but not necessarily at the start. V8_EXPORT_PRIVATE const char* IntToCString(int n, base::Vector buffer); diff --git a/deps/v8/src/objects/js-date-time-format.cc b/deps/v8/src/objects/js-date-time-format.cc index 955370b7ba8b5b..d2e3efb9f4e6dd 100644 --- a/deps/v8/src/objects/js-date-time-format.cc +++ b/deps/v8/src/objects/js-date-time-format.cc @@ -753,6 +753,11 @@ MaybeHandle FormatDateTime(Isolate* isolate, icu::UnicodeString result; date_format.format(date_value, result); + // Revert ICU 72 change that introduced U+202F instead of U+0020 + // to separate time from AM/PM. See https://crbug.com/1414292. + result = result.findAndReplace(icu::UnicodeString(0x202f), + icu::UnicodeString(0x20)); + return Intl::ToString(isolate, result); } diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h index df829ff8cac43c..cfa91e446f82e9 100644 --- a/deps/v8/src/parsing/parser-base.h +++ b/deps/v8/src/parsing/parser-base.h @@ -2288,7 +2288,7 @@ typename ParserBase::ExpressionT ParserBase::ParseProperty( case Token::BIGINT: { Consume(Token::BIGINT); - prop_info->name = impl()->GetSymbol(); + prop_info->name = impl()->GetBigIntAsSymbol(); is_array_index = impl()->IsArrayIndex(prop_info->name, &index); break; } diff --git a/deps/v8/src/parsing/parser.cc b/deps/v8/src/parsing/parser.cc index 6ee70886a99f8d..9789909456ee5e 100644 --- a/deps/v8/src/parsing/parser.cc +++ b/deps/v8/src/parsing/parser.cc @@ -247,6 +247,16 @@ bool Parser::CollapseNaryExpression(Expression** x, Expression* y, return true; } +const AstRawString* Parser::GetBigIntAsSymbol() { + base::Vector literal = scanner()->BigIntLiteral(); + if (literal[0] != '0' || literal.length() == 1) { + return ast_value_factory()->GetOneByteString(literal); + } + std::unique_ptr decimal = + BigIntLiteralToDecimal(local_isolate_, literal); + return ast_value_factory()->GetOneByteString(decimal.get()); +} + Expression* Parser::BuildUnaryExpression(Expression* expression, Token::Value op, int pos) { DCHECK_NOT_NULL(expression); diff --git a/deps/v8/src/parsing/parser.h b/deps/v8/src/parsing/parser.h index 1d8fa2515df380..909fc7defdb0cc 100644 --- a/deps/v8/src/parsing/parser.h +++ b/deps/v8/src/parsing/parser.h @@ -790,6 +790,8 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase) { return ast_value_factory()->GetOneByteString(string); } + const AstRawString* GetBigIntAsSymbol(); + class ThisExpression* ThisExpression() { UseThis(); return factory()->ThisExpression(); diff --git a/deps/v8/src/parsing/preparser.h b/deps/v8/src/parsing/preparser.h index ff64f9a5f55bba..9b1d54ed7d6001 100644 --- a/deps/v8/src/parsing/preparser.h +++ b/deps/v8/src/parsing/preparser.h @@ -1522,6 +1522,10 @@ class PreParser : public ParserBase { return PreParserIdentifier::Default(); } + V8_INLINE PreParserIdentifier GetBigIntAsSymbol() const { + return PreParserIdentifier::Default(); + } + V8_INLINE PreParserExpression ThisExpression() { UseThis(); return PreParserExpression::This(); diff --git a/deps/v8/src/parsing/scanner.h b/deps/v8/src/parsing/scanner.h index 0fe907632de4bf..3a38ed243bb1dd 100644 --- a/deps/v8/src/parsing/scanner.h +++ b/deps/v8/src/parsing/scanner.h @@ -336,6 +336,9 @@ class V8_EXPORT_PRIVATE Scanner { AstValueFactory* ast_value_factory) const; double DoubleValue(); + base::Vector BigIntLiteral() const { + return literal_one_byte_string(); + } const char* CurrentLiteralAsCString(Zone* zone) const; diff --git a/deps/v8/test/mjsunit/compiler/fast-api-calls-8args.js b/deps/v8/test/mjsunit/compiler/fast-api-calls-8args.js new file mode 100644 index 00000000000000..a75e8be8be9d3c --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/fast-api-calls-8args.js @@ -0,0 +1,50 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file tests fast callbacks with more than 8 arguments. It should +// fail on arm64 + OSX configuration, because of stack alignment issue, +// see crbug.com/v8/13171. + +// Flags: --turbo-fast-api-calls --expose-fast-api --allow-natives-syntax --turbofan +// --always-turbofan is disabled because we rely on particular feedback for +// optimizing to the fastest path. +// Flags: --no-always-turbofan +// The test relies on optimizing/deoptimizing at predictable moments, so +// it's not suitable for deoptimization fuzzing. +// Flags: --deopt-every-n-times=0 + +const add_all_32bit_int_arg1 = -42; +const add_all_32bit_int_arg2 = 45; +const add_all_32bit_int_arg3 = -12345678; +const add_all_32bit_int_arg4 = 0x1fffffff; +const add_all_32bit_int_arg5 = 1e6; +const add_all_32bit_int_arg6 = 1e8; +const add_all_32bit_int_arg7 = 31; +const add_all_32bit_int_arg8 = 63; +const add_all_32bit_int_result_8args = add_all_32bit_int_arg1 + +add_all_32bit_int_arg2 + add_all_32bit_int_arg3 + add_all_32bit_int_arg4 + +add_all_32bit_int_arg5 + add_all_32bit_int_arg6 + add_all_32bit_int_arg7 + add_all_32bit_int_arg8; + +const fast_c_api = new d8.test.FastCAPI(); + +(function () { + function overloaded_add_all(should_fallback = false) { + return fast_c_api.overloaded_add_all_8args(should_fallback, + add_all_32bit_int_arg1, add_all_32bit_int_arg2, add_all_32bit_int_arg3, + add_all_32bit_int_arg4, add_all_32bit_int_arg5, add_all_32bit_int_arg6, + add_all_32bit_int_arg7, add_all_32bit_int_arg8); + } + + %PrepareFunctionForOptimization(overloaded_add_all); + let result = overloaded_add_all(); + assertEquals(add_all_32bit_int_result_8args, result); + + fast_c_api.reset_counts(); + %OptimizeFunctionOnNextCall(overloaded_add_all); + result = overloaded_add_all(); + assertOptimized(overloaded_add_all); + + assertEquals(1, fast_c_api.fast_call_count()); + assertEquals(0, fast_c_api.slow_call_count()); +})(); diff --git a/deps/v8/test/mjsunit/harmony/bigint/property-names.js b/deps/v8/test/mjsunit/harmony/bigint/property-names.js index ac65e1041d50fa..400b51f51c67a3 100644 --- a/deps/v8/test/mjsunit/harmony/bigint/property-names.js +++ b/deps/v8/test/mjsunit/harmony/bigint/property-names.js @@ -7,3 +7,26 @@ assertEquals(it, 1); var { 999999999999999999n: it } = { 999999999999999999n: 1 }; // greater than max safe integer assertEquals(it, 1); + +var obj = { 0xfffffffffffffffffffffn: 1}; +assertEquals(1, obj["19342813113834066795298815"]); + +var obj2 = {0o777777777777777777777777777n: 1}; +assertEquals(1, obj2["2417851639229258349412351"]); + +var obj3 = { 0x4n: 'hi' }; + +assertEquals('hi', obj3[4]); +assertEquals(undefined, obj3["0x4"]); + +let obj4 = + {12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890n: 1}; +assertEquals( + 1, + obj4["12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"]); + +// 130 hex digits +let obj5 = {0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn: 1}; +assertEquals( + 1, + obj5["3432398830065304857490950399540696608634717650071652704697231729592771591698828026061279820330727277488648155695740429018560993999858321906287014145557528575"]); diff --git a/deps/v8/test/mjsunit/mjsunit.status b/deps/v8/test/mjsunit/mjsunit.status index 7e57621350263f..78677186dcaedf 100644 --- a/deps/v8/test/mjsunit/mjsunit.status +++ b/deps/v8/test/mjsunit/mjsunit.status @@ -511,6 +511,9 @@ # Non-BMP characters currently aren't considered identifiers in no_i18n 'harmony/private-name-surrogate-pair': [PASS,FAIL], + + # Tests ICU-specific behavior. + 'regress/regress-crbug-1414292': [SKIP], }], # 'no_i18n' ############################################################################## @@ -966,6 +969,14 @@ 'wasm/compare-exchange64-stress': [SKIP], }], # 'system == macos' +############################################################################## +['system == macos and arch == arm64', { + # BUG(v8:13171): The following tests a function that shouldn't be optimized + # on M1 hardware, unless a proper fix for the stack corruption is + # implemented (see linked issue). + 'compiler/fast-api-calls-8args': [FAIL], +}], # 'system == macos and arch == arm64' + ############################################################################## ['system == windows', { # Too slow with turbo fan. diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-1414292.js b/deps/v8/test/mjsunit/regress/regress-crbug-1414292.js new file mode 100644 index 00000000000000..3a0831c67f6acc --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-1414292.js @@ -0,0 +1,17 @@ +// Copyright 2023 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +const date = new Date("Wed Feb 15 2023 00:00:00 GMT+0100"); +const localeString = date.toLocaleString("en-US"); +// No narrow-width space should be found +assertEquals(-1, localeString.search('\u202f')); +// Regular space should match the character between time and AM/PM. +assertMatches(/:\d\d:\d\d [AP]M$/, localeString); + +const formatter = new Intl.DateTimeFormat('en', {timeStyle: "long"}) +const formattedString = formatter.format(date) +// No narrow-width space should be found +assertEquals(-1, formattedString.search('\u202f')); +// Regular space should match the character between time and AM/PM. +assertMatches(/:\d\d:\d\d [AP]M$/, localeString); diff --git a/deps/v8/test/test262/test262.status b/deps/v8/test/test262/test262.status index ea1ccefb5fd5c6..da91da884249af 100644 --- a/deps/v8/test/test262/test262.status +++ b/deps/v8/test/test262/test262.status @@ -2900,6 +2900,10 @@ 'language/expressions/assignmenttargettype/direct-callexpression-arguments': [FAIL], 'language/expressions/assignmenttargettype/parenthesized-callexpression-arguments': [FAIL], + # We replace U+202F (narrow-width space) with U+0020 (regular space). + # https://crbug.com/1414292 + 'intl402/DateTimeFormat/prototype/format/timedatestyle-en': [FAIL], + ############################ INVALID TESTS ############################# # Test makes unjustified assumptions about the number of calls to SortCompare. diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 5a387089c26d72..bb608c852cf3d2 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -5126,6 +5126,20 @@ For code running using Node.js APIs, converting between base64-encoded strings and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.** +### `buffer.isAscii(input)` + + + +* input {Buffer | ArrayBuffer | TypedArray} The input to validate. +* Returns: {boolean} + +This function returns `true` if `input` contains only valid ASCII-encoded data, +including the case in which `input` is empty. + +Throws if the `input` is a detached array buffer. + ### `buffer.isUtf8(input)` + +When used in conjunction with the `node:test` module, a code coverage report is +generated as part of the test runner output. If no tests are run, a coverage +report is not generated. See the documentation on +[collecting code coverage from tests][] for more details. + ### `--experimental-vm-modules` + +A test reporter to use when running tests. See the documentation on +[test reporters][] for more details. + +### `--test-reporter-destination` + + + +The destination for the corresponding test reporter. See the documentation on +[test reporters][] for more details. + ### `--test-only` + +* `path` {string|Buffer|URL} +* `options` {Object} + * `bigint` {boolean} Whether the numeric values in the returned + {fs.StatFs} object should be `bigint`. **Default:** `false`. +* Returns: {Promise} Fulfills with the {fs.StatFs} object for the + given `path`. + ### `fsPromises.symlink(target, path[, type])` + +* `path` {string|Buffer|URL} +* `options` {Object} + * `bigint` {boolean} Whether the numeric values in the returned + {fs.StatFs} object should be `bigint`. **Default:** `false`. +* `callback` {Function} + * `err` {Error} + * `stats` {fs.StatFs} + +Asynchronous statfs(2). Returns information about the mounted file system which +contains `path`. The callback gets two arguments `(err, stats)` where `stats` +is an {fs.StatFs} object. + +In case of an error, the `err.code` will be one of [Common System Errors][]. + ### `fs.symlink(target, path[, type], callback)` + +* `path` {string|Buffer|URL} +* `options` {Object} + * `bigint` {boolean} Whether the numeric values in the returned + {fs.StatFs} object should be `bigint`. **Default:** `false`. +* Returns: {fs.StatFs} + +Synchronous statfs(2). Returns information about the mounted file system which +contains `path`. + +In case of an error, the `err.code` will be one of [Common System Errors][]. + ### `fs.symlinkSync(target, path[, type])` + +Provides information about a mounted file system. + +Objects returned from [`fs.statfs()`][] and its synchronous counterpart are of +this type. If `bigint` in the `options` passed to those methods is `true`, the +numeric values will be `bigint` instead of `number`. + +```console +StatFs { + type: 1397114950, + bsize: 4096, + blocks: 121938943, + bfree: 61058895, + bavail: 61058895, + files: 999, + ffree: 1000000 +} +``` + +`bigint` version: + +```console +StatFs { + type: 1397114950n, + bsize: 4096n, + blocks: 121938943n, + bfree: 61058895n, + bavail: 61058895n, + files: 999n, + ffree: 1000000n +} +``` + +#### `statfs.bavail` + + + +* {number|bigint} + +Free blocks available to unprivileged users. + +#### `statfs.bfree` + + + +* {number|bigint} + +Free blocks in file system. + +#### `statfs.blocks` + + + +* {number|bigint} + +Total data blocks in file system. + +#### `statfs.bsize` + + + +* {number|bigint} + +Optimal transfer block size. + +#### `statfs.ffree` + + + +* {number|bigint} + +Free file nodes in file system. + +#### `statfs.files` + + + +* {number|bigint} + +Total file nodes in file system. + +#### `statfs.type` + + + +* {number|bigint} + +Type of file system. + ### Class: `fs.WriteStream` + +* `headers` {Headers|Map} +* Returns: {http.ServerResponse} + +Returns the response object. + +Sets multiple header values for implicit headers. +`headers` must be an instance of [`Headers`][] or `Map`, +if a header already exists in the to-be-sent headers, +its value will be replaced. + +```js +const headers = new Headers({ foo: 'bar' }); +response.setHeaders(headers); +``` + +or + +```js +const headers = new Map([['foo', 'bar']]); +res.setHeaders(headers); +``` + +When headers have been set with [`outgoingMessage.setHeaders()`][], +they will be merged with any headers passed to [`response.writeHead()`][], +with the headers passed to [`response.writeHead()`][] given precedence. + +```js +// Returns content-type = text/plain +const server = http.createServer((req, res) => { + const headers = new Headers({ 'Content-Type': 'text/html' }); + res.setHeaders(headers); + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end('ok'); +}); +``` + ### `outgoingMessage.setTimeout(msesc[, callback])` + +Destroys the socket after all data is written. If the `'finish'` event was +already emitted the socket is destroyed immediately. If the socket is still +writable it implicitly calls `socket.end()`. + ### `socket.end([data[, encoding]][, callback])` + +> Stability: 1 - Experimental + +* {number|undefined} + +Gets the amount of memory available to the process (in bytes) based on +limits imposed by the OS. If there is no such constraint, or the constraint +is unknown, `undefined` is returned. + +See [`uv_get_constrained_memory`][uv_get_constrained_memory] for more +information. + ## `process.cpuUsage([previousValue])` -The `node:test` module facilitates the creation of JavaScript tests that -report results in [TAP][] format. To access it: +The `node:test` module facilitates the creation of JavaScript tests. +To access it: ```mjs import test from 'node:test'; @@ -91,9 +91,7 @@ test('callback failing test', (t, done) => { }); ``` -As a test file executes, TAP is written to the standard output of the Node.js -process. This output can be interpreted by any test harness that understands -the TAP format. If any tests fail, the process exit code is set to `1`. +If any tests fail, the process exit code is set to `1`. ## Subtests @@ -122,8 +120,7 @@ test to fail. ## Skipping tests Individual tests can be skipped by passing the `skip` option to the test, or by -calling the test context's `skip()` method. Both of these options support -including a message that is displayed in the TAP output as shown in the +calling the test context's `skip()` method as shown in the following example. ```js @@ -258,7 +255,7 @@ Test name patterns do not change the set of files that the test runner executes. ## Extraneous asynchronous activity -Once a test function finishes executing, the TAP results are output as quickly +Once a test function finishes executing, the results are reported as quickly as possible while maintaining the order of the tests. However, it is possible for the test function to generate asynchronous activity that outlives the test itself. The test runner handles this type of activity, but does not delay the @@ -267,13 +264,13 @@ reporting of test results in order to accommodate it. In the following example, a test completes with two `setImmediate()` operations still outstanding. The first `setImmediate()` attempts to create a new subtest. Because the parent test has already finished and output its -results, the new subtest is immediately marked as failed, and reported in the -top level of the file's TAP output. +results, the new subtest is immediately marked as failed, and reported later +to the {TestsStream}. The second `setImmediate()` creates an `uncaughtException` event. `uncaughtException` and `unhandledRejection` events originating from a completed -test are handled by the `test` module and reported as diagnostic warnings in -the top level of the file's TAP output. +test are marked as failed by the `test` module and reported as diagnostic +warnings at the top level by the {TestsStream}. ```js test('a test that creates asynchronous activity', (t) => { @@ -371,6 +368,56 @@ Otherwise, the test is considered to be a failure. Test files must be executable by Node.js, but are not required to use the `node:test` module internally. +## Collecting code coverage + +When Node.js is started with the [`--experimental-test-coverage`][] +command-line flag, code coverage is collected and statistics are reported once +all tests have completed. If the [`NODE_V8_COVERAGE`][] environment variable is +used to specify a code coverage directory, the generated V8 coverage files are +written to that directory. Node.js core modules and files within +`node_modules/` directories are not included in the coverage report. If +coverage is enabled, the coverage report is sent to any [test reporters][] via +the `'test:coverage'` event. + +Coverage can be disabled on a series of lines using the following +comment syntax: + +```js +/* node:coverage disable */ +if (anAlwaysFalseCondition) { + // Code in this branch will never be executed, but the lines are ignored for + // coverage purposes. All lines following the 'disable' comment are ignored + // until a corresponding 'enable' comment is encountered. + console.log('this is never executed'); +} +/* node:coverage enable */ +``` + +Coverage can also be disabled for a specified number of lines. After the +specified number of lines, coverage will be automatically reenabled. If the +number of lines is not explicitly provided, a single line is ignored. + +```js +/* node:coverage ignore next */ +if (anAlwaysFalseCondition) { console.log('this is never executed'); } + +/* node:coverage ignore next 3 */ +if (anAlwaysFalseCondition) { + console.log('this is never executed'); +} +``` + +The test runner's code coverage functionality has the following limitations, +which will be addressed in a future Node.js release: + +* Although coverage data is collected for child processes, this information is + not included in the coverage report. Because the command line test runner uses + child processes to execute test files, it cannot be used with + `--experimental-test-coverage`. +* Source maps are not supported. +* Excluding specific files or directories from the coverage report is not + supported. + ## Mocking The `node:test` module supports mocking during testing via a top-level `mock` @@ -454,6 +501,169 @@ test('spies on an object method', (t) => { }); ``` +## Test reporters + + + +The `node:test` module supports passing [`--test-reporter`][] +flags for the test runner to use a specific reporter. + +The following built-reporters are supported: + +* `tap` + The `tap` reporter is the default reporter used by the test runner. It outputs + the test results in the [TAP][] format. + +* `spec` + The `spec` reporter outputs the test results in a human-readable format. + +* `dot` + The `dot` reporter outputs the test results in a compact format, + where each passing test is represented by a `.`, + and each failing test is represented by a `X`. + +### Custom reporters + +[`--test-reporter`][] can be used to specify a path to custom reporter. +a custom reporter is a module that exports a value +accepted by [stream.compose][]. +Reporters should transform events emitted by a {TestsStream} + +Example of a custom reporter using {stream.Transform}: + +```mjs +import { Transform } from 'node:stream'; + +const customReporter = new Transform({ + writableObjectMode: true, + transform(event, encoding, callback) { + switch (event.type) { + case 'test:start': + callback(null, `test ${event.data.name} started`); + break; + case 'test:pass': + callback(null, `test ${event.data.name} passed`); + break; + case 'test:fail': + callback(null, `test ${event.data.name} failed`); + break; + case 'test:plan': + callback(null, 'test plan'); + break; + case 'test:diagnostic': + callback(null, event.data.message); + break; + } + }, +}); + +export default customReporter; +``` + +```cjs +const { Transform } = require('node:stream'); + +const customReporter = new Transform({ + writableObjectMode: true, + transform(event, encoding, callback) { + switch (event.type) { + case 'test:start': + callback(null, `test ${event.data.name} started`); + break; + case 'test:pass': + callback(null, `test ${event.data.name} passed`); + break; + case 'test:fail': + callback(null, `test ${event.data.name} failed`); + break; + case 'test:plan': + callback(null, 'test plan'); + break; + case 'test:diagnostic': + callback(null, event.data.message); + break; + } + }, +}); + +module.exports = customReporter; +``` + +Example of a custom reporter using a generator function: + +```mjs +export default async function * customReporter(source) { + for await (const event of source) { + switch (event.type) { + case 'test:start': + yield `test ${event.data.name} started\n`; + break; + case 'test:pass': + yield `test ${event.data.name} passed\n`; + break; + case 'test:fail': + yield `test ${event.data.name} failed\n`; + break; + case 'test:plan': + yield 'test plan'; + break; + case 'test:diagnostic': + yield `${event.data.message}\n`; + break; + } + } +} +``` + +```cjs +module.exports = async function * customReporter(source) { + for await (const event of source) { + switch (event.type) { + case 'test:start': + yield `test ${event.data.name} started\n`; + break; + case 'test:pass': + yield `test ${event.data.name} passed\n`; + break; + case 'test:fail': + yield `test ${event.data.name} failed\n`; + break; + case 'test:plan': + yield 'test plan\n'; + break; + case 'test:diagnostic': + yield `${event.data.message}\n`; + break; + } + } +}; +``` + +The value provided to `--test-reporter` should be a string like one used in an +`import()` in JavaScript code. + +### Multiple reporters + +The [`--test-reporter`][] flag can be specified multiple times to report test +results in several formats. In this situation +it is required to specify a destination for each reporter +using [`--test-reporter-destination`][]. +Destination can be `stdout`, `stderr`, or a file path. +Reporters and destinations are paired according +to the order they were specified. + +In the following example, the `spec` reporter will output to `stdout`, +and the `dot` reporter will output to `file.txt`: + +```bash +node --test-reporter=spec --test-reporter=dot --test-reporter-destination=stdout --test-reporter-destination=file.txt +``` + +When a single reporter is specified, the destination will default to `stdout`, +unless a destination is explicitly provided. + ## `run([options])` + +Shorthand for marking a suite as `only`, same as +[`describe([name], { only: true }[, fn])`][describe options]. + ## `it([name][, options][, fn])` * `name` {string} The name of the test, which is displayed when reporting test @@ -605,8 +825,6 @@ Shorthand for marking a suite as `TODO`, same as * Returns: `undefined`. The `it()` function is the value imported from the `node:test` module. -Each invocation of this function results in the creation of a test point in the -TAP output. ## `it.skip([name][, options][, fn])` @@ -618,6 +836,15 @@ same as [`it([name], { skip: true }[, fn])`][it options]. Shorthand for marking a test as `TODO`, same as [`it([name], { todo: true }[, fn])`][it options]. +## `it.only([name][, options][, fn])` + + + +Shorthand for marking a test as `only`, +same as [`it([name], { only: true }[, fn])`][it options]. + ## `before([fn][, options])` -* `message` {string} Message to be displayed as a TAP diagnostic. +* `message` {string} Message to be reported. -This function is used to write TAP diagnostics to the output. Any diagnostic +This function is used to write diagnostics to the output. Any diagnostic information is included at the end of the test's results. This function does not return a value. @@ -1245,10 +1541,10 @@ test('top level test', async (t) => { added: v18.0.0 --> -* `message` {string} Optional skip message to be displayed in TAP output. +* `message` {string} Optional skip message. This function causes the test's output to indicate the test as skipped. If -`message` is provided, it is included in the TAP output. Calling `skip()` does +`message` is provided, it is included in the output. Calling `skip()` does not terminate execution of the test function. This function does not return a value. @@ -1265,10 +1561,10 @@ test('top level test', (t) => { added: v18.0.0 --> -* `message` {string} Optional `TODO` message to be displayed in TAP output. +* `message` {string} Optional `TODO` message. This function adds a `TODO` directive to the test's output. If `message` is -provided, it is included in the TAP output. Calling `todo()` does not terminate +provided, it is included in the output. Calling `todo()` does not terminate execution of the test function. This function does not return a value. ```js @@ -1361,12 +1657,16 @@ added: v18.7.0 aborted. [TAP]: https://testanything.org/ +[`--experimental-test-coverage`]: cli.md#--experimental-test-coverage [`--test-name-pattern`]: cli.md#--test-name-pattern [`--test-only`]: cli.md#--test-only +[`--test-reporter-destination`]: cli.md#--test-reporter-destination +[`--test-reporter`]: cli.md#--test-reporter [`--test`]: cli.md#--test [`MockFunctionContext`]: #class-mockfunctioncontext [`MockTracker.method`]: #mockmethodobject-methodname-implementation-options [`MockTracker`]: #class-mocktracker +[`NODE_V8_COVERAGE`]: cli.md#node_v8_coveragedir [`SuiteContext`]: #class-suitecontext [`TestContext`]: #class-testcontext [`context.diagnostic`]: #contextdiagnosticmessage @@ -1376,4 +1676,6 @@ added: v18.7.0 [`test()`]: #testname-options-fn [describe options]: #describename-options-fn [it options]: #testname-options-fn +[stream.compose]: stream.md#streamcomposestreams +[test reporters]: #test-reporters [test runner execution model]: #test-runner-execution-model diff --git a/doc/api/v8.md b/doc/api/v8.md index 9621a9b7621509..b9f5fda7117c88 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -1021,6 +1021,112 @@ added: v18.6.0 Returns true if the Node.js instance is run to build a snapshot. +## Class: `v8.GCProfiler` + + + +This API collects GC data in current thread. + +### `new v8.GCProfiler()` + + + +Create a new instance of the `v8.GCProfiler` class. + +### `profiler.start()` + + + +Start collecting GC data. + +### `profiler.stop()` + + + +Stop collecting GC data and return an object.The content of object +is as follows. + +```json +{ + "version": 1, + "startTime": 1674059033862, + "statistics": [ + { + "gcType": "Scavenge", + "beforeGC": { + "heapStatistics": { + "totalHeapSize": 5005312, + "totalHeapSizeExecutable": 524288, + "totalPhysicalSize": 5226496, + "totalAvailableSize": 4341325216, + "totalGlobalHandlesSize": 8192, + "usedGlobalHandlesSize": 2112, + "usedHeapSize": 4883840, + "heapSizeLimit": 4345298944, + "mallocedMemory": 254128, + "externalMemory": 225138, + "peakMallocedMemory": 181760 + }, + "heapSpaceStatistics": [ + { + "spaceName": "read_only_space", + "spaceSize": 0, + "spaceUsedSize": 0, + "spaceAvailableSize": 0, + "physicalSpaceSize": 0 + } + ] + }, + "cost": 1574.14, + "afterGC": { + "heapStatistics": { + "totalHeapSize": 6053888, + "totalHeapSizeExecutable": 524288, + "totalPhysicalSize": 5500928, + "totalAvailableSize": 4341101384, + "totalGlobalHandlesSize": 8192, + "usedGlobalHandlesSize": 2112, + "usedHeapSize": 4059096, + "heapSizeLimit": 4345298944, + "mallocedMemory": 254128, + "externalMemory": 225138, + "peakMallocedMemory": 181760 + }, + "heapSpaceStatistics": [ + { + "spaceName": "read_only_space", + "spaceSize": 0, + "spaceUsedSize": 0, + "spaceAvailableSize": 0, + "physicalSpaceSize": 0 + } + ] + } + } + ], + "endTime": 1674059036865 +} +``` + +Here's an example. + +```js +const { GCProfiler } = require('v8'); +const profiler = new GCProfiler(); +profiler.start(); +setTimeout(() => { + console.log(profiler.stop()); +}, 1000); +``` + [HTML structured clone algorithm]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm [Hook Callbacks]: #hook-callbacks [V8]: https://developers.google.com/v8/ diff --git a/doc/api/vm.md b/doc/api/vm.md index 09081fad2240bf..ba45063e1c72c0 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -962,6 +962,12 @@ const vm = require('node:vm'); + $(IntDir)%(FileName)%(Extension).pp + + + diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 42d74b619bb47a..c29d66976ffb1f 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -1437,6 +1437,14 @@ ['want_separate_host_toolset', { 'toolsets': ['host'], }], + ['OS=="win"', { + 'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h', + 'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc', + 'sources': [ + '<(_msvs_precompiled_header)', + '<(_msvs_precompiled_source)', + ], + }], ], }, # mksnapshot {