diff options
Diffstat (limited to 'node_modules/es-abstract/helpers')
26 files changed, 0 insertions, 484 deletions
diff --git a/node_modules/es-abstract/helpers/DefineOwnProperty.js b/node_modules/es-abstract/helpers/DefineOwnProperty.js deleted file mode 100644 index 99ace10..0000000 --- a/node_modules/es-abstract/helpers/DefineOwnProperty.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -var callBound = require('../helpers/callBound'); - -var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); - -// eslint-disable-next-line max-params -module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { - if (!$defineProperty) { - if (!IsDataDescriptor(desc)) { - // ES3 does not support getters/setters - return false; - } - if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { - return false; - } - - // fallback for ES3 - if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { - // a non-enumerable existing property - return false; - } - - // property does not exist at all, or exists but is enumerable - var V = desc['[[Value]]']; - // eslint-disable-next-line no-param-reassign - O[P] = V; // will use [[Define]] - return SameValue(O[P], V); - } - $defineProperty(O, P, FromPropertyDescriptor(desc)); - return true; -}; diff --git a/node_modules/es-abstract/helpers/OwnPropertyKeys.js b/node_modules/es-abstract/helpers/OwnPropertyKeys.js deleted file mode 100644 index 4a06ce3..0000000 --- a/node_modules/es-abstract/helpers/OwnPropertyKeys.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var callBind = require('./callBind'); -var callBound = require('./callBound'); - -var $ownKeys = GetIntrinsic('%Reflect.ownKeys%', true); -var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); -var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); -var $gOPN = GetIntrinsic('%Object.getOwnPropertyNames%', true); -var $gOPS = $SymbolValueOf ? GetIntrinsic('%Object.getOwnPropertySymbols%') : null; - -var keys = require('object-keys'); - -module.exports = $ownKeys || function OwnPropertyKeys(source) { - var ownKeys = ($gOPN || keys)(source); - if ($gOPS) { - $pushApply(ownKeys, $gOPS(source)); - } - return ownKeys; -}; diff --git a/node_modules/es-abstract/helpers/assertRecord.js b/node_modules/es-abstract/helpers/assertRecord.js deleted file mode 100644 index 45e115a..0000000 --- a/node_modules/es-abstract/helpers/assertRecord.js +++ /dev/null @@ -1,48 +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(Type, Desc) { - if (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(Type, recordType, argumentName, value) { - var predicate = predicates[recordType]; - if (typeof predicate !== 'function') { - throw new $SyntaxError('unknown record type: ' + recordType); - } - if (!predicate(Type, value)) { - throw new $TypeError(argumentName + ' must be a ' + recordType); - } -}; diff --git a/node_modules/es-abstract/helpers/assign.js b/node_modules/es-abstract/helpers/assign.js deleted file mode 100644 index 7e6666e..0000000 --- a/node_modules/es-abstract/helpers/assign.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var has = require('has'); - -var $assign = GetIntrinsic('%Object%').assign; - -module.exports = function assign(target, source) { - if ($assign) { - return $assign(target, source); - } - - // eslint-disable-next-line no-restricted-syntax - for (var key in source) { - if (has(source, key)) { - // eslint-disable-next-line no-param-reassign - target[key] = source[key]; - } - } - return target; -}; diff --git a/node_modules/es-abstract/helpers/callBind.js b/node_modules/es-abstract/helpers/callBind.js deleted file mode 100644 index 3c1a327..0000000 --- a/node_modules/es-abstract/helpers/callBind.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); - -var GetIntrinsic = require('../GetIntrinsic'); - -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind() { - return $reflectApply(bind, $call, arguments); -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} diff --git a/node_modules/es-abstract/helpers/callBound.js b/node_modules/es-abstract/helpers/callBound.js deleted file mode 100644 index 9dc8fc5..0000000 --- a/node_modules/es-abstract/helpers/callBound.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var callBind = require('./callBind'); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { - return callBind(intrinsic); - } - return intrinsic; -}; diff --git a/node_modules/es-abstract/helpers/every.js b/node_modules/es-abstract/helpers/every.js deleted file mode 100644 index 42a4582..0000000 --- a/node_modules/es-abstract/helpers/every.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = function every(array, predicate) { - for (var i = 0; i < array.length; i += 1) { - if (!predicate(array[i], i, array)) { - return false; - } - } - return true; -}; diff --git a/node_modules/es-abstract/helpers/forEach.js b/node_modules/es-abstract/helpers/forEach.js deleted file mode 100644 index 35915a6..0000000 --- a/node_modules/es-abstract/helpers/forEach.js +++ /dev/null @@ -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); // eslint-disable-line callback-return - } -}; diff --git a/node_modules/es-abstract/helpers/getInferredName.js b/node_modules/es-abstract/helpers/getInferredName.js deleted file mode 100644 index 2dab6e7..0000000 --- a/node_modules/es-abstract/helpers/getInferredName.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var getInferredName; -try { - // eslint-disable-next-line no-new-func - getInferredName = Function('s', 'return { [s]() {} }[s].name;'); -} catch (e) {} - -var inferred = function () {}; -module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null; diff --git a/node_modules/es-abstract/helpers/getIteratorMethod.js b/node_modules/es-abstract/helpers/getIteratorMethod.js deleted file mode 100644 index 02f932c..0000000 --- a/node_modules/es-abstract/helpers/getIteratorMethod.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -var hasSymbols = require('has-symbols')(); -var GetIntrinsic = require('../GetIntrinsic'); -var callBound = require('./callBound'); - -var $iterator = GetIntrinsic('%Symbol.iterator%', true); -var $stringSlice = callBound('String.prototype.slice'); - -module.exports = function getIteratorMethod(ES, iterable) { - var usingIterator; - if (hasSymbols) { - usingIterator = ES.GetMethod(iterable, $iterator); - } else if (ES.IsArray(iterable)) { - usingIterator = function () { - var i = -1; - var arr = this; // eslint-disable-line no-invalid-this - return { - next: function () { - i += 1; - return { - done: i >= arr.length, - value: arr[i] - }; - } - }; - }; - } else if (ES.Type(iterable) === 'String') { - usingIterator = function () { - var i = 0; - return { - next: function () { - var nextIndex = ES.AdvanceStringIndex(iterable, i, true); - var value = $stringSlice(iterable, i, nextIndex); - i = nextIndex; - return { - done: nextIndex > iterable.length, - value: value - }; - } - }; - }; - } - return usingIterator; -}; diff --git a/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js b/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js deleted file mode 100644 index 71168e9..0000000 --- a/node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%'); -if ($gOPD) { - try { - $gOPD([], 'length'); - } catch (e) { - // IE 8 has a broken gOPD - $gOPD = null; - } -} - -module.exports = $gOPD; diff --git a/node_modules/es-abstract/helpers/getProto.js b/node_modules/es-abstract/helpers/getProto.js deleted file mode 100644 index af10fd8..0000000 --- a/node_modules/es-abstract/helpers/getProto.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var originalGetProto = GetIntrinsic('%Object.getPrototypeOf%', true); -var $ArrayProto = GetIntrinsic('%Array.prototype%'); - -module.exports = originalGetProto || ( - // eslint-disable-next-line no-proto - [].__proto__ === $ArrayProto - ? function (O) { - return O.__proto__; // eslint-disable-line no-proto - } - : null -); diff --git a/node_modules/es-abstract/helpers/getSymbolDescription.js b/node_modules/es-abstract/helpers/getSymbolDescription.js deleted file mode 100644 index 45d80d2..0000000 --- a/node_modules/es-abstract/helpers/getSymbolDescription.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var callBound = require('./callBound'); - -var $SyntaxError = GetIntrinsic('%SyntaxError%'); -var getGlobalSymbolDescription = GetIntrinsic('%Symbol.keyFor%', true); -var thisSymbolValue = callBound('%Symbol.prototype.valueOf%', true); -var symToStr = callBound('Symbol.prototype.toString', true); - -var getInferredName = require('./getInferredName'); - -/* eslint-disable consistent-return */ -module.exports = callBound('%Symbol.prototype.description%', true) || function getSymbolDescription(symbol) { - if (!thisSymbolValue) { - throw new $SyntaxError('Symbols are not supported in this environment'); - } - - // will throw if not a symbol primitive or wrapper object - var sym = thisSymbolValue(symbol); - - if (getInferredName) { - var name = getInferredName(sym); - if (name === '') { return; } - return name.slice(1, -1); // name.slice('['.length, -']'.length); - } - - var desc; - if (getGlobalSymbolDescription) { - desc = getGlobalSymbolDescription(sym); - if (typeof desc === 'string') { - return desc; - } - } - - desc = symToStr(sym).slice(7, -1); // str.slice('Symbol('.length, -')'.length); - if (desc) { - return desc; - } -}; diff --git a/node_modules/es-abstract/helpers/isFinite.js b/node_modules/es-abstract/helpers/isFinite.js deleted file mode 100644 index 9e7cd4f..0000000 --- a/node_modules/es-abstract/helpers/isFinite.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -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; }; diff --git a/node_modules/es-abstract/helpers/isNaN.js b/node_modules/es-abstract/helpers/isNaN.js deleted file mode 100644 index cb8631d..0000000 --- a/node_modules/es-abstract/helpers/isNaN.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = Number.isNaN || function isNaN(a) { - return a !== a; -}; diff --git a/node_modules/es-abstract/helpers/isPrefixOf.js b/node_modules/es-abstract/helpers/isPrefixOf.js deleted file mode 100644 index b67d640..0000000 --- a/node_modules/es-abstract/helpers/isPrefixOf.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var $strSlice = require('../helpers/callBound')('String.prototype.slice'); - -module.exports = function isPrefixOf(prefix, string) { - if (prefix === string) { - return true; - } - if (prefix.length > string.length) { - return false; - } - return $strSlice(string, 0, prefix.length) === prefix; -}; diff --git a/node_modules/es-abstract/helpers/isPrimitive.js b/node_modules/es-abstract/helpers/isPrimitive.js deleted file mode 100644 index 06f0bf0..0000000 --- a/node_modules/es-abstract/helpers/isPrimitive.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function isPrimitive(value) { - return value === null || (typeof value !== 'function' && typeof value !== 'object'); -}; diff --git a/node_modules/es-abstract/helpers/isPropertyDescriptor.js b/node_modules/es-abstract/helpers/isPropertyDescriptor.js deleted file mode 100644 index 3eff7eb..0000000 --- a/node_modules/es-abstract/helpers/isPropertyDescriptor.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var has = require('has'); -var $TypeError = GetIntrinsic('%TypeError%'); - -module.exports = 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 no-restricted-syntax - if (has(Desc, key) && !allowed[key]) { - return false; - } - } - - if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { - throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); - } - return true; -}; diff --git a/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js b/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js deleted file mode 100644 index a6162a1..0000000 --- a/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var every = require('./every'); - -module.exports = function isSamePropertyDescriptor(ES, D1, D2) { - var fields = [ - '[[Configurable]]', - '[[Enumerable]]', - '[[Get]]', - '[[Set]]', - '[[Value]]', - '[[Writable]]' - ]; - return every(fields, function (field) { - if ((field in D1) !== (field in D2)) { - return false; - } - return ES.SameValue(D1[field], D2[field]); - }); -}; diff --git a/node_modules/es-abstract/helpers/maxSafeInteger.js b/node_modules/es-abstract/helpers/maxSafeInteger.js deleted file mode 100644 index 2fe8f38..0000000 --- a/node_modules/es-abstract/helpers/maxSafeInteger.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var $Math = GetIntrinsic('%Math%'); -var $Number = GetIntrinsic('%Number%'); - -module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; diff --git a/node_modules/es-abstract/helpers/mod.js b/node_modules/es-abstract/helpers/mod.js deleted file mode 100644 index 67c8b78..0000000 --- a/node_modules/es-abstract/helpers/mod.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var $floor = Math.floor; - -module.exports = function mod(number, modulo) { - var remain = number % modulo; - return $floor(remain >= 0 ? remain : remain + modulo); -}; diff --git a/node_modules/es-abstract/helpers/padTimeComponent.js b/node_modules/es-abstract/helpers/padTimeComponent.js deleted file mode 100644 index cbd8d06..0000000 --- a/node_modules/es-abstract/helpers/padTimeComponent.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var callBound = require('../helpers/callBound'); - -var $strSlice = callBound('String.prototype.slice'); - -module.exports = function padTimeComponent(c, count) { - return $strSlice('00' + c, -(count || 2)); -}; diff --git a/node_modules/es-abstract/helpers/regexTester.js b/node_modules/es-abstract/helpers/regexTester.js deleted file mode 100644 index 982cc9f..0000000 --- a/node_modules/es-abstract/helpers/regexTester.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var $test = GetIntrinsic('RegExp.prototype.test'); - -var callBind = require('./callBind'); - -module.exports = function regexTester(regex) { - return callBind($test, regex); -}; diff --git a/node_modules/es-abstract/helpers/setProto.js b/node_modules/es-abstract/helpers/setProto.js deleted file mode 100644 index 29ec991..0000000 --- a/node_modules/es-abstract/helpers/setProto.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var originalSetProto = GetIntrinsic('%Object.setPrototypeOf%', true); -var $ArrayProto = GetIntrinsic('%Array.prototype%'); - -module.exports = originalSetProto || ( - // eslint-disable-next-line no-proto, no-negated-condition - [].__proto__ !== $ArrayProto - ? null - : function (O, proto) { - O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign - return O; - } -); diff --git a/node_modules/es-abstract/helpers/sign.js b/node_modules/es-abstract/helpers/sign.js deleted file mode 100644 index 598ea7d..0000000 --- a/node_modules/es-abstract/helpers/sign.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -module.exports = function sign(number) { - return number >= 0 ? 1 : -1; -}; diff --git a/node_modules/es-abstract/helpers/timeConstants.js b/node_modules/es-abstract/helpers/timeConstants.js deleted file mode 100644 index c275b40..0000000 --- a/node_modules/es-abstract/helpers/timeConstants.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var HoursPerDay = 24; -var MinutesPerHour = 60; -var SecondsPerMinute = 60; -var msPerSecond = 1e3; -var msPerMinute = msPerSecond * SecondsPerMinute; -var msPerHour = msPerMinute * MinutesPerHour; -var msPerDay = 86400000; - -module.exports = { - HoursPerDay: HoursPerDay, - MinutesPerHour: MinutesPerHour, - SecondsPerMinute: SecondsPerMinute, - msPerSecond: msPerSecond, - msPerMinute: msPerMinute, - msPerHour: msPerHour, - msPerDay: msPerDay -}; |