diff --git a/.eslintrc.js b/.eslintrc.js index a5fbb768164e..df9c2577c5f0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -434,7 +434,7 @@ const base = { 'sonarjs/no-empty-collection': ERROR, // function calls should not pass extra arguments 'sonarjs/no-extra-arguments': ERROR, - // goolean expressions should not be gratuitous + // boolean expressions should not be gratuitous 'sonarjs/no-gratuitous-expressions': ERROR, // functions should not have identical implementations 'sonarjs/no-identical-functions': ERROR, @@ -1007,7 +1007,7 @@ module.exports = { sourceType: 'script', }, env: { - // unnececery global builtins disabled by related rules + // unnecessary global builtins disabled by related rules es2021: true, browser: true, node: true, diff --git a/CHANGELOG.md b/CHANGELOG.md index 568e6d5449a7..b79ce48292d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -315,7 +315,7 @@ - Added the missed `(es|stable)/instance/replace-all` entries - Updated compat data mapping for Opera - from Opera 69, the difference with Chrome versions increased to 14 - Compat data mapping for modern Android WebView to Chrome moved from targets parser directly to compat data -- Depracate `core-js-builder` `blacklist` option in favor of `exclude` +- Deprecate `core-js-builder` `blacklist` option in favor of `exclude` ##### 2.6.12 [LEGACY] - 2020.11.26 - Added code points / code units explicit feature detection in `String#at` for preventing breakage code which use obsolete `String#at` proposal polyfill @@ -350,7 +350,7 @@ - Updated all required dependencies ##### 3.6.5 - 2020.04.09 -- Updated Browserlist [#755](https://github.com/zloirock/core-js/issues/755) +- Updated Browserslist [#755](https://github.com/zloirock/core-js/issues/755) - Fixed `setImmediate` in Safari [#770](https://github.com/zloirock/core-js/issues/770), thanks [@dtinth](https://github.com/dtinth) - Fixed some regexp, thanks [@scottarc](https://github.com/scottarc) - Added OPEN_SOURCE_CONTRIBUTOR detection in `postinstall`, thanks [@scottarc](https://github.com/scottarc) @@ -551,8 +551,8 @@ - Refactoring. Many minor internal improvements and fixes like: - Improved `Symbol.keyFor` complexity to `O(1)` - Fixed the order of arguments validation in `String.prototype.{ endsWith, includes, startsWith }` - - Internal implementation of `RegExp#flags` helper now respect `dotAll` flag (mainly ralated to the `pure` version) - - Performace optimizations related old V8 + - Internal implementation of `RegExp#flags` helper now respect `dotAll` flag (mainly related to the `pure` version) + - Performance optimizations related old V8 - Etc. ##### 3.1.3 - 2019.05.27 @@ -728,7 +728,7 @@ - `delay` - Add `.sham` flag to features which can't be properly polyfilled and / or not recommended for usage: - `Symbol` constructor - we can't add new primitives. `Object.prototype` accessors too expensive. - - `Object.{create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptos}`, `Reflect.{defineProperty, getOwnPropertyDescriptor}` can't be properly polyfilled without descriptors support. + - `Object.{create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptors}`, `Reflect.{defineProperty, getOwnPropertyDescriptor}` can't be properly polyfilled without descriptors support. - `Object.{freeze, seal, preventExtensions}`, `Reflect.preventExtensions` can't be properly polyfilled in ES3 environment. - `Object.getPrototypeOf` can be deceived in ES3 environment. - `Reflect.construct` can't be polyfilled for a correct work with `newTarget` argument on built-ins. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71937c8a1210..3e8c5ca281e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,7 +21,7 @@ The coding style should follow our [`.eslintrc`](./.eslintrc.js). You can test i - In unit tests should be used modern syntax with our [minimalistic Babel config](./babel.config.js). Unit tests for the `pure` version should not use any modern standard library features. - In building tools and tests, performed in Node.js, should be used only available in Node.js 4 syntax and standard library. -File names should be in the kebab-case. Name of files with polyfills should follow naming convention `namespace.subnamespase-where-required.feature-name`, for example, `esnext.promise.try`. Top-level namespace could be `es` for stable ECMAScript features, `esnext` for ECMAScript proposals and `web` for other web standards. +File names should be in the kebab-case. Name of files with polyfills should follow naming convention `namespace.subnamespace-where-required.feature-name`, for example, `esnext.promise.try`. Top-level namespace could be `es` for stable ECMAScript features, `esnext` for ECMAScript proposals and `web` for other web standards. ## Testing diff --git a/README.md b/README.md index 8a91723de1c9..2a32bd717d82 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,7 @@ import "core-js/stage/2"; * `modules` path is an internal API, does not inject all required dependencies and can be changed in minor or patch releases. Use it only for a custom build and/or if you know what are you doing. * If you use `core-js` with the extension of native objects, recommended load all `core-js` modules at the top of the entry point of your application, otherwise, you can have conflicts. * For example, Google Maps use their own `Symbol.iterator`, conflicting with `Array.from`, `URLSearchParams` and/or something else from `core-js`, see [related issues](https://github.com/zloirock/core-js/search?q=Google+Maps&type=Issues). - * Such conflicts also resolvable by discrovering and manual adding each conflicting entry from `core-js`. + * Such conflicts also resolvable by discovering and manual adding each conflicting entry from `core-js`. * `core-js` is extremely modular and uses a lot of very tiny modules, because of that for usage in browsers bundle up `core-js` instead of usage loader for each file, otherwise, you will have hundreds of requests. #### CommonJS and prototype methods without global namespace pollution[⬆](#index) @@ -1825,7 +1825,7 @@ globalThis.Array === Array; // => true #### Finished proposals[⬆](#index) -Finished (stage 4) proposals already marked in `core-js` as stable ECMAScript, they are available in `core-js/stable` and `core-js/es` namespace, you can find then in related sections of this doc. However, even for finished proposals, `core-js` provide a way to include only featues for a specific proposal like `core-js/proposals/proposal-name`. +Finished (stage 4) proposals already marked in `core-js` as stable ECMAScript, they are available in `core-js/stable` and `core-js/es` namespace, you can find then in related sections of this doc. However, even for finished proposals, `core-js` provide a way to include only features for a specific proposal like `core-js/proposals/proposal-name`. ##### [`globalThis`](https://github.com/tc39/proposal-global)[⬆](#index) ```js diff --git a/deno/corejs/index.js b/deno/corejs/index.js index 03a2c7ea8c1a..eb1f343b5113 100644 --- a/deno/corejs/index.js +++ b/deno/corejs/index.js @@ -969,7 +969,7 @@ var createElement = __webpack_require__(39); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { - // eslint-disable-next-line es/no-object-defineproperty -- requied for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; @@ -2683,7 +2683,7 @@ var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR'); // Fixing native typed arrays in Opera Presto crashes the browser, see #595 var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; -var TYPED_ARRAY_TAG_REQIRED = false; +var TYPED_ARRAY_TAG_REQUIRED = false; var NAME, Constructor, Prototype; var TypedArrayConstructorsList = { @@ -2804,7 +2804,7 @@ if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== } if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { - TYPED_ARRAY_TAG_REQIRED = true; + TYPED_ARRAY_TAG_REQUIRED = true; defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); @@ -2816,7 +2816,7 @@ if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { module.exports = { NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR, - TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, + TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG, aTypedArray: aTypedArray, aTypedArrayConstructor: aTypedArrayConstructor, exportTypedArrayMethod: exportTypedArrayMethod, @@ -5587,7 +5587,7 @@ var collection = __webpack_require__(164); var collectionWeak = __webpack_require__(177); var isObject = __webpack_require__(17); var isExtensible = __webpack_require__(169); -var enforceIternalState = __webpack_require__(45).enforce; +var enforceInternalState = __webpack_require__(45).enforce; var NATIVE_WEAK_MAP = __webpack_require__(46); var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; @@ -5617,28 +5617,28 @@ if (NATIVE_WEAK_MAP && IS_IE11) { redefineAll(WeakMapPrototype, { 'delete': function (key) { if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); + var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeDelete(this, key) || state.frozen['delete'](key); } return nativeDelete(this, key); }, has: function has(key) { if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); + var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas(this, key) || state.frozen.has(key); } return nativeHas(this, key); }, get: function get(key) { if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); + var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key); } return nativeGet(this, key); }, set: function set(key, value) { if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); + var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value); } else nativeSet(this, key, value); @@ -6930,7 +6930,7 @@ var iterate = __webpack_require__(81); // https://github.com/tc39/proposal-collection-methods $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { // eslint-disable-next-line no-unused-vars -- required for `.length` - merge: function merge(iterable /* ...iterbles */) { + merge: function merge(iterable /* ...iterables */) { var map = anObject(this); var setter = aCallable(map.set); var argumentsLength = arguments.length; @@ -9632,7 +9632,7 @@ var mapSet = uncurryThis(MapPrototype.set); var setAdd = uncurryThis(Set.prototype.add); var objectKeys = getBuiltin('Object', 'keys'); var push = uncurryThis([].push); -var bolleanValueOf = uncurryThis(true.valueOf); +var booleanValueOf = uncurryThis(true.valueOf); var numberValueOf = uncurryThis(1.0.valueOf); var stringValueOf = uncurryThis(''.valueOf); var getFlags = uncurryThis(regExpFlags); @@ -9837,7 +9837,7 @@ var structuredCloneInternal = function (value, map) { cloned = Object(value.valueOf()); break; case 'Boolean': - cloned = Object(bolleanValueOf(value)); + cloned = Object(booleanValueOf(value)); break; case 'Number': cloned = Object(numberValueOf(value)); @@ -9867,7 +9867,7 @@ var structuredCloneInternal = function (value, map) { } } } catch (error) { - throw new DOMException('ArrayBuffer is deatched', DATA_CLONE_ERROR); + throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR); } break; case 'SharedArrayBuffer': // SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original diff --git a/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md b/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md index 3440ef5df82d..10f15fe9d830 100644 --- a/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md +++ b/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md @@ -114,7 +114,7 @@ The most important one is support for [`URL`](https://developer.mozilla.org/en-U Another popular feature request was support for the [`.forEach` method on DOM collection](https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach). Since `core-js` already polyfilled iterators of DOM collections, why not add also `.forEach` to `NodeList` and `DOMTokenList`? -#### Removed obsolete featues: +#### Removed obsolete features: - `Reflect.enumerate` because it's removed from the spec - `System.global` and `global` since now they are replaced by `globalThis` @@ -394,7 +394,7 @@ We should drop IE8- and other engines without basic ES5 support in `core-js@4`. `core-js` is currently focused on ECMAScript support, but it also supports a few web standards features which are available cross-platform and closely related to ECMAScript. Adding polyfills for web standards like `fetch` is a very popular feature request. -The main reason why `core-js` doesn’t include them was that it would have seriously increased bundles size and it would have forced `core-js` users to load features which might not have been needed. Now `core-js` is maximally modular, user can include only some choosen features, there are tools like `@babel/preset-env` and `@babel/runtime` which helps to get rid of unused or unnecessary polyfills. +The main reason why `core-js` doesn’t include them was that it would have seriously increased bundles size and it would have forced `core-js` users to load features which might not have been needed. Now `core-js` is maximally modular, user can include only some chosen features, there are tools like `@babel/preset-env` and `@babel/runtime` which helps to get rid of unused or unnecessary polyfills. Maybe it's time to revisit this old decision? @@ -432,7 +432,7 @@ More other, it will work asynchronously. It's a critical problem for feature det [The first implementation of built-in modules without a proper way of transpiling / polyfilling already available](https://developers.google.com/web/updates/2019/03/kv-storage). If it will not be revised, built-in modules will not be able to be polyfilled in the current `core-js` format. The proposed way of polyfilling will seriously complicate the lives of developers. -The issue with the standard library can be solved by adding a new global (maybe it will be the last one?): a registry of built-in modules which will allow getting and seting them synchronously, like +The issue with the standard library can be solved by adding a new global (maybe it will be the last one?): a registry of built-in modules which will allow getting and setting them synchronously, like ```js StandardLibraryRegistry.get(moduleName); StandardLibraryRegistry.set(moduleName, value); diff --git a/docs/zh_CN/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md b/docs/zh_CN/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md index 2d4cbf77b90a..cc7cf78fd788 100644 --- a/docs/zh_CN/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md +++ b/docs/zh_CN/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md @@ -123,7 +123,7 @@ #### 移除过时的功能: -- `Reflect.enumrate` 因为他已经从标准中移除了 +- `Reflect.enumerate` 因为他已经从标准中移除了 - `System.global` 和 `global` 现在他们已经被 `globalThis` 代替 - `Array.prototype.flatten` 现在被 `Array.prototype.flat` 代替 - `asap` 被 `queueMicrotask` 代替 @@ -264,7 +264,7 @@ import "regenerator-runtime/runtime"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopaables.flat-map"; import "core-js/modules/es.object.from-entries"; -import "core-js/modlues/web.immediate"; +import "core-js/modules/web.immediate"; ``` 当目标浏览器是 `chrome 73`(它完全支持 ES2019 标准库),他将变为很少的引入: @@ -385,7 +385,7 @@ _matchAllInstanceProperty(string).call(string, /something/g); 有些老的问题已经被修复了。例如,下面这种流行的模式在 `@babel/runtime-corejs2` 不工作,但是在 `@babel/runtime-corejs3` 被支持。 ```js -myArrayLikeObject[Symbol.tierator] = Array.prototype[Symbol.iterator]; +myArrayLikeObject[Symbol.iterator] = Array.prototype[Symbol.iterator]; ``` 尽管 `@babel/runtime` 早期版本不支持实例方法,但是使用一些自定义的帮助函数能够支持迭代(`[Symbol.iterator]()` 和他的presence)。之前不支持提取 `[Symbol.iterator]` 方法,但是现在支持了。 @@ -424,7 +424,7 @@ myArrayLikeObject[Symbol.tierator] = Array.prototype[Symbol.iterator]; ### 针对目标环境的 `@babel/runtime` -目前,我们不能像对 `@babel/preset-env` 那样为 `@babel/runtimne` 设置目标加环境。这意味即使目标是现代浏览器, `@babel/runtime` 也将注所有可能的 polyfills:这不必要的增加了最终构建包的大小。 +目前,我们不能像对 `@babel/preset-env` 那样为 `@babel/runtime` 设置目标加环境。这意味即使目标是现代浏览器, `@babel/runtime` 也将注所有可能的 polyfills:这不必要的增加了最终构建包的大小。 现在 `core-js-compat` 包函全部必要数据,将来,可以在 `@babel/runtime` 中添加对目标环境的编译支持,并且在 `@babel/preset-env` 中添加 `useBuiltIns: runtime` 选项。 diff --git a/packages/core-js/internals/array-buffer-view-core.js b/packages/core-js/internals/array-buffer-view-core.js index 5851d2279ffa..e6336372b264 100644 --- a/packages/core-js/internals/array-buffer-view-core.js +++ b/packages/core-js/internals/array-buffer-view-core.js @@ -30,7 +30,7 @@ var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR'); // Fixing native typed arrays in Opera Presto crashes the browser, see #595 var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera'; -var TYPED_ARRAY_TAG_REQIRED = false; +var TYPED_ARRAY_TAG_REQUIRED = false; var NAME, Constructor, Prototype; var TypedArrayConstructorsList = { @@ -151,7 +151,7 @@ if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== } if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { - TYPED_ARRAY_TAG_REQIRED = true; + TYPED_ARRAY_TAG_REQUIRED = true; defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); @@ -163,7 +163,7 @@ if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { module.exports = { NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR, - TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, + TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG, aTypedArray: aTypedArray, aTypedArrayConstructor: aTypedArrayConstructor, exportTypedArrayMethod: exportTypedArrayMethod, diff --git a/packages/core-js/internals/ie8-dom-define.js b/packages/core-js/internals/ie8-dom-define.js index c47bc17536c6..f0941cce6b08 100644 --- a/packages/core-js/internals/ie8-dom-define.js +++ b/packages/core-js/internals/ie8-dom-define.js @@ -4,7 +4,7 @@ var createElement = require('../internals/document-create-element'); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { - // eslint-disable-next-line es/no-object-defineproperty -- requied for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; diff --git a/packages/core-js/modules/es.object.define-property.js b/packages/core-js/modules/es.object.define-property.js index 64ad4d5c77de..3021982ea67a 100644 --- a/packages/core-js/modules/es.object.define-property.js +++ b/packages/core-js/modules/es.object.define-property.js @@ -1,9 +1,9 @@ var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); -var objectDefinePropertyModile = require('../internals/object-define-property'); +var objectDefinePropertyModule = require('../internals/object-define-property'); // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty $({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, { - defineProperty: objectDefinePropertyModile.f + defineProperty: objectDefinePropertyModule.f }); diff --git a/packages/core-js/modules/es.weak-map.js b/packages/core-js/modules/es.weak-map.js index 7044313a2cfe..149ee7222944 100644 --- a/packages/core-js/modules/es.weak-map.js +++ b/packages/core-js/modules/es.weak-map.js @@ -7,7 +7,7 @@ var collection = require('../internals/collection'); var collectionWeak = require('../internals/collection-weak'); var isObject = require('../internals/is-object'); var isExtensible = require('../internals/object-is-extensible'); -var enforceIternalState = require('../internals/internal-state').enforce; +var enforceInternalState = require('../internals/internal-state').enforce; var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; @@ -37,28 +37,28 @@ if (NATIVE_WEAK_MAP && IS_IE11) { redefineAll(WeakMapPrototype, { 'delete': function (key) { if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); + var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeDelete(this, key) || state.frozen['delete'](key); } return nativeDelete(this, key); }, has: function has(key) { if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); + var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas(this, key) || state.frozen.has(key); } return nativeHas(this, key); }, get: function get(key) { if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); + var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key); } return nativeGet(this, key); }, set: function set(key, value) { if (isObject(key) && !isExtensible(key)) { - var state = enforceIternalState(this); + var state = enforceInternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value); } else nativeSet(this, key, value); diff --git a/packages/core-js/modules/esnext.map.merge.js b/packages/core-js/modules/esnext.map.merge.js index 18434f6d7153..033dabba67b5 100644 --- a/packages/core-js/modules/esnext.map.merge.js +++ b/packages/core-js/modules/esnext.map.merge.js @@ -9,7 +9,7 @@ var iterate = require('../internals/iterate'); // https://github.com/tc39/proposal-collection-methods $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, { // eslint-disable-next-line no-unused-vars -- required for `.length` - merge: function merge(iterable /* ...iterbles */) { + merge: function merge(iterable /* ...iterables */) { var map = anObject(this); var setter = aCallable(map.set); var argumentsLength = arguments.length; diff --git a/packages/core-js/modules/web.structured-clone.js b/packages/core-js/modules/web.structured-clone.js index f10752b11a88..b1b40764a115 100644 --- a/packages/core-js/modules/web.structured-clone.js +++ b/packages/core-js/modules/web.structured-clone.js @@ -43,7 +43,7 @@ var mapSet = uncurryThis(MapPrototype.set); var setAdd = uncurryThis(Set.prototype.add); var objectKeys = getBuiltin('Object', 'keys'); var push = uncurryThis([].push); -var bolleanValueOf = uncurryThis(true.valueOf); +var booleanValueOf = uncurryThis(true.valueOf); var numberValueOf = uncurryThis(1.0.valueOf); var stringValueOf = uncurryThis(''.valueOf); var getFlags = uncurryThis(regExpFlags); @@ -248,7 +248,7 @@ var structuredCloneInternal = function (value, map) { cloned = Object(value.valueOf()); break; case 'Boolean': - cloned = Object(bolleanValueOf(value)); + cloned = Object(booleanValueOf(value)); break; case 'Number': cloned = Object(numberValueOf(value)); @@ -278,7 +278,7 @@ var structuredCloneInternal = function (value, map) { } } } catch (error) { - throw new DOMException('ArrayBuffer is deatched', DATA_CLONE_ERROR); + throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR); } break; case 'SharedArrayBuffer': // SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original diff --git a/tests/pure/esnext.async-iterator.from.js b/tests/pure/esnext.async-iterator.from.js index 53fc0ea22ea0..0cc6b185b120 100644 --- a/tests/pure/esnext.async-iterator.from.js +++ b/tests/pure/esnext.async-iterator.from.js @@ -24,7 +24,7 @@ QUnit.test('AsyncIterator.from', assert => { next: () => { /* empty */ }, }); - assert.same(AsyncIterator.from(asyncIterator), asyncIterator, 'does not wrap AsyncIterator instanses'); + assert.same(AsyncIterator.from(asyncIterator), asyncIterator, 'does not wrap AsyncIterator instances'); assert.throws(() => from(undefined), TypeError); assert.throws(() => from(null), TypeError); diff --git a/tests/pure/web.timers.js b/tests/pure/web.timers.js index c0fcfcfed188..fa4474fceff4 100644 --- a/tests/pure/web.timers.js +++ b/tests/pure/web.timers.js @@ -17,9 +17,9 @@ QUnit.test('setTimeout / clearTimeout', assert => { timeLimitedPromise(50, resolve => { clearTimeout(setTimeout(resolve, 10)); }).then(() => { - assert.avoid('clearImmediate works with wraped setTimeout'); + assert.avoid('clearImmediate works with wrapped setTimeout'); }).catch(() => { - assert.required('clearImmediate works with wraped setTimeout'); + assert.required('clearImmediate works with wrapped setTimeout'); }).then(assert.async()); }); diff --git a/tests/pure/web.url.js b/tests/pure/web.url.js index 68dc1e2b6a93..197b2abea52b 100644 --- a/tests/pure/web.url.js +++ b/tests/pure/web.url.js @@ -340,7 +340,7 @@ QUnit.test('URL#hostname', assert => { // url = new URL('http://zloirock.ru:81/'); // url.hostname = 'example.com:82'; // assert.same(url.hostname, 'example.com'); // '' in Chrome - // assert.same(String(url), 'http://example.com:81/'); // 'ttp://example.com:82:81/' in Chrome + // assert.same(String(url), 'http://example.com:81/'); // 'http://example.com:82:81/' in Chrome url = new URL('http://zloirock.ru/foo'); url.hostname = '測試'; @@ -594,7 +594,7 @@ QUnit.test('URL.sham', assert => { assert.same(URL.sham, DESCRIPTORS ? undefined : true); }); -// `core-js` URL implementation pass all (exclude some encoding-ralated) tests +// `core-js` URL implementation pass all (exclude some encoding-related) tests // from the next 3 test cases, but URLs from all of popular browsers fail a serious part of tests. // Replacing all of them does not looks like a good idea, so next test cases disabled by default. diff --git a/tests/tests/es.string.search.js b/tests/tests/es.string.search.js index a6cf1c43cc4c..71bbe977c8c4 100644 --- a/tests/tests/es.string.search.js +++ b/tests/tests/es.string.search.js @@ -65,7 +65,7 @@ const run = assert => { assert.same(Object('test string').search(/string/i), 5, 'S15.5.4.12_A2_T3'); assert.same(Object('test string').search(/Four/), -1, 'S15.5.4.12_A2_T4'); assert.same(Object('one two three four five').search(/four/), 14, 'S15.5.4.12_A2_T5'); - assert.same(Object('test string').search('notexist'), -1, 'S15.5.4.12_A2_T6'); + assert.same(Object('test string').search('nonexistent'), -1, 'S15.5.4.12_A2_T6'); assert.same(Object('test string probe').search('string pro'), 5, 'S15.5.4.12_A2_T7'); let string = Object('power of the power of the power of the power of the power of the power of the great sword'); assert.same(string.search(/the/), string.search(/the/g), 'S15.5.4.12_A3_T1'); diff --git a/tests/tests/es.string.split.js b/tests/tests/es.string.split.js index 93fe9708abec..b11336b78935 100644 --- a/tests/tests/es.string.split.js +++ b/tests/tests/es.string.split.js @@ -207,7 +207,7 @@ const run = assert => { } try { class F { - costructor(value) { + constructor(value) { this.value = value; } valueOf() { diff --git a/tests/tests/esnext.async-iterator.from.js b/tests/tests/esnext.async-iterator.from.js index 0ef583c42afd..49e6e193eee5 100644 --- a/tests/tests/esnext.async-iterator.from.js +++ b/tests/tests/esnext.async-iterator.from.js @@ -22,7 +22,7 @@ QUnit.test('AsyncIterator.from', assert => { next: () => { /* empty */ }, }); - assert.same(AsyncIterator.from(asyncIterator), asyncIterator, 'does not wrap AsyncIterator instanses'); + assert.same(AsyncIterator.from(asyncIterator), asyncIterator, 'does not wrap AsyncIterator instances'); assert.throws(() => from(undefined), TypeError); assert.throws(() => from(null), TypeError); diff --git a/tests/tests/web.timers.js b/tests/tests/web.timers.js index 9143a320209d..65c3ec9084c1 100644 --- a/tests/tests/web.timers.js +++ b/tests/tests/web.timers.js @@ -14,9 +14,9 @@ QUnit.test('setTimeout / clearTimeout', assert => { timeLimitedPromise(50, resolve => { clearTimeout(setTimeout(resolve, 10)); }).then(() => { - assert.avoid('clearImmediate works with wraped setTimeout'); + assert.avoid('clearImmediate works with wrapped setTimeout'); }).catch(() => { - assert.required('clearImmediate works with wraped setTimeout'); + assert.required('clearImmediate works with wrapped setTimeout'); }).then(assert.async()); }); diff --git a/tests/tests/web.url.js b/tests/tests/web.url.js index a8a214fe2f49..4112d01d3c5a 100644 --- a/tests/tests/web.url.js +++ b/tests/tests/web.url.js @@ -338,7 +338,7 @@ QUnit.test('URL#hostname', assert => { // url = new URL('http://zloirock.ru:81/'); // url.hostname = 'example.com:82'; // assert.same(url.hostname, 'example.com'); // '' in Chrome - // assert.same(String(url), 'http://example.com:81/'); // 'ttp://example.com:82:81/' in Chrome + // assert.same(String(url), 'http://example.com:81/'); // 'http://example.com:82:81/' in Chrome url = new URL('http://zloirock.ru/foo'); url.hostname = '測試'; @@ -601,7 +601,7 @@ QUnit.test('URL.sham', assert => { assert.same(URL.sham, DESCRIPTORS ? undefined : true); }); -// `core-js` URL implementation pass all (exclude some encoding-ralated) tests +// `core-js` URL implementation pass all (exclude some encoding-related) tests // from the next 3 test cases, but URLs from all of popular browsers fail a serious part of tests. // Replacing all of them does not looks like a good idea, so next test cases disabled by default.