Skip to content

Commit d92f3c7

Browse files
committed
some stylistic changes
1 parent 613d4ca commit d92f3c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+140
-92
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// empty

packages/core-js/internals/array-fill.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ var toLength = require('../internals/to-length');
88
module.exports = [].fill || function fill(value /* , start = 0, end = @length */) {
99
var O = toObject(this);
1010
var length = toLength(O.length);
11-
var aLen = arguments.length;
12-
var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
13-
var end = aLen > 2 ? arguments[2] : undefined;
11+
var argumentsLength = arguments.length;
12+
var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
13+
var end = argumentsLength > 2 ? arguments[2] : undefined;
1414
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
1515
while (endPos > index) O[index++] = value;
1616
return O;

packages/core-js/internals/array-includes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
var toIObject = require('../internals/to-indexed-object');
1+
var toIndexedObject = require('../internals/to-indexed-object');
22
var toLength = require('../internals/to-length');
33
var toAbsoluteIndex = require('../internals/to-absolute-index');
44

55
// false -> Array#indexOf
66
// true -> Array#includes
77
module.exports = function (IS_INCLUDES) {
88
return function ($this, el, fromIndex) {
9-
var O = toIObject($this);
9+
var O = toIndexedObject($this);
1010
var length = toLength(O.length);
1111
var index = toAbsoluteIndex(fromIndex, length);
1212
var value;

packages/core-js/internals/collection-strong.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ module.exports = {
120120
return !!getEntry(this, key);
121121
}
122122
});
123+
123124
redefineAll(C.prototype, IS_MAP ? {
124125
// 23.1.3.6 Map.prototype.get(key)
125126
get: function get(key) {

packages/core-js/internals/collection-weak.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ var id = 0;
1717
var uncaughtFrozenStore = function (store) {
1818
return store.frozen || (store.frozen = new UncaughtFrozenStore());
1919
};
20+
2021
var UncaughtFrozenStore = function () {
2122
this.entries = [];
2223
};
24+
2325
var findUncaughtFrozen = function (store, key) {
2426
return arrayFind(store.entries, function (it) {
2527
return it[0] === key;
2628
});
2729
};
30+
2831
UncaughtFrozenStore.prototype = {
2932
get: function (key) {
3033
var entry = findUncaughtFrozen(this, key);
@@ -87,6 +90,7 @@ module.exports = {
8790
return data && $has(data, store.id);
8891
}
8992
});
93+
9094
redefineAll(C.prototype, IS_MAP ? {
9195
// 23.3.3.3 WeakMap.prototype.get(key)
9296
get: function get(key) {
@@ -107,6 +111,7 @@ module.exports = {
107111
return define(this, value, true);
108112
}
109113
});
114+
110115
return C;
111116
}
112117
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// fallback for non-array-like ES3 and non-enumerable old V8 strings
2-
var cof = require('../internals/classof-raw');
2+
var classof = require('../internals/classof-raw');
33
// eslint-disable-next-line no-prototype-builtins
44
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
5-
return cof(it) == 'String' ? it.split('') : Object(it);
5+
return classof(it) == 'String' ? it.split('') : Object(it);
66
};
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// check on default Array iterator
22
var Iterators = require('../internals/iterators');
33
var ITERATOR = require('../internals/well-known-symbol')('iterator');
4-
var ArrayProto = Array.prototype;
4+
var ArrayPrototype = Array.prototype;
55

66
module.exports = function (it) {
7-
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
7+
return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
88
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
var cof = require('../internals/classof-raw');
1+
var classof = require('../internals/classof-raw');
22

33
// `IsArray` abstract operation
44
// https://tc39.github.io/ecma262/#sec-isarray
55
module.exports = Array.isArray || function isArray(arg) {
6-
return cof(arg) == 'Array';
6+
return classof(arg) == 'Array';
77
};

packages/core-js/internals/iter-define.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var redefine = require('../internals/redefine');
55
var hide = require('../internals/hide');
66
var has = require('../internals/has');
77
var Iterators = require('../internals/iterators');
8-
var $iterCreate = require('../internals/iter-create');
8+
var iterCreate = require('../internals/iter-create');
99
var setToStringTag = require('../internals/set-to-string-tag');
1010
var getPrototypeOf = require('../internals/object-get-prototype-of');
1111
var ITERATOR = require('../internals/well-known-symbol')('iterator');
@@ -17,7 +17,7 @@ var VALUES = 'values';
1717
var returnThis = function () { return this; };
1818

1919
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
20-
$iterCreate(Constructor, NAME, next);
20+
iterCreate(Constructor, NAME, next);
2121
var getMethod = function (kind) {
2222
if (!BUGGY && kind in proto) return proto[kind];
2323
switch (kind) {

packages/core-js/internals/iter-detect.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ var ITERATOR = require('../internals/well-known-symbol')('iterator');
22
var SAFE_CLOSING = false;
33

44
try {
5-
var riter = [7][ITERATOR]();
6-
riter['return'] = function () { SAFE_CLOSING = true; };
5+
var iteratorWithReturn = [7][ITERATOR]();
6+
iteratorWithReturn['return'] = function () { SAFE_CLOSING = true; };
77
// eslint-disable-next-line no-throw-literal
8-
Array.from(riter, function () { throw 2; });
8+
Array.from(iteratorWithReturn, function () { throw 2; });
99
} catch (e) { /* empty */ }
1010

1111
module.exports = function (exec, skipClosing) {
1212
if (!skipClosing && !SAFE_CLOSING) return false;
1313
var safe = false;
1414
try {
15-
var arr = [7];
16-
var iter = arr[ITERATOR]();
17-
iter.next = function () { return { done: safe = true }; };
18-
arr[ITERATOR] = function () { return iter; };
19-
exec(arr);
15+
var array = [7];
16+
var iterator = array[ITERATOR]();
17+
iterator.next = function () { return { done: safe = true }; };
18+
array[ITERATOR] = function () { return iterator; };
19+
exec(array);
2020
} catch (e) { /* empty */ }
2121
return safe;
2222
};

packages/core-js/internals/iterate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var anObject = require('../internals/an-object');
2-
var isArrayIterator = require('../internals/is-array-iter');
2+
var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
33
var toLength = require('../internals/to-length');
44
var bind = require('../internals/bind-context');
55
var getIteratorMethod = require('../modules/core.get-iterator-method');
@@ -13,7 +13,7 @@ var exports = module.exports = function (iterable, entries, fn, that, ITERATOR)
1313
var length, step, iterator, result;
1414
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
1515
// fast case for arrays with default iterator
16-
if (isArrayIterator(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
16+
if (isArrayIteratorMethod(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
1717
result = entries ? boundFunction(anObject(step = iterable[index])[0], step[1]) : boundFunction(iterable[index]);
1818
if (result === BREAK) return;
1919
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
var $expm1 = Math.expm1;
1+
var nativeExpm1 = Math.expm1;
22

33
// `Math.expm1` method implementation
44
// https://tc39.github.io/ecma262/#sec-math.expm1
5-
module.exports = (!$expm1
5+
module.exports = (!nativeExpm1
66
// Old FF bug
7-
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
7+
|| nativeExpm1(10) > 22025.465794806719 || nativeExpm1(10) < 22025.4657948067165168
88
// Tor Browser bug
9-
|| $expm1(-2e-17) != -2e-17
9+
|| nativeExpm1(-2e-17) != -2e-17
1010
) ? function expm1(x) {
1111
return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
12-
} : $expm1;
12+
} : nativeExpm1;

packages/core-js/internals/meta.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ var isObject = require('../internals/is-object');
33
var has = require('../internals/has');
44
var defineProperty = require('../internals/object-define-property').f;
55
var id = 0;
6+
67
var isExtensible = Object.isExtensible || function () {
78
return true;
89
};
10+
911
var FREEZE = !require('../internals/fails')(function () {
1012
return isExtensible(Object.preventExtensions({}));
1113
});

packages/core-js/internals/set-proto.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
/* eslint-disable no-proto */
33
var isObject = require('../internals/is-object');
44
var anObject = require('../internals/an-object');
5+
56
var check = function (O, proto) {
67
anObject(O);
78
if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as a prototype!");
89
};
10+
911
module.exports = {
1012
set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
1113
function () {

packages/core-js/internals/shared.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var global = require('../internals/global');
22
var setGlobal = require('../internals/set-global');
33
var SHARED = '__core-js_shared__';
4-
var store = global[SHARED] || setGlobal([SHARED], {});
4+
var store = global[SHARED] || setGlobal(SHARED, {});
55

66
module.exports = function (key, value) {
77
return store[key] || (store[key] = value !== undefined ? value : {});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
var cof = require('../internals/classof-raw');
1+
var classof = require('../internals/classof-raw');
22

33
// `thisNumberValue` abstract operation
44
// https://tc39.github.io/ecma262/#sec-thisnumbervalue
55
module.exports = function (value) {
6-
if (typeof value != 'number' && cof(value) != 'Number') throw TypeError('Incorrect invocation!');
6+
if (typeof value != 'number' && classof(value) != 'Number') throw TypeError('Incorrect invocation!');
77
return +value;
88
};

packages/core-js/internals/typed-array.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (require('../internals/descriptors')) {
1919
var classof = require('../internals/classof');
2020
var isObject = require('../internals/is-object');
2121
var toObject = require('../internals/to-object');
22-
var isArrayIter = require('../internals/is-array-iter');
22+
var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
2323
var create = require('../internals/object-create');
2424
var getPrototypeOf = require('../internals/object-get-prototype-of');
2525
var getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
@@ -131,7 +131,7 @@ if (require('../internals/descriptors')) {
131131
var mapping = mapfn !== undefined;
132132
var iterFn = getIterFn(O);
133133
var i, length, values, result, step, iterator;
134-
if (iterFn != undefined && !isArrayIter(iterFn)) {
134+
if (iterFn != undefined && !isArrayIteratorMethod(iterFn)) {
135135
for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
136136
values.push(step.value);
137137
} O = values;

packages/core-js/internals/typed.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ var ABV = !!(global.ArrayBuffer && global.DataView);
77
var CONSTR = ABV;
88
var Typed;
99

10-
var TypedArrayConstructors = [
11-
'Int8Array',
12-
'Uint8Array',
13-
'Uint8ClampedArray',
14-
'Int16Array',
15-
'Uint16Array',
16-
'Int32Array',
17-
'Uint32Array',
18-
'Float32Array',
19-
'Float64Array'
20-
];
10+
var TypedArrayConstructors = {
11+
Int8Array: 1,
12+
Uint8Array: 1,
13+
Uint8ClampedArray: 1,
14+
Int16Array: 1,
15+
Uint16Array: 1,
16+
Int32Array: 1,
17+
Uint32Array: 1,
18+
Float32Array: 1,
19+
Float64Array: 1
20+
};
2121

22-
for (var i = 0; i < TypedArrayConstructors.length; i++) {
23-
if (Typed = global[TypedArrayConstructors[i++]]) {
22+
for (var name in TypedArrayConstructors) {
23+
if (Typed = global[name]) {
2424
hide(Typed.prototype, TYPED, true);
2525
hide(Typed.prototype, VIEW, true);
2626
} else CONSTR = false;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var anObject = require('../internals/an-object');
2-
var get = require('./core.get-iterator-method');
2+
var getIteratorMethod = require('./core.get-iterator-method');
33

44
module.exports = require('../internals/core').getIterator = function (it) {
5-
var iterFn = get(it);
6-
if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
7-
return anObject(iterFn.call(it));
5+
var iteratorMethod = getIteratorMethod(it);
6+
if (typeof iteratorMethod != 'function') throw TypeError(it + ' is not iterable!');
7+
return anObject(iteratorMethod.call(it));
88
};
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
'use strict';
22
// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
33
var internalFindIndex = require('../internals/array-methods')(6);
4-
var KEY = 'findIndex';
5-
var FORCED = true;
4+
var FIND_INDEX = 'findIndex';
5+
var SKIPS_HOLES = true;
66

77
// Shouldn't skip holes
8-
if (KEY in []) Array(1)[KEY](function () { FORCED = false; });
8+
if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
99

1010
// `Array.prototype.findIndex` method
1111
// https://tc39.github.io/ecma262/#sec-array.prototype.findindex
12-
require('../internals/export')({ target: 'Array', proto: true, forced: FORCED }, {
12+
require('../internals/export')({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1313
findIndex: function findIndex(callbackfn /* , that = undefined */) {
1414
return internalFindIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1515
}
1616
});
1717

1818
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
19-
require('../internals/add-to-unscopables')(KEY);
19+
require('../internals/add-to-unscopables')(FIND_INDEX);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
'use strict';
22
// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
33
var internalFind = require('../internals/array-methods')(5);
4-
var KEY = 'find';
5-
var FORCED = true;
4+
var FIND = 'find';
5+
var SKIPS_HOLES = true;
66

77
// Shouldn't skip holes
8-
if (KEY in []) Array(1)[KEY](function () { FORCED = false; });
8+
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
99

1010
// `Array.prototype.find` method
1111
// https://tc39.github.io/ecma262/#sec-array.prototype.find
12-
require('../internals/export')({ target: 'Array', proto: true, forced: FORCED }, {
12+
require('../internals/export')({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1313
find: function find(callbackfn /* , that = undefined */) {
1414
return internalFind(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1515
}
1616
});
1717

1818
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
19-
require('../internals/add-to-unscopables')(KEY);
19+
require('../internals/add-to-unscopables')(FIND);

0 commit comments

Comments
 (0)