Skip to content

Commit

Permalink
Spelling (#1023)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
  • Loading branch information
jsoref and jsoref committed Dec 19, 2021
1 parent 185033c commit 0c4d69d
Show file tree
Hide file tree
Showing 21 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions deno/corejs/index.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
} });
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md
Expand Up @@ -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`
Expand Down Expand Up @@ -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?

Expand Down Expand Up @@ -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);
Expand Down
Expand Up @@ -123,7 +123,7 @@

#### 移除过时的功能:

- `Reflect.enumrate` 因为他已经从标准中移除了
- `Reflect.enumerate` 因为他已经从标准中移除了
- `System.global``global` 现在他们已经被 `globalThis` 代替
- `Array.prototype.flatten` 现在被 `Array.prototype.flat` 代替
- `asap``queueMicrotask` 代替
Expand Down Expand Up @@ -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 标准库),他将变为很少的引入:
Expand Down Expand Up @@ -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]` 方法,但是现在支持了。
Expand Down Expand Up @@ -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` 选项。

Expand Down
6 changes: 3 additions & 3 deletions packages/core-js/internals/array-buffer-view-core.js
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
} });
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/internals/ie8-dom-define.js
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions 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
});

0 comments on commit 0c4d69d

Please sign in to comment.