-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spelling #1023
Spelling #1023
Changes from all commits
73fe4f5
b7b8c07
33e2363
52339ea
21d178a
9502e50
53510ba
3e7f876
1f0a581
2529ef5
1aef9ee
060e21e
f6ce244
905b025
d261aac
7089ed4
acf1f1e
771f015
72f2ef6
ce8c20e
6c8a7df
f5edf7c
781b457
af124ca
17cee41
8c5a644
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some projects don't want PRs to include changes to generated files. I'm not sure if this is one of them. Let me know. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't care - this file will be automatically regenerated on the next release. |
||
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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fwiw, markdown best practice includes not including trailing |
||
|
||
- `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); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,7 @@ | |
|
||
#### 移除过时的功能: | ||
|
||
- `Reflect.enumrate` 因为他已经从标准中移除了 | ||
- `Reflect.enumerate` 因为他已经从标准中移除了 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I generally avoid touching non English content, but my tool doesn't care and is actually quite happy to check content that only uses latin letters for code. As always, happy to drop. |
||
- `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"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is broken code and would be bad for end users. |
||
``` | ||
|
||
当目标浏览器是 `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]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
``` | ||
|
||
尽管 `@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` 选项。 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some repositories are whimsical; this repository does not appear to be one of them