This commit is contained in:
eric sciple 2020-01-24 12:30:54 -05:00
parent 8affe1ed56
commit 760046e9f2
7278 changed files with 0 additions and 1778943 deletions

View file

@ -1,49 +0,0 @@
'use strict';
var GetIntrinsic = require('../GetIntrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var has = require('has');
var predicates = {
// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
'Property Descriptor': function isPropertyDescriptor(ES, Desc) {
if (ES.Type(Desc) !== 'Object') {
return false;
}
var allowed = {
'[[Configurable]]': true,
'[[Enumerable]]': true,
'[[Get]]': true,
'[[Set]]': true,
'[[Value]]': true,
'[[Writable]]': true
};
for (var key in Desc) { // eslint-disable-line
if (has(Desc, key) && !allowed[key]) {
return false;
}
}
var isData = has(Desc, '[[Value]]');
var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
if (isData && IsAccessor) {
throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
}
return true;
}
};
module.exports = function assertRecord(ES, recordType, argumentName, value) {
var predicate = predicates[recordType];
if (typeof predicate !== 'function') {
throw new $SyntaxError('unknown record type: ' + recordType);
}
if (!predicate(ES, value)) {
throw new $TypeError(argumentName + ' must be a ' + recordType);
}
console.log(predicate(ES, value), value);
};

View file

@ -1,17 +0,0 @@
var bind = require('function-bind');
var has = bind.call(Function.call, Object.prototype.hasOwnProperty);
var $assign = Object.assign;
module.exports = function assign(target, source) {
if ($assign) {
return $assign(target, source);
}
for (var key in source) {
if (has(source, key)) {
target[key] = source[key];
}
}
return target;
};

View file

@ -1,7 +0,0 @@
'use strict';
module.exports = function forEach(array, callback) {
for (var i = 0; i < array.length; i += 1) {
callback(array[i], i, array);
}
};

View file

@ -1,3 +0,0 @@
var $isNaN = Number.isNaN || function (a) { return a !== a; };
module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };

View file

@ -1,3 +0,0 @@
module.exports = Number.isNaN || function isNaN(a) {
return a !== a;
};

View file

@ -1,3 +0,0 @@
module.exports = function isPrimitive(value) {
return value === null || (typeof value !== 'function' && typeof value !== 'object');
};

View file

@ -1,4 +0,0 @@
module.exports = function mod(number, modulo) {
var remain = number % modulo;
return Math.floor(remain >= 0 ? remain : remain + modulo);
};

View file

@ -1,3 +0,0 @@
module.exports = function sign(number) {
return number >= 0 ? 1 : -1;
};