diff --git a/package-lock.json b/package-lock.json index f146f8bd9dd2..664d11225cf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2329,9 +2329,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.761", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.761.tgz", - "integrity": "sha512-PIbxpiJGx6Bb8dQaonNc6CGTRlVntdLg/2nMa1YhnrwYOORY9a3ZgGN0UQYE6lAcj/lkyduJN7BPt/JiY+jAQQ==" + "version": "1.4.762", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.762.tgz", + "integrity": "sha512-rrFvGweLxPwwSwJOjIopy3Vr+J3cIPtZzuc74bmlvmBIgQO3VYJDvVrlj94iKZ3ukXUH64Ex31hSfRTLqvjYJQ==" }, "node_modules/elliptic": { "version": "6.5.5", diff --git a/packages/core-js/modules/esnext.suppressed-error.constructor.js b/packages/core-js/modules/esnext.suppressed-error.constructor.js index c72bbe6f131b..ba0db6ab3bb0 100644 --- a/packages/core-js/modules/esnext.suppressed-error.constructor.js +++ b/packages/core-js/modules/esnext.suppressed-error.constructor.js @@ -23,7 +23,7 @@ var WRONG_ARITY = !!NativeSuppressedError && NativeSuppressedError.length !== 3; // https://github.com/oven-sh/bun/issues/9283 var EXTRA_ARGS_SUPPORT = !!NativeSuppressedError && fails(function () { - return NativeSuppressedError(1, 2, 3, { cause: 4 }).cause === 4; + return new NativeSuppressedError(1, 2, 3, { cause: 4 }).cause === 4; }); var PATCH = WRONG_ARITY || EXTRA_ARGS_SUPPORT; diff --git a/scripts/bundle-tests/package-lock.json b/scripts/bundle-tests/package-lock.json index 23127080da48..332e45fa4d7e 100644 --- a/scripts/bundle-tests/package-lock.json +++ b/scripts/bundle-tests/package-lock.json @@ -912,9 +912,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.761", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.761.tgz", - "integrity": "sha512-PIbxpiJGx6Bb8dQaonNc6CGTRlVntdLg/2nMa1YhnrwYOORY9a3ZgGN0UQYE6lAcj/lkyduJN7BPt/JiY+jAQQ==", + "version": "1.4.762", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.762.tgz", + "integrity": "sha512-rrFvGweLxPwwSwJOjIopy3Vr+J3cIPtZzuc74bmlvmBIgQO3VYJDvVrlj94iKZ3ukXUH64Ex31hSfRTLqvjYJQ==", "dev": true }, "node_modules/enhanced-resolve": { diff --git a/scripts/usage/usage.mjs b/scripts/usage/usage.mjs index 2f36b0a15d9d..feba593f1a4f 100644 --- a/scripts/usage/usage.mjs +++ b/scripts/usage/usage.mjs @@ -31,7 +31,7 @@ const sites = file echo(green(`downloading and parsing the rank took ${ cyan((Date.now() - start) / 1e3) } seconds\n${ gray('-'.repeat(120)) }`)); function timeout(promise, time) { - return Promise.race([promise, new Promise((resolve, reject) => setTimeout(() => reject(Error('timeout')), time))]); + return Promise.race([promise, new Promise((resolve, reject) => setTimeout(() => reject(new Error('timeout')), time))]); } chromium.use(StealthPlugin()); diff --git a/tests/compat/tests.js b/tests/compat/tests.js index 366bff9b2301..7857b20649fb 100644 --- a/tests/compat/tests.js +++ b/tests/compat/tests.js @@ -338,7 +338,7 @@ GLOBAL.tests = { return Symbol.unscopables; }], 'es.error.cause': function () { - return Error('e', { cause: 7 }).cause === 7 + return new Error('e', { cause: 7 }).cause === 7 && !('cause' in Error.prototype); }, 'es.error.to-string': function () { @@ -358,7 +358,7 @@ GLOBAL.tests = { return typeof AggregateError == 'function'; }, 'es.aggregate-error.cause': function () { - return AggregateError([1], 'e', { cause: 7 }).cause === 7 + return new AggregateError([1], 'e', { cause: 7 }).cause === 7 && !('cause' in AggregateError.prototype); }, 'es.array.at': function () { @@ -1528,7 +1528,7 @@ GLOBAL.tests = { 'esnext.suppressed-error.constructor': function () { return typeof SuppressedError == 'function' && SuppressedError.length === 3 - && SuppressedError(1, 2, 3, { cause: 4 }).cause !== 4; + && new SuppressedError(1, 2, 3, { cause: 4 }).cause !== 4; }, 'esnext.array.from-async': function () { // https://bugs.webkit.org/show_bug.cgi?id=271703 @@ -1965,7 +1965,7 @@ GLOBAL.tests = { && DOMException.prototype.DATA_CLONE_ERR === 25; }, 'web.dom-exception.stack': function () { - return !('stack' in Error('1')) || 'stack' in new DOMException(); + return !('stack' in new Error('1')) || 'stack' in new DOMException(); }, 'web.dom-exception.to-string-tag': function () { return typeof DOMException == 'function' diff --git a/tests/entries/unit.mjs b/tests/entries/unit.mjs index 27a9ae0f39f9..1061dc862cf8 100644 --- a/tests/entries/unit.mjs +++ b/tests/entries/unit.mjs @@ -135,9 +135,9 @@ for (PATH of ['core-js-pure', 'core-js']) { ok('map' in load(NS, 'array/virtual')); ok('from' in load(NS, 'array')); ok(load(NS, 'array/splice')([1, 2, 3], 1, 2)[0] === 2); - ok(load(NS, 'error/constructor').Error(1, { cause: 7 }).cause === 7); + ok(new (load(NS, 'error/constructor').Error)(1, { cause: 7 }).cause === 7); ok(typeof load(NS, 'error/to-string') == 'function'); - ok(load(NS, 'error').Error(1, { cause: 7 }).cause === 7); + ok(new (load(NS, 'error').Error)(1, { cause: 7 }).cause === 7); ok(load(NS, 'math/acosh')(1) === 0); ok(Object.is(load(NS, 'math/asinh')(-0), -0)); ok(load(NS, 'math/atanh')(1) === Infinity); diff --git a/tests/eslint/eslint.config.js b/tests/eslint/eslint.config.js index 8b4cc94fdf4a..91ac43af74ae 100644 --- a/tests/eslint/eslint.config.js +++ b/tests/eslint/eslint.config.js @@ -525,6 +525,8 @@ const base = { // unicorn // enforce a specific parameter name in `catch` clauses 'unicorn/catch-error-name': [ERROR, { name: ERROR, ignore: [/^err/] }], + // prefer consistent types when spreading a ternary in an array literal + 'unicorn/consistent-empty-array-spread': ERROR, // enforce correct `Error` subclassing 'unicorn/custom-error-definition': ERROR, // enforce passing a message value when throwing a built-in error @@ -543,10 +545,14 @@ const base = { 'unicorn/no-console-spaces': ERROR, // enforce the use of unicode escapes instead of hexadecimal escapes 'unicorn/no-hex-escape': ERROR, + // disallow invalid options in `fetch` and `Request` + 'unicorn/no-invalid-fetch-options': ERROR, // prevent calling `EventTarget#removeEventListener()` with the result of an expression 'unicorn/no-invalid-remove-event-listener': ERROR, // disallow `if` statements as the only statement in `if` blocks without `else` 'unicorn/no-lonely-if': ERROR, + // disallow a magic number as the depth argument in `Array#flat` + 'unicorn/no-magic-array-flat-depth': ERROR, // enforce the use of `Buffer.from()` and `Buffer.alloc()` instead of the deprecated `new Buffer()` 'unicorn/no-new-buffer': ERROR, // disallow passing single-element arrays to `Promise` methods @@ -621,6 +627,8 @@ const base = { 'unicorn/prefer-object-from-entries': ERROR, // prefer omitting the `catch` binding parameter 'unicorn/prefer-optional-catch-binding': ERROR, + // prefer using `structuredClone` to create a deep clone + 'unicorn/prefer-structured-clone': ERROR, // prefer using `Set#size` instead of `Array#length` 'unicorn/prefer-set-size': ERROR, // prefer `String#replaceAll()` over regex searches with the global flag @@ -1142,7 +1150,7 @@ const forbidES2023IntlBuiltIns = { 'es/no-intl-pluralrules-prototype-selectrange': ERROR, }; -const forbidModernESBuiltIns = { +const forbidModernBuiltIns = { ...forbidESAnnexBBuiltIns, ...forbidES5BuiltIns, ...forbidES2015BuiltIns, @@ -1162,6 +1170,8 @@ const forbidModernESBuiltIns = { ...forbidES2021IntlBuiltIns, ...forbidES2022IntlBuiltIns, ...forbidES2023IntlBuiltIns, + // prefer using `structuredClone` to create a deep clone + 'unicorn/prefer-structured-clone': OFF, }; const polyfills = { @@ -1208,7 +1218,7 @@ const nodePackages = { // enforces the use of `catch()` on un-returned promises 'promise/catch-or-return': ERROR, // disallow unsupported ECMAScript built-ins on the specified version - 'node/no-unsupported-features/node-builtins': [ERROR, { version: PACKAGES_NODE_VERSIONS }], + 'node/no-unsupported-features/node-builtins': [ERROR, { version: PACKAGES_NODE_VERSIONS, allowExperimental: false }], // prefer `node:` protocol 'node/prefer-node-protocol': OFF, // prefer promises @@ -1224,6 +1234,8 @@ const nodePackages = { 'unicorn/prefer-node-protocol': OFF, // prefer omitting the `catch` binding parameter 'unicorn/prefer-optional-catch-binding': OFF, + // prefer using `structuredClone` to create a deep clone + 'unicorn/prefer-structured-clone': OFF, ...disable(forbidES5BuiltIns), ...disable(forbidES2015BuiltIns), ...disable(forbidES2016BuiltIns), @@ -1250,8 +1262,8 @@ const nodePackages = { const nodeDev = { // disallow unsupported ECMAScript built-ins on the specified version - 'node/no-unsupported-features/node-builtins': [ERROR, { version: DEV_NODE_VERSIONS, ignores: ['fetch'] }], - ...disable(forbidModernESBuiltIns), + 'node/no-unsupported-features/node-builtins': [ERROR, { version: DEV_NODE_VERSIONS, ignores: ['fetch'], allowExperimental: false }], + ...disable(forbidModernBuiltIns), ...forbidES2023BuiltIns, 'es/no-array-prototype-findlast-findlastindex': OFF, ...forbidES2024BuiltIns, @@ -1562,7 +1574,7 @@ export default [ 'tests/@(unit-pure|worker)/**', 'tests/compat/@(browsers|hermes|node|rhino)-runner.js', ], - rules: forbidModernESBuiltIns, + rules: forbidModernBuiltIns, }, { files: [ diff --git a/tests/eslint/package-lock.json b/tests/eslint/package-lock.json index 8ee8dca043c1..23ba7e3b760c 100644 --- a/tests/eslint/package-lock.json +++ b/tests/eslint/package-lock.json @@ -15,13 +15,13 @@ "eslint-plugin-es-x": "^7.6.0", "eslint-plugin-import-x": "^0.5.0", "eslint-plugin-jsonc": "^2.15.1", - "eslint-plugin-n": "^17.5.1", + "eslint-plugin-n": "^17.6.0", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-qunit": "^8.1.1", "eslint-plugin-redos": "^4.5.0-beta.6", "eslint-plugin-regexp": "^2.5.0", "eslint-plugin-sonarjs": "^1.0.3", - "eslint-plugin-unicorn": "^52.0.0", + "eslint-plugin-unicorn": "^53.0.0", "globals": "^15.2.0", "jsonc-eslint-parser": "^2.4.0" } @@ -1191,9 +1191,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.761", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.761.tgz", - "integrity": "sha512-PIbxpiJGx6Bb8dQaonNc6CGTRlVntdLg/2nMa1YhnrwYOORY9a3ZgGN0UQYE6lAcj/lkyduJN7BPt/JiY+jAQQ==", + "version": "1.4.762", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.762.tgz", + "integrity": "sha512-rrFvGweLxPwwSwJOjIopy3Vr+J3cIPtZzuc74bmlvmBIgQO3VYJDvVrlj94iKZ3ukXUH64Ex31hSfRTLqvjYJQ==", "dev": true }, "node_modules/enhanced-resolve": { @@ -1855,9 +1855,9 @@ } }, "node_modules/eslint-plugin-n": { - "version": "17.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.5.1.tgz", - "integrity": "sha512-+E242KoY16xtwqqBRgSsDCrZ3K40jg3Np9fOgQyakcHaqymK3bnxYB1F1oe8Ksts8TDDViROFgraoLzbWhfHVw==", + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.6.0.tgz", + "integrity": "sha512-Y73o88ROwbCtVCCmZjYlYcPYkOG7mIzxxVK1XFRSa2epbKWtAPsmYpAD0pqxg/ZwlcWxMDceQPKHYQi4VIHz7w==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", @@ -1977,17 +1977,17 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "52.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", - "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", + "version": "53.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-53.0.0.tgz", + "integrity": "sha512-kuTcNo9IwwUCfyHGwQFOK/HjJAYzbODHN3wP0PgqbW+jbXqpNWxNVpVhj2tO9SixBwuAdmal8rVcWKBxwFnGuw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.5", "@eslint-community/eslint-utils": "^4.4.0", - "@eslint/eslintrc": "^2.1.4", + "@eslint/eslintrc": "^3.0.2", "ci-info": "^4.0.0", "clean-regexp": "^1.0.0", - "core-js-compat": "^3.34.0", + "core-js-compat": "^3.37.0", "esquery": "^1.5.0", "indent-string": "^4.0.0", "is-builtin-module": "^3.2.1", @@ -1996,11 +1996,11 @@ "read-pkg-up": "^7.0.1", "regexp-tree": "^0.1.27", "regjsparser": "^0.10.0", - "semver": "^7.5.4", + "semver": "^7.6.1", "strip-indent": "^3.0.0" }, "engines": { - "node": ">=16" + "node": ">=18.18" }, "funding": { "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" @@ -2009,6 +2009,41 @@ "eslint": ">=8.56.0" } }, + "node_modules/eslint-plugin-unicorn/node_modules/@eslint/eslintrc": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.0.2.tgz", + "integrity": "sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", diff --git a/tests/eslint/package.json b/tests/eslint/package.json index e8b9f0aec675..97ae2f86e0d6 100644 --- a/tests/eslint/package.json +++ b/tests/eslint/package.json @@ -11,13 +11,13 @@ "eslint-plugin-es-x": "^7.6.0", "eslint-plugin-import-x": "^0.5.0", "eslint-plugin-jsonc": "^2.15.1", - "eslint-plugin-n": "^17.5.1", + "eslint-plugin-n": "^17.6.0", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-qunit": "^8.1.1", "eslint-plugin-redos": "^4.5.0-beta.6", "eslint-plugin-regexp": "^2.5.0", "eslint-plugin-sonarjs": "^1.0.3", - "eslint-plugin-unicorn": "^52.0.0", + "eslint-plugin-unicorn": "^53.0.0", "globals": "^15.2.0", "jsonc-eslint-parser": "^2.4.0" } diff --git a/tests/observables/package-lock.json b/tests/observables/package-lock.json index 8eee86368245..97ba48b63d61 100644 --- a/tests/observables/package-lock.json +++ b/tests/observables/package-lock.json @@ -641,9 +641,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.761", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.761.tgz", - "integrity": "sha512-PIbxpiJGx6Bb8dQaonNc6CGTRlVntdLg/2nMa1YhnrwYOORY9a3ZgGN0UQYE6lAcj/lkyduJN7BPt/JiY+jAQQ==", + "version": "1.4.762", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.762.tgz", + "integrity": "sha512-rrFvGweLxPwwSwJOjIopy3Vr+J3cIPtZzuc74bmlvmBIgQO3VYJDvVrlj94iKZ3ukXUH64Ex31hSfRTLqvjYJQ==", "dev": true, "peer": true }, diff --git a/tests/unit-global/es.aggregate-error.js b/tests/unit-global/es.aggregate-error.js index 3e1bfc79042d..cfc159aa3168 100644 --- a/tests/unit-global/es.aggregate-error.js +++ b/tests/unit-global/es.aggregate-error.js @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/throw-new-error -- testing */ const { create } = Object; QUnit.test('AggregateError', assert => { diff --git a/tests/unit-global/es.array.flat.js b/tests/unit-global/es.array.flat.js index 9e1a5a15c9e7..9626f6997973 100644 --- a/tests/unit-global/es.array.flat.js +++ b/tests/unit-global/es.array.flat.js @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/no-magic-array-flat-depth -- testing */ import { DESCRIPTORS, STRICT } from '../helpers/constants.js'; QUnit.test('Array#flat', assert => { diff --git a/tests/unit-global/esnext.async-disposable-stack.constructor.js b/tests/unit-global/esnext.async-disposable-stack.constructor.js index f8d9422e0d4f..04a7a051e1db 100644 --- a/tests/unit-global/esnext.async-disposable-stack.constructor.js +++ b/tests/unit-global/esnext.async-disposable-stack.constructor.js @@ -171,7 +171,7 @@ QUnit.test('AsyncDisposableStack#3', assert => { stack.use({ [Symbol.asyncDispose]: () => result += '6' }); stack.adopt({}, () => { throw new Error(5); }); stack.defer(() => result += '4'); - stack.use({ [Symbol.asyncDispose]: () => Promise.reject(Error(3)) }); + stack.use({ [Symbol.asyncDispose]: () => Promise.reject(new Error(3)) }); stack.adopt({}, () => Promise.resolve(result += '2')); stack.defer(() => Promise.resolve(result += '1')); diff --git a/tests/unit-global/esnext.suppressed-error.constructor.js b/tests/unit-global/esnext.suppressed-error.constructor.js index e52f58f6094f..6ea66f67c056 100644 --- a/tests/unit-global/esnext.suppressed-error.constructor.js +++ b/tests/unit-global/esnext.suppressed-error.constructor.js @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/throw-new-error -- testing */ QUnit.test('SuppressedError', assert => { assert.isFunction(SuppressedError); assert.arity(SuppressedError, 3); diff --git a/tests/unit-global/web.dom-exception.constructor.js b/tests/unit-global/web.dom-exception.constructor.js index 38dc78104034..1c4c7e2a1106 100644 --- a/tests/unit-global/web.dom-exception.constructor.js +++ b/tests/unit-global/web.dom-exception.constructor.js @@ -28,7 +28,7 @@ const errors = { DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 }, }; -const HAS_STACK = 'stack' in Error('1'); +const HAS_STACK = 'stack' in new Error('1'); QUnit.test('DOMException', assert => { assert.isFunction(DOMException); diff --git a/tests/unit-pure/es.aggregate-error.js b/tests/unit-pure/es.aggregate-error.js index 37517c27b749..70d4da0cf514 100644 --- a/tests/unit-pure/es.aggregate-error.js +++ b/tests/unit-pure/es.aggregate-error.js @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/throw-new-error -- testing */ import AggregateError from 'core-js-pure/es/aggregate-error'; import Symbol from 'core-js-pure/es/symbol'; import toString from 'core-js-pure/es/object/to-string'; diff --git a/tests/unit-pure/esnext.async-disposable-stack.constructor.js b/tests/unit-pure/esnext.async-disposable-stack.constructor.js index 9d5fbeb4cf83..e74c1bb83665 100644 --- a/tests/unit-pure/esnext.async-disposable-stack.constructor.js +++ b/tests/unit-pure/esnext.async-disposable-stack.constructor.js @@ -170,7 +170,7 @@ QUnit.test('AsyncDisposableStack#3', assert => { stack.use({ [Symbol.asyncDispose]: () => result += '6' }); stack.adopt({}, () => { throw new Error(5); }); stack.defer(() => result += '4'); - stack.use({ [Symbol.asyncDispose]: () => Promise.reject(Error(3)) }); + stack.use({ [Symbol.asyncDispose]: () => Promise.reject(new Error(3)) }); stack.adopt({}, () => Promise.resolve(result += '2')); stack.defer(() => Promise.resolve(result += '1')); diff --git a/tests/unit-pure/esnext.suppressed-error.constructor.js b/tests/unit-pure/esnext.suppressed-error.constructor.js index df80f1c33c60..dd55a1fb34e2 100644 --- a/tests/unit-pure/esnext.suppressed-error.constructor.js +++ b/tests/unit-pure/esnext.suppressed-error.constructor.js @@ -1,3 +1,4 @@ +/* eslint-disable unicorn/throw-new-error -- testing */ import SuppressedError from 'core-js-pure/actual/suppressed-error'; import Symbol from 'core-js-pure/es/symbol'; import toString from 'core-js-pure/es/object/to-string'; diff --git a/tests/unit-pure/web.dom-exception.constructor.js b/tests/unit-pure/web.dom-exception.constructor.js index aeb0507b62e0..df8f0f25a689 100644 --- a/tests/unit-pure/web.dom-exception.constructor.js +++ b/tests/unit-pure/web.dom-exception.constructor.js @@ -30,7 +30,7 @@ const errors = { DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 }, }; -const HAS_STACK = 'stack' in Error('1'); +const HAS_STACK = 'stack' in new Error('1'); QUnit.test('DOMException', assert => { assert.isFunction(DOMException);