Skip to content

Commit

Permalink
Merge pull request #1100 from dev-itsheng/patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock authored Jul 4, 2022
2 parents f8e29e6 + f2e6605 commit 5d42952
Show file tree
Hide file tree
Showing 24 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion packages/core-js/internals/regexp-exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ if (PATCH) {
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
call(nativeReplace, match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/es.regexp.constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var charAt = uncurryThis(''.charAt);
var replace = uncurryThis(''.replace);
var stringIndexOf = uncurryThis(''.indexOf);
var stringSlice = uncurryThis(''.slice);
// TODO: Use only propper RegExpIdentifierName
// TODO: Use only proper RegExpIdentifierName
var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
var re1 = /a/g;
var re2 = /a/g;
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js/modules/es.typed-array.reduce-right.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var $reduceRight = require('../internals/array-reduce').right;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;

// `%TypedArray%.prototype.reduceRicht` method
// `%TypedArray%.prototype.reduceRight` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright
exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {
var length = arguments.length;
Expand Down
2 changes: 1 addition & 1 deletion tests/pure/es.array.from.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ QUnit.test('Array.from', assert => {
}, () => {
throw new Error();
}), 'Uses ToLength');
assert.arrayEqual(from([], undefined), [], 'Works with undefined as asecond argument');
assert.arrayEqual(from([], undefined), [], 'Works with undefined as second argument');
assert.throws(() => from([], null), TypeError, 'Throws with null as second argument');
assert.throws(() => from([], 0), TypeError, 'Throws with 0 as second argument');
assert.throws(() => from([], ''), TypeError, 'Throws with "" as second argument');
Expand Down
2 changes: 1 addition & 1 deletion tests/pure/es.map.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ QUnit.test('Map#size', assert => {
const getter = sizeDescriptor && sizeDescriptor.get;
const setter = sizeDescriptor && sizeDescriptor.set;
assert.same(typeof getter, 'function', 'size is getter');
assert.same(typeof setter, 'undefined', 'size isnt setter');
assert.same(typeof setter, 'undefined', 'size isn\'t setter');
assert.throws(() => Map.prototype.size, TypeError);
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/pure/es.number.epsilon.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import EPSILON from 'core-js-pure/es/number/epsilon';

QUnit.test('Number.EPSILON', assert => {
assert.same(EPSILON, 2 ** -52, 'Is 2^-52');
assert.notSame(1, 1 + EPSILON, '1 isnt 1 + EPSILON');
assert.notSame(1, 1 + EPSILON, '1 isn\'t 1 + EPSILON');
assert.same(1, 1 + EPSILON / 2, '1 is 1 + EPSILON / 2');
});
4 changes: 2 additions & 2 deletions tests/pure/es.object.is.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ QUnit.test('Object.is', assert => {
assert.isFunction(is);
assert.true(is(1, 1), '1 is 1');
assert.true(is(NaN, NaN), '1 is 1');
assert.false(is(0, -0), '0 isnt -0');
assert.false(is({}, {}), '{} isnt {}');
assert.false(is(0, -0), '0 isn\'t -0');
assert.false(is({}, {}), '{} isn\'t {}');
});
2 changes: 1 addition & 1 deletion tests/pure/es.set.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ QUnit.test('Set#size', assert => {
const getter = sizeDescriptor && sizeDescriptor.get;
const setter = sizeDescriptor && sizeDescriptor.set;
assert.same(typeof getter, 'function', 'size is getter');
assert.same(typeof setter, 'undefined', 'size isnt setter');
assert.same(typeof setter, 'undefined', 'size isn\'t setter');
assert.throws(() => {
Set.prototype.size;
}, TypeError);
Expand Down
4 changes: 2 additions & 2 deletions tests/pure/es.weak-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ QUnit.test('WeakMap#delete', assert => {
assert.true(weakmap.has(a), 'WeakMap has values before .delete() #1');
assert.true(weakmap.has(b), 'WeakMap has values before .delete() #2');
weakmap.delete(a);
assert.false(weakmap.has(a), 'WeakMap hasn`t value after .delete() #1');
assert.true(weakmap.has(b), 'WeakMap hasn`t value after .delete() #2');
assert.false(weakmap.has(a), 'WeakMap hasn\'t value after .delete() #1');
assert.true(weakmap.has(b), 'WeakMap hasn\'t value after .delete() #2');
assert.notThrows(() => !weakmap.delete(1), 'return false on primitive');
const object = {};
weakmap.set(object, 42);
Expand Down
6 changes: 3 additions & 3 deletions tests/pure/es.weak-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ QUnit.test('WeakSet#delete', assert => {
assert.true(weakset.has(a), 'WeakSet has values before .delete() #1');
assert.true(weakset.has(b), 'WeakSet has values before .delete() #2');
weakset.delete(a);
assert.false(weakset.has(a), 'WeakSet hasn`t value after .delete() #1');
assert.true(weakset.has(b), 'WeakSet hasn`t value after .delete() #2');
assert.false(weakset.has(a), 'WeakSet hasn\'t value after .delete() #1');
assert.true(weakset.has(b), 'WeakSet hasn\'t value after .delete() #2');
assert.notThrows(() => !weakset.delete(1), 'return false on primitive');
});

Expand All @@ -97,7 +97,7 @@ QUnit.test('WeakSet#has', assert => {
weakset.add(object);
assert.true(weakset.has(object), 'WeakSet has value after .add()');
weakset.delete(object);
assert.false(weakset.has(object), 'WeakSet hasn`t value after .delete()');
assert.false(weakset.has(object), 'WeakSet hasn\'t value after .delete()');
assert.notThrows(() => !weakset.has(1), 'return false on primitive');
});

Expand Down
2 changes: 1 addition & 1 deletion tests/pure/esnext.async-iterator.reduce.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ QUnit.test('AsyncIterator#reduce', assert => {
assert.same(it, 6, 'basic functionality, no initial');
return reduce.call(createIterator([]), (a, b) => a + b);
}).catch(() => {
assert.true(true, 'reduce an empty interble with no initial');
assert.true(true, 'reduce an empty iterable with no initial');
return reduce.call(createIterator([1]), () => { throw 42; }, 1);
}).catch(error => {
assert.same(error, 42, 'rejection on a callback error');
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/es.aggregate-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ QUnit.test('AggregateError', assert => {

assert.same(AggregateError.prototype.constructor, AggregateError, 'prototype constructor');
// eslint-disable-next-line no-prototype-builtins -- safe
assert.false(AggregateError.prototype.hasOwnProperty('cause'), 'prototype hasn`t cause');
assert.false(AggregateError.prototype.hasOwnProperty('cause'), 'prototype hasn\'t cause');

assert.true(AggregateError([1], 1) instanceof AggregateError, 'no cause, without new');
assert.true(new AggregateError([1], 1) instanceof AggregateError, 'no cause, with new');
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/es.array.flat-map.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable unicorn/prefer-array-flat -- reqired for testing */
/* eslint-disable unicorn/prefer-array-flat -- required for testing */
import { STRICT } from '../helpers/constants';

QUnit.test('Array#flatMap', assert => {
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/es.array.from.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ QUnit.test('Array.from', assert => {
}, () => {
throw new Error();
}).length === 0, 'Uses ToLength');
assert.arrayEqual(from([], undefined), [], 'Works with undefined as asecond argument');
assert.arrayEqual(from([], undefined), [], 'Works with undefined as second argument');
assert.throws(() => from([], null), TypeError, 'Throws with null as second argument');
assert.throws(() => from([], 0), TypeError, 'Throws with 0 as second argument');
assert.throws(() => from([], ''), TypeError, 'Throws with "" as second argument');
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/es.error.cause.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function runErrorTestCase($Error, ERROR_NAME) {

assert.same($Error.prototype.constructor, $Error, 'prototype constructor');
// eslint-disable-next-line no-prototype-builtins -- safe
assert.false($Error.prototype.hasOwnProperty('cause'), 'prototype hasn`t cause');
assert.false($Error.prototype.hasOwnProperty('cause'), 'prototype hasn\'t cause');

assert.true($Error(1) instanceof $Error, 'no cause, without new');
assert.true(new $Error(1) instanceof $Error, 'no cause, with new');
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/es.map.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ QUnit.test('Map#size', assert => {
const getter = sizeDescriptor && sizeDescriptor.get;
const setter = sizeDescriptor && sizeDescriptor.set;
assert.same(typeof getter, 'function', 'size is getter');
assert.same(typeof setter, 'undefined', 'size isnt setter');
assert.same(typeof setter, 'undefined', 'size isn\'t setter');
assert.throws(() => Map.prototype.size, TypeError);
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/es.number.epsilon.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ QUnit.test('Number.EPSILON', assert => {
assert.nonConfigurable(Number, 'EPSILON');
assert.nonWritable(Number, 'EPSILON');
assert.same(EPSILON, 2 ** -52, 'Is 2^-52');
assert.notSame(1, 1 + EPSILON, '1 isnt 1 + EPSILON');
assert.notSame(1, 1 + EPSILON, '1 isn\'t 1 + EPSILON');
assert.same(1, 1 + EPSILON / 2, '1 is 1 + EPSILON / 2');
});
4 changes: 2 additions & 2 deletions tests/tests/es.object.is.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ QUnit.test('Object.is', assert => {
assert.nonEnumerable(Object, 'is');
assert.true(is(1, 1), '1 is 1');
assert.true(is(NaN, NaN), '1 is 1');
assert.false(is(0, -0), '0 isnt -0');
assert.false(is({}, {}), '{} isnt {}');
assert.false(is(0, -0), '0 isn\'t -0');
assert.false(is({}, {}), '{} isn\'t {}');
});
6 changes: 3 additions & 3 deletions tests/tests/es.regexp.constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ if (DESCRIPTORS) {
assert.same({}.toString.call(RegExp()).slice(8, -1), 'RegExp');
assert.same({}.toString.call(new RegExp()).slice(8, -1), 'RegExp');
let regexp = /a/g;
assert.notSame(regexp, new RegExp(regexp), 'new RegExp(regexp) isnt regexp');
assert.notSame(regexp, new RegExp(regexp), 'new RegExp(regexp) isn\'t regexp');
assert.same(regexp, RegExp(regexp), 'RegExp(regexp) is regexp');
regexp[Symbol.match] = false;
assert.notSame(regexp, RegExp(regexp), 'RegExp(regexp) isnt regexp, changed Symbol.match');
assert.notSame(regexp, RegExp(regexp), 'RegExp(regexp) isn\'t regexp, changed Symbol.match');
const object = {};
assert.notSame(object, RegExp(object), 'RegExp(O) isnt O');
assert.notSame(object, RegExp(object), 'RegExp(O) isn\'t O');
object[Symbol.match] = true;
object.constructor = RegExp;
assert.same(object, RegExp(object), 'RegExp(O) is O, changed Symbol.match');
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/es.set.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ QUnit.test('Set#size', assert => {
const getter = sizeDescriptor && sizeDescriptor.get;
const setter = sizeDescriptor && sizeDescriptor.set;
assert.same(typeof getter, 'function', 'size is getter');
assert.same(typeof setter, 'undefined', 'size isnt setter');
assert.same(typeof setter, 'undefined', 'size isn\'t setter');
assert.throws(() => Set.prototype.size, TypeError);
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/es.typed-array.iterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if (DESCRIPTORS) QUnit.test('%TypedArrayPrototype%.@@iterator', assert => {
// we can't implement %TypedArrayPrototype% in all engines, so run all tests for each typed array constructor
for (const name in TYPED_ARRAYS) {
const TypedArray = GLOBAL[name];
assert.isIterable(TypedArray.prototype, `${ name } is itrable`);
assert.isIterable(TypedArray.prototype, `${ name } is iterable`);
assert.arity(TypedArray.prototype[Symbol.iterator], 0, `${ name }::@@iterator arity is 0`);
assert.name(TypedArray.prototype[Symbol.iterator], 'values', `${ name }::@@iterator name is 'values'`);
assert.looksNative(TypedArray.prototype[Symbol.iterator], `${ name }::@@iterator looks native`);
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/es.weak-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ QUnit.test('WeakMap#delete', assert => {
assert.true(weakmap.has(a), 'WeakMap has values before .delete() #1');
assert.true(weakmap.has(b), 'WeakMap has values before .delete() #2');
weakmap.delete(a);
assert.false(weakmap.has(a), 'WeakMap hasn`t value after .delete() #1');
assert.true(weakmap.has(b), 'WeakMap hasn`t value after .delete() #2');
assert.false(weakmap.has(a), 'WeakMap hasn\'t value after .delete() #1');
assert.true(weakmap.has(b), 'WeakMap hasn\'t value after .delete() #2');
assert.notThrows(() => !weakmap.delete(1), 'return false on primitive');
const object = {};
weakmap.set(object, 42);
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/es.weak-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ QUnit.test('WeakSet#delete', assert => {
assert.true(weakset.has(a), 'WeakSet has values before .delete() #1');
assert.true(weakset.has(b), 'WeakSet has values before .delete() #2');
weakset.delete(a);
assert.false(weakset.has(a), 'WeakSet hasn`t value after .delete() #1');
assert.true(weakset.has(b), 'WeakSet hasn`t value after .delete() #2');
assert.false(weakset.has(a), 'WeakSet hasn\'t value after .delete() #1');
assert.true(weakset.has(b), 'WeakSet hasn\'t value after .delete() #2');
assert.notThrows(() => !weakset.delete(1), 'return false on primitive');
});

Expand All @@ -104,7 +104,7 @@ QUnit.test('WeakSet#has', assert => {
weakset.add(object);
assert.true(weakset.has(object), 'WeakSet has value after .add()');
weakset.delete(object);
assert.false(weakset.has(object), 'WeakSet hasn`t value after .delete()');
assert.false(weakset.has(object), 'WeakSet hasn\'t value after .delete()');
assert.notThrows(() => !weakset.has(1), 'return false on primitive');
});

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/esnext.async-iterator.reduce.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ QUnit.test('AsyncIterator#reduce', assert => {
assert.same(it, 6, 'basic functionality, no initial');
return reduce.call(createIterator([]), (a, b) => a + b);
}).catch(() => {
assert.required('reduce an empty interble with no initial');
assert.required('reduce an empty iterable with no initial');
return reduce.call(createIterator([1]), () => { throw 42; }, 1);
}).catch(error => {
assert.same(error, 42, 'rejection on a callback error');
Expand Down

0 comments on commit 5d42952

Please sign in to comment.