Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2024-09-16 17:29:58 +00:00
parent 1afca056e3
commit 6989ba7bd2
3942 changed files with 55190 additions and 132206 deletions

View file

@ -3,7 +3,7 @@
var GetIntrinsic = require('get-intrinsic');
var $Number = GetIntrinsic('%Number%');
var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');
var $isNaN = require('../helpers/isNaN');
var $isFinite = require('../helpers/isFinite');
@ -11,13 +11,12 @@ var isPrefixOf = require('../helpers/isPrefixOf');
var ToNumber = require('./ToNumber');
var ToPrimitive = require('./ToPrimitive');
var Type = require('./Type');
// https://262.ecma-international.org/5.1/#sec-11.8.5
// eslint-disable-next-line max-statements
module.exports = function AbstractRelationalComparison(x, y, LeftFirst) {
if (Type(LeftFirst) !== 'Boolean') {
if (typeof LeftFirst !== 'boolean') {
throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean');
}
var px;
@ -29,7 +28,7 @@ module.exports = function AbstractRelationalComparison(x, y, LeftFirst) {
py = ToPrimitive(y, $Number);
px = ToPrimitive(x, $Number);
}
var bothStrings = Type(px) === 'String' && Type(py) === 'String';
var bothStrings = typeof px === 'string' && typeof py === 'string';
if (!bothStrings) {
var nx = ToNumber(px);
var ny = ToNumber(py);

View file

@ -1,24 +1,20 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');
var callBound = require('call-bind/callBound');
var $charCodeAt = callBound('String.prototype.charCodeAt');
var $toUpperCase = callBound('String.prototype.toUpperCase');
var Type = require('./Type');
// https://262.ecma-international.org/5.1/#sec-15.10.2.8
module.exports = function Canonicalize(ch, IgnoreCase) {
if (Type(ch) !== 'String' || ch.length !== 1) {
if (typeof ch !== 'string' || ch.length !== 1) {
throw new $TypeError('Assertion failed: `ch` must be a character');
}
if (Type(IgnoreCase) !== 'Boolean') {
if (typeof IgnoreCase !== 'boolean') {
throw new $TypeError('Assertion failed: `IgnoreCase` must be a Boolean');
}

View file

@ -1,14 +1,9 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var RequireObjectCoercible = require('es-object-atoms/RequireObjectCoercible');
// http://262.ecma-international.org/5.1/#sec-9.10
module.exports = function CheckObjectCoercible(value, optMessage) {
if (value == null) {
throw new $TypeError(optMessage || ('Cannot call method on ' + value));
}
return value;
module.exports = function CheckObjectCoercible(value) {
return RequireObjectCoercible(value, arguments.length > 1 ? arguments[1] : void undefined);
};

View file

@ -1,8 +1,6 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $EvalError = GetIntrinsic('%EvalError%');
var $EvalError = require('es-errors/eval');
var DayWithinYear = require('./DayWithinYear');
var InLeapYear = require('./InLeapYear');

View file

@ -1,14 +1,11 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = require('es-errors/type');
var $TypeError = GetIntrinsic('%TypeError%');
var Type = require('./Type');
var IsDataDescriptor = require('./IsDataDescriptor');
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
var assertRecord = require('../helpers/assertRecord');
var isPropertyDescriptor = require('../helpers/records/property-descriptor');
// https://262.ecma-international.org/5.1/#sec-8.10.4
@ -17,7 +14,9 @@ module.exports = function FromPropertyDescriptor(Desc) {
return Desc;
}
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
if (!isPropertyDescriptor(Desc)) {
throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
}
if (IsDataDescriptor(Desc)) {
return {

View file

@ -1,8 +1,6 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $EvalError = GetIntrinsic('%EvalError%');
var $EvalError = require('es-errors/eval');
var DaysInYear = require('./DaysInYear');
var YearFromTime = require('./YearFromTime');

View file

@ -1,10 +1,10 @@
'use strict';
var has = require('has');
var $TypeError = require('es-errors/type');
var Type = require('./Type');
var hasOwn = require('hasown');
var assertRecord = require('../helpers/assertRecord');
var isPropertyDescriptor = require('../helpers/records/property-descriptor');
// https://262.ecma-international.org/5.1/#sec-8.10.1
@ -13,9 +13,11 @@ module.exports = function IsAccessorDescriptor(Desc) {
return false;
}
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
if (!isPropertyDescriptor(Desc)) {
throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
}
if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
if (!hasOwn(Desc, '[[Get]]') && !hasOwn(Desc, '[[Set]]')) {
return false;
}

View file

@ -1,10 +1,10 @@
'use strict';
var has = require('has');
var $TypeError = require('es-errors/type');
var Type = require('./Type');
var hasOwn = require('hasown');
var assertRecord = require('../helpers/assertRecord');
var isPropertyDescriptor = require('../helpers/records/property-descriptor');
// https://262.ecma-international.org/5.1/#sec-8.10.2
@ -13,9 +13,11 @@ module.exports = function IsDataDescriptor(Desc) {
return false;
}
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
if (!isPropertyDescriptor(Desc)) {
throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
}
if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
if (!hasOwn(Desc, '[[Value]]') && !hasOwn(Desc, '[[Writable]]')) {
return false;
}

View file

@ -1,10 +1,11 @@
'use strict';
var $TypeError = require('es-errors/type');
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
var IsDataDescriptor = require('./IsDataDescriptor');
var Type = require('./Type');
var assertRecord = require('../helpers/assertRecord');
var isPropertyDescriptor = require('./IsPropertyDescriptor');
// https://262.ecma-international.org/5.1/#sec-8.10.3
@ -13,7 +14,9 @@ module.exports = function IsGenericDescriptor(Desc) {
return false;
}
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
if (!isPropertyDescriptor(Desc)) {
throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
}
if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) {
return true;

View file

@ -2,18 +2,10 @@
// TODO, semver-major: delete this
var isPropertyDescriptor = require('../helpers/isPropertyDescriptor');
var Type = require('./Type');
var IsDataDescriptor = require('./IsDataDescriptor');
var IsAccessorDescriptor = require('./IsAccessorDescriptor');
var isPropertyDescriptor = require('../helpers/records/property-descriptor');
// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type
module.exports = function IsPropertyDescriptor(Desc) {
return isPropertyDescriptor({
IsDataDescriptor: IsDataDescriptor,
IsAccessorDescriptor: IsAccessorDescriptor,
Type: Type
}, Desc);
return isPropertyDescriptor(Desc);
};

View file

@ -1,14 +1,5 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $Object = GetIntrinsic('%Object%');
var CheckObjectCoercible = require('./CheckObjectCoercible');
// http://262.ecma-international.org/5.1/#sec-9.9
module.exports = function ToObject(value) {
CheckObjectCoercible(value);
return $Object(value);
};
module.exports = require('es-object-atoms/ToObject');

View file

@ -1,10 +1,8 @@
'use strict';
var has = require('has');
var hasOwn = require('hasown');
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var $TypeError = require('es-errors/type');
var Type = require('./Type');
var ToBoolean = require('./ToBoolean');
@ -18,26 +16,26 @@ module.exports = function ToPropertyDescriptor(Obj) {
}
var desc = {};
if (has(Obj, 'enumerable')) {
if (hasOwn(Obj, 'enumerable')) {
desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
}
if (has(Obj, 'configurable')) {
if (hasOwn(Obj, 'configurable')) {
desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
}
if (has(Obj, 'value')) {
if (hasOwn(Obj, 'value')) {
desc['[[Value]]'] = Obj.value;
}
if (has(Obj, 'writable')) {
if (hasOwn(Obj, 'writable')) {
desc['[[Writable]]'] = ToBoolean(Obj.writable);
}
if (has(Obj, 'get')) {
if (hasOwn(Obj, 'get')) {
var getter = Obj.get;
if (typeof getter !== 'undefined' && !IsCallable(getter)) {
throw new $TypeError('getter must be a function');
}
desc['[[Get]]'] = getter;
}
if (has(Obj, 'set')) {
if (hasOwn(Obj, 'set')) {
var setter = Obj.set;
if (typeof setter !== 'undefined' && !IsCallable(setter)) {
throw new $TypeError('setter must be a function');
@ -45,7 +43,7 @@ module.exports = function ToPropertyDescriptor(Obj) {
desc['[[Set]]'] = setter;
}
if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
if ((hasOwn(desc, '[[Get]]') || hasOwn(desc, '[[Set]]')) && (hasOwn(desc, '[[Value]]') || hasOwn(desc, '[[Writable]]'))) {
throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
}
return desc;