inital
This commit is contained in:
13
node_modules/es-abstract/helpers/records/async-generator-request-record.js
generated
vendored
Normal file
13
node_modules/es-abstract/helpers/records/async-generator-request-record.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
var isPromiseCapabilityRecord = require('./promise-capability-record');
|
||||
|
||||
module.exports = function isAsyncGeneratorRequestRecord(value) {
|
||||
return !!value
|
||||
&& typeof value === 'object'
|
||||
&& hasOwn(value, '[[Completion]]') // TODO: confirm is a completion record
|
||||
&& hasOwn(value, '[[Capability]]')
|
||||
&& isPromiseCapabilityRecord(value['[[Capability]]']);
|
||||
};
|
18
node_modules/es-abstract/helpers/records/data-view-with-buffer-witness-record.js
generated
vendored
Normal file
18
node_modules/es-abstract/helpers/records/data-view-with-buffer-witness-record.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
var isDataView = require('is-data-view');
|
||||
|
||||
var isInteger = require('../isInteger');
|
||||
|
||||
module.exports = function isDataViewWithBufferWitnessRecord(value) {
|
||||
return !!value
|
||||
&& typeof value === 'object'
|
||||
&& hasOwn(value, '[[Object]]')
|
||||
&& hasOwn(value, '[[CachedBufferByteLength]]')
|
||||
&& (
|
||||
(isInteger(value['[[CachedBufferByteLength]]']) && value['[[CachedBufferByteLength]]'] >= 0)
|
||||
|| value['[[CachedBufferByteLength]]'] === 'DETACHED'
|
||||
)
|
||||
&& isDataView(value['[[Object]]']);
|
||||
};
|
13
node_modules/es-abstract/helpers/records/iterator-record.js
generated
vendored
Normal file
13
node_modules/es-abstract/helpers/records/iterator-record.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
module.exports = function isIteratorRecord(value) {
|
||||
return !!value
|
||||
&& typeof value === 'object'
|
||||
&& hasOwn(value, '[[Iterator]]')
|
||||
&& hasOwn(value, '[[NextMethod]]')
|
||||
&& typeof value['[[NextMethod]]'] === 'function'
|
||||
&& hasOwn(value, '[[Done]]')
|
||||
&& typeof value['[[Done]]'] === 'boolean';
|
||||
};
|
18
node_modules/es-abstract/helpers/records/match-record.js
generated
vendored
Normal file
18
node_modules/es-abstract/helpers/records/match-record.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
// https://262.ecma-international.org/13.0/#sec-match-records
|
||||
|
||||
module.exports = function isMatchRecord(record) {
|
||||
return (
|
||||
!!record
|
||||
&& typeof record === 'object'
|
||||
&& hasOwn(record, '[[StartIndex]]')
|
||||
&& hasOwn(record, '[[EndIndex]]')
|
||||
&& record['[[StartIndex]]'] >= 0
|
||||
&& record['[[EndIndex]]'] >= record['[[StartIndex]]']
|
||||
&& String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])
|
||||
&& String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])
|
||||
);
|
||||
};
|
16
node_modules/es-abstract/helpers/records/promise-capability-record.js
generated
vendored
Normal file
16
node_modules/es-abstract/helpers/records/promise-capability-record.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
module.exports = function isPromiseCapabilityRecord(value) {
|
||||
return !!value
|
||||
&& typeof value === 'object'
|
||||
&& hasOwn(value, '[[Resolve]]')
|
||||
&& typeof value['[[Resolve]]'] === 'function'
|
||||
&& hasOwn(value, '[[Reject]]')
|
||||
&& typeof value['[[Reject]]'] === 'function'
|
||||
&& hasOwn(value, '[[Promise]]')
|
||||
&& !!value['[[Promise]]']
|
||||
&& typeof value['[[Promise]]'] === 'object'
|
||||
&& typeof value['[[Promise]]'].then === 'function';
|
||||
};
|
36
node_modules/es-abstract/helpers/records/property-descriptor.js
generated
vendored
Normal file
36
node_modules/es-abstract/helpers/records/property-descriptor.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
var $TypeError = require('es-errors/type');
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
var allowed = {
|
||||
__proto__: null,
|
||||
'[[Configurable]]': true,
|
||||
'[[Enumerable]]': true,
|
||||
'[[Get]]': true,
|
||||
'[[Set]]': true,
|
||||
'[[Value]]': true,
|
||||
'[[Writable]]': true
|
||||
};
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type
|
||||
|
||||
module.exports = function isPropertyDescriptor(Desc) {
|
||||
if (!Desc || typeof Desc !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var key in Desc) { // eslint-disable-line
|
||||
if (hasOwn(Desc, key) && !allowed[key]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var isData = hasOwn(Desc, '[[Value]]') || hasOwn(Desc, '[[Writable]]');
|
||||
var IsAccessor = hasOwn(Desc, '[[Get]]') || hasOwn(Desc, '[[Set]]');
|
||||
if (isData && IsAccessor) {
|
||||
throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
|
||||
}
|
||||
return true;
|
||||
};
|
23
node_modules/es-abstract/helpers/records/regexp-record.js
generated
vendored
Normal file
23
node_modules/es-abstract/helpers/records/regexp-record.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
|
||||
var isInteger = require('../isInteger');
|
||||
|
||||
module.exports = function isRegExpRecord(value) {
|
||||
return !!value
|
||||
&& typeof value === 'object'
|
||||
&& hasOwn(value, '[[IgnoreCase]]')
|
||||
&& typeof value['[[IgnoreCase]]'] === 'boolean'
|
||||
&& hasOwn(value, '[[Multiline]]')
|
||||
&& typeof value['[[Multiline]]'] === 'boolean'
|
||||
&& hasOwn(value, '[[DotAll]]')
|
||||
&& typeof value['[[DotAll]]'] === 'boolean'
|
||||
&& hasOwn(value, '[[Unicode]]')
|
||||
&& typeof value['[[Unicode]]'] === 'boolean'
|
||||
&& hasOwn(value, '[[CapturingGroupsCount]]')
|
||||
&& typeof value['[[CapturingGroupsCount]]'] === 'number'
|
||||
&& isInteger(value['[[CapturingGroupsCount]]'])
|
||||
&& value['[[CapturingGroupsCount]]'] >= 0
|
||||
&& (!hasOwn(value, '[[UnicodeSets]]') || typeof value['[[UnicodeSets]]'] === 'boolean'); // optional since it was added later
|
||||
};
|
18
node_modules/es-abstract/helpers/records/typed-array-with-buffer-witness-record.js
generated
vendored
Normal file
18
node_modules/es-abstract/helpers/records/typed-array-with-buffer-witness-record.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var hasOwn = require('hasown');
|
||||
var isTypedArray = require('is-typed-array');
|
||||
|
||||
var isInteger = require('../isInteger');
|
||||
|
||||
module.exports = function isTypedArrayWithBufferWitnessRecord(value) {
|
||||
return !!value
|
||||
&& typeof value === 'object'
|
||||
&& hasOwn(value, '[[Object]]')
|
||||
&& hasOwn(value, '[[CachedBufferByteLength]]')
|
||||
&& (
|
||||
(isInteger(value['[[CachedBufferByteLength]]']) && value['[[CachedBufferByteLength]]'] >= 0)
|
||||
|| value['[[CachedBufferByteLength]]'] === 'DETACHED'
|
||||
)
|
||||
&& isTypedArray(value['[[Object]]']);
|
||||
};
|
Reference in New Issue
Block a user