mirror of
https://github.com/cachix/install-nix-action.git
synced 2025-06-08 18:04:29 +00:00
v6
This commit is contained in:
parent
cd5893b2c6
commit
70742d22d9
6774 changed files with 1602535 additions and 1 deletions
71
node_modules/es-abstract/es2017.js
generated
vendored
Normal file
71
node_modules/es-abstract/es2017.js
generated
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('./GetIntrinsic');
|
||||
|
||||
var ES2016 = require('./es2016');
|
||||
var assign = require('./helpers/assign');
|
||||
var forEach = require('./helpers/forEach');
|
||||
var callBind = require('./helpers/callBind');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
var $Array = GetIntrinsic('%Array%');
|
||||
var $isEnumerable = callBind(GetIntrinsic('%ObjectPrototype%').propertyIsEnumerable);
|
||||
var $pushApply = callBind.apply(GetIntrinsic('%ArrayPrototype%').push);
|
||||
var $arrayPush = callBind($Array.prototype.push);
|
||||
|
||||
var ES2017 = assign(assign({}, ES2016), {
|
||||
ToIndex: function ToIndex(value) {
|
||||
if (typeof value === 'undefined') {
|
||||
return 0;
|
||||
}
|
||||
var integerIndex = this.ToInteger(value);
|
||||
if (integerIndex < 0) {
|
||||
throw new RangeError('index must be >= 0');
|
||||
}
|
||||
var index = this.ToLength(integerIndex);
|
||||
if (!this.SameValueZero(integerIndex, index)) {
|
||||
throw new RangeError('index must be >= 0 and < 2 ** 53 - 1');
|
||||
}
|
||||
return index;
|
||||
},
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties
|
||||
EnumerableOwnProperties: function EnumerableOwnProperties(O, kind) {
|
||||
var keys = ES2016.EnumerableOwnNames(O);
|
||||
if (kind === 'key') {
|
||||
return keys;
|
||||
}
|
||||
if (kind === 'value' || kind === 'key+value') {
|
||||
var results = [];
|
||||
forEach(keys, function (key) {
|
||||
if ($isEnumerable(O, key)) {
|
||||
$pushApply(results, [
|
||||
kind === 'value' ? O[key] : [key, O[key]]
|
||||
]);
|
||||
}
|
||||
});
|
||||
return results;
|
||||
}
|
||||
throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind);
|
||||
},
|
||||
|
||||
// https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist
|
||||
IterableToList: function IterableToList(items, method) {
|
||||
var iterator = this.GetIterator(items, method);
|
||||
var values = [];
|
||||
var next = true;
|
||||
while (next) {
|
||||
next = this.IteratorStep(iterator);
|
||||
if (next) {
|
||||
var nextValue = this.IteratorValue(next);
|
||||
$arrayPush(values, nextValue);
|
||||
}
|
||||
}
|
||||
return values;
|
||||
}
|
||||
});
|
||||
|
||||
delete ES2017.EnumerableOwnNames; // replaced with EnumerableOwnProperties
|
||||
delete ES2017.IterableToArrayLike; // replaced with IterableToList
|
||||
|
||||
module.exports = ES2017;
|
Loading…
Add table
Add a link
Reference in a new issue