mirror of
https://github.com/actions/labeler.git
synced 2025-12-20 06:54:16 +00:00
build
This commit is contained in:
85
node_modules/es-abstract/test/helpers/values.js
generated
vendored
85
node_modules/es-abstract/test/helpers/values.js
generated
vendored
@@ -1,15 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
|
||||
var assign = require('../../helpers/assign');
|
||||
|
||||
var hasSymbols = require('has-symbols')();
|
||||
|
||||
var coercibleObject = { valueOf: function () { return 3; }, toString: function () { return 42; } };
|
||||
var coercibleFnObject = {
|
||||
valueOf: function () { return function valueOfFn() {}; },
|
||||
toString: function () { return 42; }
|
||||
};
|
||||
var valueOfOnlyObject = { valueOf: function () { return 4; }, toString: function () { return {}; } };
|
||||
var toStringOnlyObject = { valueOf: function () { return {}; }, toString: function () { return 7; } };
|
||||
var uncoercibleObject = { valueOf: function () { return {}; }, toString: function () { return {}; } };
|
||||
var objects = [{}, coercibleObject, toStringOnlyObject, valueOfOnlyObject];
|
||||
var uncoercibleFnObject = {
|
||||
valueOf: function () { return function valueOfFn() {}; },
|
||||
toString: function () { return function toStrFn() {}; }
|
||||
};
|
||||
var objects = [{}, coercibleObject, coercibleFnObject, toStringOnlyObject, valueOfOnlyObject];
|
||||
var nullPrimitives = [undefined, null];
|
||||
var nonIntegerNumbers = [-1.3, 0.2, 1.8, 1 / 3];
|
||||
var numbers = [0, -0, Infinity, -Infinity, 42].concat(nonIntegerNumbers);
|
||||
var zeroes = [0, -0];
|
||||
var infinities = [Infinity, -Infinity];
|
||||
var numbers = zeroes.concat([42], infinities, nonIntegerNumbers);
|
||||
var strings = ['', 'foo', 'a\uD83D\uDCA9c'];
|
||||
var booleans = [true, false];
|
||||
var symbols = hasSymbols ? [Symbol.iterator, Symbol('foo')] : [];
|
||||
@@ -25,15 +37,44 @@ var nonBooleans = [].concat(nullPrimitives, strings, symbols, numbers, objects);
|
||||
var falsies = [].concat(nullPrimitives, false, '', 0, -0, NaN);
|
||||
var truthies = [].concat(true, 'foo', 42, symbols, objects);
|
||||
var timestamps = [].concat(0, 946713600000, 1546329600000);
|
||||
var nonFunctions = [].concat(primitives, objects, [42]);
|
||||
var nonArrays = [].concat(nonFunctions);
|
||||
|
||||
var descriptors = {
|
||||
configurable: function (descriptor) {
|
||||
return assign(assign({}, descriptor), { '[[Configurable]]': true });
|
||||
},
|
||||
nonConfigurable: function (descriptor) {
|
||||
return assign(assign({}, descriptor), { '[[Configurable]]': false });
|
||||
},
|
||||
enumerable: function (descriptor) {
|
||||
return assign(assign({}, descriptor), { '[[Enumerable]]': true });
|
||||
},
|
||||
nonEnumerable: function (descriptor) {
|
||||
return assign(assign({}, descriptor), { '[[Enumerable]]': false });
|
||||
},
|
||||
writable: function (descriptor) {
|
||||
return assign(assign({}, descriptor), { '[[Writable]]': true });
|
||||
},
|
||||
nonWritable: function (descriptor) {
|
||||
return assign(assign({}, descriptor), { '[[Writable]]': false });
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
coercibleObject: coercibleObject,
|
||||
coercibleFnObject: coercibleFnObject,
|
||||
valueOfOnlyObject: valueOfOnlyObject,
|
||||
toStringOnlyObject: toStringOnlyObject,
|
||||
uncoercibleObject: uncoercibleObject,
|
||||
uncoercibleFnObject: uncoercibleFnObject,
|
||||
objects: objects,
|
||||
nonFunctions: nonFunctions,
|
||||
nonArrays: nonArrays,
|
||||
nullPrimitives: nullPrimitives,
|
||||
numbers: numbers,
|
||||
zeroes: zeroes,
|
||||
infinities: infinities,
|
||||
strings: strings,
|
||||
booleans: booleans,
|
||||
symbols: symbols,
|
||||
@@ -55,30 +96,26 @@ module.exports = {
|
||||
bothDescriptor: function () {
|
||||
return { '[[Get]]': function () {}, '[[Value]]': true };
|
||||
},
|
||||
accessorDescriptor: function () {
|
||||
return {
|
||||
'[[Get]]': function () {},
|
||||
'[[Enumerable]]': true,
|
||||
'[[Configurable]]': true
|
||||
};
|
||||
bothDescriptorWritable: function () {
|
||||
return descriptors.writable({ '[[Get]]': function () {} });
|
||||
},
|
||||
accessorDescriptor: function (value) {
|
||||
return descriptors.enumerable(descriptors.configurable({
|
||||
'[[Get]]': function get() { return value; }
|
||||
}));
|
||||
},
|
||||
mutatorDescriptor: function () {
|
||||
return {
|
||||
'[[Set]]': function () {},
|
||||
'[[Enumerable]]': true,
|
||||
'[[Configurable]]': true
|
||||
};
|
||||
return descriptors.enumerable(descriptors.configurable({
|
||||
'[[Set]]': function () {}
|
||||
}));
|
||||
},
|
||||
dataDescriptor: function () {
|
||||
return {
|
||||
'[[Value]]': 42,
|
||||
'[[Writable]]': false
|
||||
};
|
||||
dataDescriptor: function (value) {
|
||||
return descriptors.nonWritable({
|
||||
'[[Value]]': arguments.length > 0 ? value : 42
|
||||
});
|
||||
},
|
||||
genericDescriptor: function () {
|
||||
return {
|
||||
'[[Configurable]]': true,
|
||||
'[[Enumerable]]': false
|
||||
};
|
||||
}
|
||||
return descriptors.configurable(descriptors.nonEnumerable());
|
||||
},
|
||||
descriptors: descriptors
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user