diff --git a/.github/workflows/timezone-update.yml b/.github/workflows/timezone-update.yml index 176944e3bd72d3..3901a589ab2fa2 100644 --- a/.github/workflows/timezone-update.yml +++ b/.github/workflows/timezone-update.yml @@ -57,7 +57,7 @@ jobs: with: author: Node.js GitHub Bot body: | - This PR was generated by tools/timezone-update.yml. + This PR was generated by `.github/workflows/timezone-update.yml` and `tools/update-timezone.mjs`. Updates the ICU files as per the instructions present in https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-icu.md#time-zone-data diff --git a/deps/crates/Cargo.lock b/deps/crates/Cargo.lock index f8f6913c843a4d..b8586e1b704145 100644 --- a/deps/crates/Cargo.lock +++ b/deps/crates/Cargo.lock @@ -191,11 +191,9 @@ name = "node_crates" version = "0.1.0" dependencies = [ "icu_calendar", - "icu_calendar_data", "icu_collections", "icu_locale", "icu_locale_core", - "icu_locale_data", "icu_provider", "temporal_capi", "temporal_rs", diff --git a/deps/crates/Cargo.toml b/deps/crates/Cargo.toml index 8c6224e0ed5f64..7c67cc30e31944 100644 --- a/deps/crates/Cargo.toml +++ b/deps/crates/Cargo.toml @@ -12,18 +12,15 @@ crate-type = ["staticlib"] [dependencies] # Pin all temporal dependencies to the last version support rustc 1.82 -icu_calendar = "~2.0.0" -icu_calendar_data = "~2.0.0" icu_collections = "~2.0.0" -icu_locale = "~2.0.0" icu_locale_core = "~2.0.0" -icu_locale_data = "~2.0.0" icu_provider = "~2.0.0" timezone_provider = "=0.1.0" [dependencies.temporal_capi] version = "=0.1.0" features = ["zoneinfo64"] +default-features = false [dependencies.temporal_rs] version = "=0.1.0" @@ -31,6 +28,20 @@ default-features = false # This is necessary to enable a spec-compliance quirk when upgrading to v0.1.2 # features = ["float64_representable_durations"] +# Disable `icu_calendar_data` and `icu_locale_data` crates with disabling +# `compiled_data` features. However these datasets are still enabled until +# https://github.com/boa-dev/temporal/pull/694 lands. +[dependencies.icu_calendar] +version = "~2.0.0" +features = [ + "ixdtf", # Parser for Internet eXtended DateTime Format +] +default-features = false + +[dependencies.icu_locale] +version = "~2.0.0" +default-features = false + [patch.crates-io] # Float https://github.com/unicode-org/icu4x/pull/7658 until crate is updated. resb = { path="patches/resb" } diff --git a/doc/api/environment_variables.md b/doc/api/environment_variables.md index 6e114c1b9dcce7..ebaa5c9f5e86ef 100644 --- a/doc/api/environment_variables.md +++ b/doc/api/environment_variables.md @@ -145,7 +145,7 @@ There following two functions allow you to directly interact with `.env` files: * [`process.loadEnvFile`][] loads an `.env` file and populates `process.env` with its variables -* [`util.parseEnv`][] parses the row content of an `.env` file and returns its value in an object +* [`util.parseEnv`][] parses the raw content of an `.env` file and returns its value in an object [CLI Environment Variables documentation]: cli.md#environment-variables_1 [`--env-file-if-exists=file`]: cli.md#--env-file-if-existsfile diff --git a/eslint.config.mjs b/eslint.config.mjs index cd66c1392b68c7..fb6f9623587583 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -20,6 +20,7 @@ const { default: js } = await importEslintTool('@eslint/js'); const { default: babelEslintParser } = await importEslintTool('@babel/eslint-parser'); const babelPluginSyntaxImportSource = resolveEslintTool('@babel/plugin-syntax-import-source'); const { default: jsdoc } = await importEslintTool('eslint-plugin-jsdoc'); +const { default: regexpPlugin } = await importEslintTool('eslint-plugin-regexp'); const { default: markdown } = await importEslintTool('@eslint/markdown'); const { default: stylisticJs } = await importEslintTool('@stylistic/eslint-plugin'); @@ -84,6 +85,7 @@ export default [ // #region general config js.configs.recommended, jsdoc.configs['flat/recommended'], + regexpPlugin.configs.recommended, { files: ['**/*.js'], languageOptions: { @@ -275,6 +277,42 @@ export default [ 'jsdoc/reject-any-type': 'off', 'jsdoc/reject-function-type': 'off', + // RegExp recommended rules that we disable. + // Todo: Investigate which rules should be enabled. + 'prefer-regex-literals': 'off', + 'regexp/control-character-escape': 'off', + 'regexp/match-any': 'off', + 'regexp/negation': 'off', + 'regexp/no-contradiction-with-assertion': 'off', + 'regexp/no-dupe-characters-character-class': 'off', + 'regexp/no-dupe-disjunctions': 'off', + 'regexp/no-empty-alternative': 'off', + 'regexp/no-legacy-features': 'off', + 'regexp/no-misleading-capturing-group': 'off', + 'regexp/no-obscure-range': 'off', + 'regexp/no-potentially-useless-backreference': 'off', + 'regexp/no-super-linear-backtracking': 'off', + 'regexp/no-trivially-nested-quantifier': 'off', + 'regexp/no-unused-capturing-group': 'off', + 'regexp/no-useless-assertions': 'off', + 'regexp/no-useless-character-class': 'off', + 'regexp/no-useless-escape': 'off', + 'regexp/no-useless-flag': 'off', + 'regexp/no-useless-lazy': 'off', + 'regexp/no-useless-non-capturing-group': 'off', + 'regexp/no-useless-quantifier': 'off', + 'regexp/no-useless-range': 'off', + 'regexp/optimal-lookaround-quantifier': 'off', + 'regexp/optimal-quantifier-concatenation': 'off', + 'regexp/prefer-character-class': 'off', + 'regexp/prefer-d': 'off', + 'regexp/prefer-question-quantifier': 'off', + 'regexp/prefer-star-quantifier': 'off', + 'regexp/prefer-w': 'off', + 'regexp/sort-flags': 'off', + 'regexp/strict': 'off', + 'regexp/use-ignore-case': 'off', + // Stylistic rules. '@stylistic/js/arrow-parens': 'error', '@stylistic/js/arrow-spacing': 'error', diff --git a/lib/internal/test_runner/utils.js b/lib/internal/test_runner/utils.js index 5b53342933cdcb..db7e2ee50dd8d6 100644 --- a/lib/internal/test_runner/utils.js +++ b/lib/internal/test_runner/utils.js @@ -384,6 +384,9 @@ function countCompletedTest(test, harness = test.root.harness) { } if (test.reportedType === 'suite') { harness.counters.suites++; + if (!test.passed) { + harness.success = false; + } return; } // Check SKIP and TODO tests first, as those should not be counted as diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc index 9c3aa6e0b4dc5f..91b80b4fb44c26 100644 --- a/src/node_sqlite.cc +++ b/src/node_sqlite.cc @@ -2157,7 +2157,8 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo& args) { Local filterFunc = filterValue.As(); - context.filterCallback = [&](std::string_view item) -> bool { + context.filterCallback = + [env, db, filterFunc](std::string_view item) -> bool { // If there was an error in the previous call to the filter's // callback, we skip calling it again. if (db->ignore_next_sqlite_error_) { diff --git a/test/fixtures/test-runner/describe_error.js b/test/fixtures/test-runner/describe_error.js new file mode 100644 index 00000000000000..04e9d1faa042d1 --- /dev/null +++ b/test/fixtures/test-runner/describe_error.js @@ -0,0 +1,10 @@ +'use strict'; +const { describe, it } = require('node:test'); + +describe('should fail', () => { + throw new Error('error in describe'); +}); + +describe('should pass', () => { + it('ok', () => {}); +}); diff --git a/test/parallel/test-runner-exit-code.js b/test/parallel/test-runner-exit-code.js index 4024a52841bb28..c25becee3f708f 100644 --- a/test/parallel/test-runner-exit-code.js +++ b/test/parallel/test-runner-exit-code.js @@ -70,6 +70,14 @@ if (process.argv[2] === 'child') { assert.strictEqual(child.status, 1); assert.strictEqual(child.signal, null); + // An error thrown inside describe() should cause a non-zero exit code. + child = spawnSync(process.execPath, [ + '--test', + fixtures.path('test-runner', 'describe_error.js'), + ]); + assert.strictEqual(child.status, 1); + assert.strictEqual(child.signal, null); + // With process isolation (default), the test name shown is the file path // because the parent runner only knows about file-level tests const neverEndingSync = fixtures.path('test-runner', 'never_ending_sync.js'); diff --git a/tools/eslint/package-lock.json b/tools/eslint/package-lock.json index 75862d33c7e79c..096d3e6e3d96db 100644 --- a/tools/eslint/package-lock.json +++ b/tools/eslint/package-lock.json @@ -17,6 +17,7 @@ "eslint": "^10.0.2", "eslint-formatter-tap": "^9.0.1", "eslint-plugin-jsdoc": "^62.7.1", + "eslint-plugin-regexp": "^3.0.0", "globals": "^17.3.0" } }, @@ -47,6 +48,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-8.0.0-rc.2.tgz", "integrity": "sha512-mlBJdKJJEZNGDE+w+P6B5w+FTMkht1liPkxtB4wk39EpGH01Am5tg1htaNlOU5rO9Ge3psMjAFycpc3ru5uaQw==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^8.0.0-rc.2", "@babel/generator": "^8.0.0-rc.2", @@ -662,6 +664,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -761,6 +764,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -934,6 +938,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.0.2.tgz", "integrity": "sha512-uYixubwmqJZH+KLVYIVKY1JQt7tysXhtj21WSvjcSmU5SVNzMus1bgLe+pAt816yQ8opKfheVVoPLqvVMGejYw==", "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", @@ -1041,6 +1046,27 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-plugin-regexp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-3.0.0.tgz", + "integrity": "sha512-iW7hgAV8NOG6E2dz+VeKpq67YLQ9jaajOKYpoOSic2/q8y9BMdXBKkSR9gcMtbqEhNQzdW41E3wWzvhp8ExYwQ==", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.11.0", + "comment-parser": "^1.4.0", + "jsdoc-type-pratt-parser": "^7.0.0", + "refa": "^0.12.1", + "regexp-ast-analysis": "^0.7.1", + "scslre": "^0.3.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "peerDependencies": { + "eslint": ">=9.38.0" + } + }, "node_modules/eslint-scope": { "version": "9.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.1.tgz", @@ -2490,6 +2516,31 @@ "node": ">=6" } }, + "node_modules/refa": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/refa/-/refa-0.12.1.tgz", + "integrity": "sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==", + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.8.0" + }, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/regexp-ast-analysis": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.7.1.tgz", + "integrity": "sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==", + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.8.0", + "refa": "^0.12.1" + }, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/reserved-identifiers": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/reserved-identifiers/-/reserved-identifiers-1.2.0.tgz", @@ -2502,6 +2553,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/scslre": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.3.0.tgz", + "integrity": "sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==", + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.8.0", + "refa": "^0.12.0", + "regexp-ast-analysis": "^0.7.0" + }, + "engines": { + "node": "^14.0.0 || >=16.0.0" + } + }, "node_modules/semver": { "version": "7.7.4", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", diff --git a/tools/eslint/package.json b/tools/eslint/package.json index 6225ad5486c26f..1adf4a970c5fa4 100644 --- a/tools/eslint/package.json +++ b/tools/eslint/package.json @@ -12,6 +12,7 @@ "eslint": "^10.0.2", "eslint-formatter-tap": "^9.0.1", "eslint-plugin-jsdoc": "^62.7.1", + "eslint-plugin-regexp": "^3.0.0", "globals": "^17.3.0" } }