| (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ |
| 'use strict'; |
| |
| var keys = require('object-keys').shim(); |
| delete keys.shim; |
| |
| var assign = require('./'); |
| |
| module.exports = assign.shim(); |
| |
| delete assign.shim; |
| |
| },{"./":3,"object-keys":39}],2:[function(require,module,exports){ |
| 'use strict'; |
| |
| // modified from https://github.com/es-shims/es6-shim |
| var objectKeys = require('object-keys'); |
| var hasSymbols = require('has-symbols/shams')(); |
| var callBound = require('call-bound'); |
| var $Object = require('es-object-atoms'); |
| var $push = callBound('Array.prototype.push'); |
| var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable'); |
| var originalGetSymbols = hasSymbols ? $Object.getOwnPropertySymbols : null; |
| |
| // eslint-disable-next-line no-unused-vars |
| module.exports = function assign(target, source1) { |
| if (target == null) { throw new TypeError('target must be an object'); } |
| var to = $Object(target); // step 1 |
| if (arguments.length === 1) { |
| return to; // step 2 |
| } |
| for (var s = 1; s < arguments.length; ++s) { |
| var from = $Object(arguments[s]); // step 3.a.i |
| |
| // step 3.a.ii: |
| var keys = objectKeys(from); |
| var getSymbols = hasSymbols && ($Object.getOwnPropertySymbols || originalGetSymbols); |
| if (getSymbols) { |
| var syms = getSymbols(from); |
| for (var j = 0; j < syms.length; ++j) { |
| var key = syms[j]; |
| if ($propIsEnumerable(from, key)) { |
| $push(keys, key); |
| } |
| } |
| } |
| |
| // step 3.a.iii: |
| for (var i = 0; i < keys.length; ++i) { |
| var nextKey = keys[i]; |
| if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2 |
| var propValue = from[nextKey]; // step 3.a.iii.2.a |
| to[nextKey] = propValue; // step 3.a.iii.2.b |
| } |
| } |
| } |
| |
| return to; // step 4 |
| }; |
| |
| },{"call-bound":11,"es-object-atoms":23,"has-symbols/shams":31,"object-keys":39}],3:[function(require,module,exports){ |
| 'use strict'; |
| |
| var defineProperties = require('define-properties'); |
| var callBind = require('call-bind'); |
| |
| var implementation = require('./implementation'); |
| var getPolyfill = require('./polyfill'); |
| var shim = require('./shim'); |
| |
| var polyfill = callBind.apply(getPolyfill()); |
| // eslint-disable-next-line no-unused-vars |
| var bound = function assign(target, source1) { |
| return polyfill(Object, arguments); |
| }; |
| |
| defineProperties(bound, { |
| getPolyfill: getPolyfill, |
| implementation: implementation, |
| shim: shim |
| }); |
| |
| module.exports = bound; |
| |
| },{"./implementation":2,"./polyfill":42,"./shim":43,"call-bind":10,"define-properties":13}],4:[function(require,module,exports){ |
| 'use strict'; |
| |
| var bind = require('function-bind'); |
| |
| var $apply = require('./functionApply'); |
| var $call = require('./functionCall'); |
| var $reflectApply = require('./reflectApply'); |
| |
| /** @type {import('./actualApply')} */ |
| module.exports = $reflectApply || bind.call($call, $apply); |
| |
| },{"./functionApply":6,"./functionCall":7,"./reflectApply":9,"function-bind":25}],5:[function(require,module,exports){ |
| 'use strict'; |
| |
| var bind = require('function-bind'); |
| var $apply = require('./functionApply'); |
| var actualApply = require('./actualApply'); |
| |
| /** @type {import('./applyBind')} */ |
| module.exports = function applyBind() { |
| return actualApply(bind, $apply, arguments); |
| }; |
| |
| },{"./actualApply":4,"./functionApply":6,"function-bind":25}],6:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./functionApply')} */ |
| module.exports = Function.prototype.apply; |
| |
| },{}],7:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./functionCall')} */ |
| module.exports = Function.prototype.call; |
| |
| },{}],8:[function(require,module,exports){ |
| 'use strict'; |
| |
| var bind = require('function-bind'); |
| var $TypeError = require('es-errors/type'); |
| |
| var $call = require('./functionCall'); |
| var $actualApply = require('./actualApply'); |
| |
| /** @type {import('.')} */ |
| module.exports = function callBindBasic(args) { |
| if (args.length < 1 || typeof args[0] !== 'function') { |
| throw new $TypeError('a function is required'); |
| } |
| return $actualApply(bind, $call, args); |
| }; |
| |
| },{"./actualApply":4,"./functionCall":7,"es-errors/type":21,"function-bind":25}],9:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./reflectApply')} */ |
| module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; |
| |
| },{}],10:[function(require,module,exports){ |
| 'use strict'; |
| |
| var setFunctionLength = require('set-function-length'); |
| |
| var $defineProperty = require('es-define-property'); |
| |
| var callBindBasic = require('call-bind-apply-helpers'); |
| var applyBind = require('call-bind-apply-helpers/applyBind'); |
| |
| module.exports = function callBind(originalFunction) { |
| var func = callBindBasic(arguments); |
| var adjustedLength = originalFunction.length - (arguments.length - 1); |
| return setFunctionLength( |
| func, |
| 1 + (adjustedLength > 0 ? adjustedLength : 0), |
| true |
| ); |
| }; |
| |
| if ($defineProperty) { |
| $defineProperty(module.exports, 'apply', { value: applyBind }); |
| } else { |
| module.exports.apply = applyBind; |
| } |
| |
| },{"call-bind-apply-helpers":8,"call-bind-apply-helpers/applyBind":5,"es-define-property":15,"set-function-length":41}],11:[function(require,module,exports){ |
| 'use strict'; |
| |
| var GetIntrinsic = require('get-intrinsic'); |
| |
| var callBindBasic = require('call-bind-apply-helpers'); |
| |
| /** @type {(thisArg: string, searchString: string, position?: number) => number} */ |
| var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); |
| |
| /** @type {import('.')} */ |
| module.exports = function callBoundIntrinsic(name, allowMissing) { |
| // eslint-disable-next-line no-extra-parens |
| var intrinsic = /** @type {Parameters<typeof callBindBasic>[0][0]} */ (GetIntrinsic(name, !!allowMissing)); |
| if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { |
| return callBindBasic([intrinsic]); |
| } |
| return intrinsic; |
| }; |
| |
| },{"call-bind-apply-helpers":8,"get-intrinsic":26}],12:[function(require,module,exports){ |
| 'use strict'; |
| |
| var $defineProperty = require('es-define-property'); |
| |
| var $SyntaxError = require('es-errors/syntax'); |
| var $TypeError = require('es-errors/type'); |
| |
| var gopd = require('gopd'); |
| |
| /** @type {import('.')} */ |
| module.exports = function defineDataProperty( |
| obj, |
| property, |
| value |
| ) { |
| if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { |
| throw new $TypeError('`obj` must be an object or a function`'); |
| } |
| if (typeof property !== 'string' && typeof property !== 'symbol') { |
| throw new $TypeError('`property` must be a string or a symbol`'); |
| } |
| if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { |
| throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); |
| } |
| if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { |
| throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); |
| } |
| if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { |
| throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); |
| } |
| if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { |
| throw new $TypeError('`loose`, if provided, must be a boolean'); |
| } |
| |
| var nonEnumerable = arguments.length > 3 ? arguments[3] : null; |
| var nonWritable = arguments.length > 4 ? arguments[4] : null; |
| var nonConfigurable = arguments.length > 5 ? arguments[5] : null; |
| var loose = arguments.length > 6 ? arguments[6] : false; |
| |
| /* @type {false | TypedPropertyDescriptor<unknown>} */ |
| var desc = !!gopd && gopd(obj, property); |
| |
| if ($defineProperty) { |
| $defineProperty(obj, property, { |
| configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, |
| enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, |
| value: value, |
| writable: nonWritable === null && desc ? desc.writable : !nonWritable |
| }); |
| } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { |
| // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable |
| obj[property] = value; // eslint-disable-line no-param-reassign |
| } else { |
| throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); |
| } |
| }; |
| |
| },{"es-define-property":15,"es-errors/syntax":20,"es-errors/type":21,"gopd":28}],13:[function(require,module,exports){ |
| 'use strict'; |
| |
| var keys = require('object-keys'); |
| var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; |
| |
| var toStr = Object.prototype.toString; |
| var concat = Array.prototype.concat; |
| var defineDataProperty = require('define-data-property'); |
| |
| var isFunction = function (fn) { |
| return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; |
| }; |
| |
| var supportsDescriptors = require('has-property-descriptors')(); |
| |
| var defineProperty = function (object, name, value, predicate) { |
| if (name in object) { |
| if (predicate === true) { |
| if (object[name] === value) { |
| return; |
| } |
| } else if (!isFunction(predicate) || !predicate()) { |
| return; |
| } |
| } |
| |
| if (supportsDescriptors) { |
| defineDataProperty(object, name, value, true); |
| } else { |
| defineDataProperty(object, name, value); |
| } |
| }; |
| |
| var defineProperties = function (object, map) { |
| var predicates = arguments.length > 2 ? arguments[2] : {}; |
| var props = keys(map); |
| if (hasSymbols) { |
| props = concat.call(props, Object.getOwnPropertySymbols(map)); |
| } |
| for (var i = 0; i < props.length; i += 1) { |
| defineProperty(object, props[i], map[props[i]], predicates[props[i]]); |
| } |
| }; |
| |
| defineProperties.supportsDescriptors = !!supportsDescriptors; |
| |
| module.exports = defineProperties; |
| |
| },{"define-data-property":12,"has-property-descriptors":29,"object-keys":39}],14:[function(require,module,exports){ |
| 'use strict'; |
| |
| var callBind = require('call-bind-apply-helpers'); |
| var gOPD = require('gopd'); |
| |
| var hasProtoAccessor; |
| try { |
| // eslint-disable-next-line no-extra-parens, no-proto |
| hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; |
| } catch (e) { |
| if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { |
| throw e; |
| } |
| } |
| |
| // eslint-disable-next-line no-extra-parens |
| var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); |
| |
| var $Object = Object; |
| var $getPrototypeOf = $Object.getPrototypeOf; |
| |
| /** @type {import('./get')} */ |
| module.exports = desc && typeof desc.get === 'function' |
| ? callBind([desc.get]) |
| : typeof $getPrototypeOf === 'function' |
| ? /** @type {import('./get')} */ function getDunder(value) { |
| // eslint-disable-next-line eqeqeq |
| return $getPrototypeOf(value == null ? value : $Object(value)); |
| } |
| : false; |
| |
| },{"call-bind-apply-helpers":8,"gopd":28}],15:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('.')} */ |
| var $defineProperty = Object.defineProperty || false; |
| if ($defineProperty) { |
| try { |
| $defineProperty({}, 'a', { value: 1 }); |
| } catch (e) { |
| // IE 8 has a broken defineProperty |
| $defineProperty = false; |
| } |
| } |
| |
| module.exports = $defineProperty; |
| |
| },{}],16:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./eval')} */ |
| module.exports = EvalError; |
| |
| },{}],17:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('.')} */ |
| module.exports = Error; |
| |
| },{}],18:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./range')} */ |
| module.exports = RangeError; |
| |
| },{}],19:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./ref')} */ |
| module.exports = ReferenceError; |
| |
| },{}],20:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./syntax')} */ |
| module.exports = SyntaxError; |
| |
| },{}],21:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./type')} */ |
| module.exports = TypeError; |
| |
| },{}],22:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./uri')} */ |
| module.exports = URIError; |
| |
| },{}],23:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('.')} */ |
| module.exports = Object; |
| |
| },{}],24:[function(require,module,exports){ |
| 'use strict'; |
| |
| /* eslint no-invalid-this: 1 */ |
| |
| var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; |
| var toStr = Object.prototype.toString; |
| var max = Math.max; |
| var funcType = '[object Function]'; |
| |
| var concatty = function concatty(a, b) { |
| var arr = []; |
| |
| for (var i = 0; i < a.length; i += 1) { |
| arr[i] = a[i]; |
| } |
| for (var j = 0; j < b.length; j += 1) { |
| arr[j + a.length] = b[j]; |
| } |
| |
| return arr; |
| }; |
| |
| var slicy = function slicy(arrLike, offset) { |
| var arr = []; |
| for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { |
| arr[j] = arrLike[i]; |
| } |
| return arr; |
| }; |
| |
| var joiny = function (arr, joiner) { |
| var str = ''; |
| for (var i = 0; i < arr.length; i += 1) { |
| str += arr[i]; |
| if (i + 1 < arr.length) { |
| str += joiner; |
| } |
| } |
| return str; |
| }; |
| |
| module.exports = function bind(that) { |
| var target = this; |
| if (typeof target !== 'function' || toStr.apply(target) !== funcType) { |
| throw new TypeError(ERROR_MESSAGE + target); |
| } |
| var args = slicy(arguments, 1); |
| |
| var bound; |
| var binder = function () { |
| if (this instanceof bound) { |
| var result = target.apply( |
| this, |
| concatty(args, arguments) |
| ); |
| if (Object(result) === result) { |
| return result; |
| } |
| return this; |
| } |
| return target.apply( |
| that, |
| concatty(args, arguments) |
| ); |
| |
| }; |
| |
| var boundLength = max(0, target.length - args.length); |
| var boundArgs = []; |
| for (var i = 0; i < boundLength; i++) { |
| boundArgs[i] = '$' + i; |
| } |
| |
| bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); |
| |
| if (target.prototype) { |
| var Empty = function Empty() {}; |
| Empty.prototype = target.prototype; |
| bound.prototype = new Empty(); |
| Empty.prototype = null; |
| } |
| |
| return bound; |
| }; |
| |
| },{}],25:[function(require,module,exports){ |
| 'use strict'; |
| |
| var implementation = require('./implementation'); |
| |
| module.exports = Function.prototype.bind || implementation; |
| |
| },{"./implementation":24}],26:[function(require,module,exports){ |
| 'use strict'; |
| |
| var undefined; |
| |
| var $Object = require('es-object-atoms'); |
| |
| var $Error = require('es-errors'); |
| var $EvalError = require('es-errors/eval'); |
| var $RangeError = require('es-errors/range'); |
| var $ReferenceError = require('es-errors/ref'); |
| var $SyntaxError = require('es-errors/syntax'); |
| var $TypeError = require('es-errors/type'); |
| var $URIError = require('es-errors/uri'); |
| |
| var abs = require('math-intrinsics/abs'); |
| var floor = require('math-intrinsics/floor'); |
| var max = require('math-intrinsics/max'); |
| var min = require('math-intrinsics/min'); |
| var pow = require('math-intrinsics/pow'); |
| |
| var $Function = Function; |
| |
| // eslint-disable-next-line consistent-return |
| var getEvalledConstructor = function (expressionSyntax) { |
| try { |
| return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); |
| } catch (e) {} |
| }; |
| |
| var $gOPD = require('gopd'); |
| var $defineProperty = require('es-define-property'); |
| |
| var throwTypeError = function () { |
| throw new $TypeError(); |
| }; |
| var ThrowTypeError = $gOPD |
| ? (function () { |
| try { |
| // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties |
| arguments.callee; // IE 8 does not throw here |
| return throwTypeError; |
| } catch (calleeThrows) { |
| try { |
| // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') |
| return $gOPD(arguments, 'callee').get; |
| } catch (gOPDthrows) { |
| return throwTypeError; |
| } |
| } |
| }()) |
| : throwTypeError; |
| |
| var hasSymbols = require('has-symbols')(); |
| var getDunderProto = require('dunder-proto/get'); |
| |
| var getProto = (typeof Reflect === 'function' && Reflect.getPrototypeOf) |
| || $Object.getPrototypeOf |
| || getDunderProto; |
| |
| var $apply = require('call-bind-apply-helpers/functionApply'); |
| var $call = require('call-bind-apply-helpers/functionCall'); |
| |
| var needsEval = {}; |
| |
| var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); |
| |
| var INTRINSICS = { |
| __proto__: null, |
| '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, |
| '%Array%': Array, |
| '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, |
| '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, |
| '%AsyncFromSyncIteratorPrototype%': undefined, |
| '%AsyncFunction%': needsEval, |
| '%AsyncGenerator%': needsEval, |
| '%AsyncGeneratorFunction%': needsEval, |
| '%AsyncIteratorPrototype%': needsEval, |
| '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, |
| '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, |
| '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, |
| '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, |
| '%Boolean%': Boolean, |
| '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, |
| '%Date%': Date, |
| '%decodeURI%': decodeURI, |
| '%decodeURIComponent%': decodeURIComponent, |
| '%encodeURI%': encodeURI, |
| '%encodeURIComponent%': encodeURIComponent, |
| '%Error%': $Error, |
| '%eval%': eval, // eslint-disable-line no-eval |
| '%EvalError%': $EvalError, |
| '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, |
| '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, |
| '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, |
| '%Function%': $Function, |
| '%GeneratorFunction%': needsEval, |
| '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, |
| '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, |
| '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, |
| '%isFinite%': isFinite, |
| '%isNaN%': isNaN, |
| '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, |
| '%JSON%': typeof JSON === 'object' ? JSON : undefined, |
| '%Map%': typeof Map === 'undefined' ? undefined : Map, |
| '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), |
| '%Math%': Math, |
| '%Number%': Number, |
| '%Object%': $Object, |
| '%Object.getOwnPropertyDescriptor%': $gOPD, |
| '%parseFloat%': parseFloat, |
| '%parseInt%': parseInt, |
| '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, |
| '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, |
| '%RangeError%': $RangeError, |
| '%ReferenceError%': $ReferenceError, |
| '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, |
| '%RegExp%': RegExp, |
| '%Set%': typeof Set === 'undefined' ? undefined : Set, |
| '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), |
| '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, |
| '%String%': String, |
| '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, |
| '%Symbol%': hasSymbols ? Symbol : undefined, |
| '%SyntaxError%': $SyntaxError, |
| '%ThrowTypeError%': ThrowTypeError, |
| '%TypedArray%': TypedArray, |
| '%TypeError%': $TypeError, |
| '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, |
| '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, |
| '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, |
| '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, |
| '%URIError%': $URIError, |
| '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, |
| '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, |
| '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, |
| |
| '%Function.prototype.call%': $call, |
| '%Function.prototype.apply%': $apply, |
| '%Object.defineProperty%': $defineProperty, |
| '%Math.abs%': abs, |
| '%Math.floor%': floor, |
| '%Math.max%': max, |
| '%Math.min%': min, |
| '%Math.pow%': pow |
| }; |
| |
| if (getProto) { |
| try { |
| null.error; // eslint-disable-line no-unused-expressions |
| } catch (e) { |
| // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 |
| var errorProto = getProto(getProto(e)); |
| INTRINSICS['%Error.prototype%'] = errorProto; |
| } |
| } |
| |
| var doEval = function doEval(name) { |
| var value; |
| if (name === '%AsyncFunction%') { |
| value = getEvalledConstructor('async function () {}'); |
| } else if (name === '%GeneratorFunction%') { |
| value = getEvalledConstructor('function* () {}'); |
| } else if (name === '%AsyncGeneratorFunction%') { |
| value = getEvalledConstructor('async function* () {}'); |
| } else if (name === '%AsyncGenerator%') { |
| var fn = doEval('%AsyncGeneratorFunction%'); |
| if (fn) { |
| value = fn.prototype; |
| } |
| } else if (name === '%AsyncIteratorPrototype%') { |
| var gen = doEval('%AsyncGenerator%'); |
| if (gen && getProto) { |
| value = getProto(gen.prototype); |
| } |
| } |
| |
| INTRINSICS[name] = value; |
| |
| return value; |
| }; |
| |
| var LEGACY_ALIASES = { |
| __proto__: null, |
| '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], |
| '%ArrayPrototype%': ['Array', 'prototype'], |
| '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], |
| '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], |
| '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], |
| '%ArrayProto_values%': ['Array', 'prototype', 'values'], |
| '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], |
| '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], |
| '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], |
| '%BooleanPrototype%': ['Boolean', 'prototype'], |
| '%DataViewPrototype%': ['DataView', 'prototype'], |
| '%DatePrototype%': ['Date', 'prototype'], |
| '%ErrorPrototype%': ['Error', 'prototype'], |
| '%EvalErrorPrototype%': ['EvalError', 'prototype'], |
| '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], |
| '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], |
| '%FunctionPrototype%': ['Function', 'prototype'], |
| '%Generator%': ['GeneratorFunction', 'prototype'], |
| '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], |
| '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], |
| '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], |
| '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], |
| '%JSONParse%': ['JSON', 'parse'], |
| '%JSONStringify%': ['JSON', 'stringify'], |
| '%MapPrototype%': ['Map', 'prototype'], |
| '%NumberPrototype%': ['Number', 'prototype'], |
| '%ObjectPrototype%': ['Object', 'prototype'], |
| '%ObjProto_toString%': ['Object', 'prototype', 'toString'], |
| '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], |
| '%PromisePrototype%': ['Promise', 'prototype'], |
| '%PromiseProto_then%': ['Promise', 'prototype', 'then'], |
| '%Promise_all%': ['Promise', 'all'], |
| '%Promise_reject%': ['Promise', 'reject'], |
| '%Promise_resolve%': ['Promise', 'resolve'], |
| '%RangeErrorPrototype%': ['RangeError', 'prototype'], |
| '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], |
| '%RegExpPrototype%': ['RegExp', 'prototype'], |
| '%SetPrototype%': ['Set', 'prototype'], |
| '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], |
| '%StringPrototype%': ['String', 'prototype'], |
| '%SymbolPrototype%': ['Symbol', 'prototype'], |
| '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], |
| '%TypedArrayPrototype%': ['TypedArray', 'prototype'], |
| '%TypeErrorPrototype%': ['TypeError', 'prototype'], |
| '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], |
| '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], |
| '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], |
| '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], |
| '%URIErrorPrototype%': ['URIError', 'prototype'], |
| '%WeakMapPrototype%': ['WeakMap', 'prototype'], |
| '%WeakSetPrototype%': ['WeakSet', 'prototype'] |
| }; |
| |
| var bind = require('function-bind'); |
| var hasOwn = require('hasown'); |
| var $concat = bind.call($call, Array.prototype.concat); |
| var $spliceApply = bind.call($apply, Array.prototype.splice); |
| var $replace = bind.call($call, String.prototype.replace); |
| var $strSlice = bind.call($call, String.prototype.slice); |
| var $exec = bind.call($call, RegExp.prototype.exec); |
| |
| /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ |
| var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; |
| var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ |
| var stringToPath = function stringToPath(string) { |
| var first = $strSlice(string, 0, 1); |
| var last = $strSlice(string, -1); |
| if (first === '%' && last !== '%') { |
| throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); |
| } else if (last === '%' && first !== '%') { |
| throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); |
| } |
| var result = []; |
| $replace(string, rePropName, function (match, number, quote, subString) { |
| result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; |
| }); |
| return result; |
| }; |
| /* end adaptation */ |
| |
| var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { |
| var intrinsicName = name; |
| var alias; |
| if (hasOwn(LEGACY_ALIASES, intrinsicName)) { |
| alias = LEGACY_ALIASES[intrinsicName]; |
| intrinsicName = '%' + alias[0] + '%'; |
| } |
| |
| if (hasOwn(INTRINSICS, intrinsicName)) { |
| var value = INTRINSICS[intrinsicName]; |
| if (value === needsEval) { |
| value = doEval(intrinsicName); |
| } |
| if (typeof value === 'undefined' && !allowMissing) { |
| throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); |
| } |
| |
| return { |
| alias: alias, |
| name: intrinsicName, |
| value: value |
| }; |
| } |
| |
| throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); |
| }; |
| |
| module.exports = function GetIntrinsic(name, allowMissing) { |
| if (typeof name !== 'string' || name.length === 0) { |
| throw new $TypeError('intrinsic name must be a non-empty string'); |
| } |
| if (arguments.length > 1 && typeof allowMissing !== 'boolean') { |
| throw new $TypeError('"allowMissing" argument must be a boolean'); |
| } |
| |
| if ($exec(/^%?[^%]*%?$/, name) === null) { |
| throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); |
| } |
| var parts = stringToPath(name); |
| var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; |
| |
| var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); |
| var intrinsicRealName = intrinsic.name; |
| var value = intrinsic.value; |
| var skipFurtherCaching = false; |
| |
| var alias = intrinsic.alias; |
| if (alias) { |
| intrinsicBaseName = alias[0]; |
| $spliceApply(parts, $concat([0, 1], alias)); |
| } |
| |
| for (var i = 1, isOwn = true; i < parts.length; i += 1) { |
| var part = parts[i]; |
| var first = $strSlice(part, 0, 1); |
| var last = $strSlice(part, -1); |
| if ( |
| ( |
| (first === '"' || first === "'" || first === '`') |
| || (last === '"' || last === "'" || last === '`') |
| ) |
| && first !== last |
| ) { |
| throw new $SyntaxError('property names with quotes must have matching quotes'); |
| } |
| if (part === 'constructor' || !isOwn) { |
| skipFurtherCaching = true; |
| } |
| |
| intrinsicBaseName += '.' + part; |
| intrinsicRealName = '%' + intrinsicBaseName + '%'; |
| |
| if (hasOwn(INTRINSICS, intrinsicRealName)) { |
| value = INTRINSICS[intrinsicRealName]; |
| } else if (value != null) { |
| if (!(part in value)) { |
| if (!allowMissing) { |
| throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); |
| } |
| return void undefined; |
| } |
| if ($gOPD && (i + 1) >= parts.length) { |
| var desc = $gOPD(value, part); |
| isOwn = !!desc; |
| |
| // By convention, when a data property is converted to an accessor |
| // property to emulate a data property that does not suffer from |
| // the override mistake, that accessor's getter is marked with |
| // an `originalValue` property. Here, when we detect this, we |
| // uphold the illusion by pretending to see that original data |
| // property, i.e., returning the value rather than the getter |
| // itself. |
| if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { |
| value = desc.get; |
| } else { |
| value = value[part]; |
| } |
| } else { |
| isOwn = hasOwn(value, part); |
| value = value[part]; |
| } |
| |
| if (isOwn && !skipFurtherCaching) { |
| INTRINSICS[intrinsicRealName] = value; |
| } |
| } |
| } |
| return value; |
| }; |
| |
| },{"call-bind-apply-helpers/functionApply":6,"call-bind-apply-helpers/functionCall":7,"dunder-proto/get":14,"es-define-property":15,"es-errors":17,"es-errors/eval":16,"es-errors/range":18,"es-errors/ref":19,"es-errors/syntax":20,"es-errors/type":21,"es-errors/uri":22,"es-object-atoms":23,"function-bind":25,"gopd":28,"has-symbols":30,"hasown":32,"math-intrinsics/abs":33,"math-intrinsics/floor":34,"math-intrinsics/max":35,"math-intrinsics/min":36,"math-intrinsics/pow":37}],27:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./gOPD')} */ |
| module.exports = Object.getOwnPropertyDescriptor; |
| |
| },{}],28:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('.')} */ |
| var $gOPD = require('./gOPD'); |
| |
| if ($gOPD) { |
| try { |
| $gOPD([], 'length'); |
| } catch (e) { |
| // IE 8 has a broken gOPD |
| $gOPD = null; |
| } |
| } |
| |
| module.exports = $gOPD; |
| |
| },{"./gOPD":27}],29:[function(require,module,exports){ |
| 'use strict'; |
| |
| var $defineProperty = require('es-define-property'); |
| |
| var hasPropertyDescriptors = function hasPropertyDescriptors() { |
| return !!$defineProperty; |
| }; |
| |
| hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { |
| // node v0.6 has a bug where array lengths can be Set but not Defined |
| if (!$defineProperty) { |
| return null; |
| } |
| try { |
| return $defineProperty([], 'length', { value: 1 }).length !== 1; |
| } catch (e) { |
| // In Firefox 4-22, defining length on an array throws an exception. |
| return true; |
| } |
| }; |
| |
| module.exports = hasPropertyDescriptors; |
| |
| },{"es-define-property":15}],30:[function(require,module,exports){ |
| 'use strict'; |
| |
| var origSymbol = typeof Symbol !== 'undefined' && Symbol; |
| var hasSymbolSham = require('./shams'); |
| |
| /** @type {import('.')} */ |
| module.exports = function hasNativeSymbols() { |
| if (typeof origSymbol !== 'function') { return false; } |
| if (typeof Symbol !== 'function') { return false; } |
| if (typeof origSymbol('foo') !== 'symbol') { return false; } |
| if (typeof Symbol('bar') !== 'symbol') { return false; } |
| |
| return hasSymbolSham(); |
| }; |
| |
| },{"./shams":31}],31:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./shams')} */ |
| /* eslint complexity: [2, 18], max-statements: [2, 33] */ |
| module.exports = function hasSymbols() { |
| if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } |
| if (typeof Symbol.iterator === 'symbol') { return true; } |
| |
| /** @type {{ [k in symbol]?: unknown }} */ |
| var obj = {}; |
| var sym = Symbol('test'); |
| var symObj = Object(sym); |
| if (typeof sym === 'string') { return false; } |
| |
| if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } |
| if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } |
| |
| // temp disabled per https://github.com/ljharb/object.assign/issues/17 |
| // if (sym instanceof Symbol) { return false; } |
| // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 |
| // if (!(symObj instanceof Symbol)) { return false; } |
| |
| // if (typeof Symbol.prototype.toString !== 'function') { return false; } |
| // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } |
| |
| var symVal = 42; |
| obj[sym] = symVal; |
| for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop |
| if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } |
| |
| if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } |
| |
| var syms = Object.getOwnPropertySymbols(obj); |
| if (syms.length !== 1 || syms[0] !== sym) { return false; } |
| |
| if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } |
| |
| if (typeof Object.getOwnPropertyDescriptor === 'function') { |
| // eslint-disable-next-line no-extra-parens |
| var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); |
| if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } |
| } |
| |
| return true; |
| }; |
| |
| },{}],32:[function(require,module,exports){ |
| 'use strict'; |
| |
| var call = Function.prototype.call; |
| var $hasOwn = Object.prototype.hasOwnProperty; |
| var bind = require('function-bind'); |
| |
| /** @type {import('.')} */ |
| module.exports = bind.call(call, $hasOwn); |
| |
| },{"function-bind":25}],33:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./abs')} */ |
| module.exports = Math.abs; |
| |
| },{}],34:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./abs')} */ |
| module.exports = Math.floor; |
| |
| },{}],35:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./max')} */ |
| module.exports = Math.max; |
| |
| },{}],36:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./min')} */ |
| module.exports = Math.min; |
| |
| },{}],37:[function(require,module,exports){ |
| 'use strict'; |
| |
| /** @type {import('./pow')} */ |
| module.exports = Math.pow; |
| |
| },{}],38:[function(require,module,exports){ |
| 'use strict'; |
| |
| var keysShim; |
| if (!Object.keys) { |
| // modified from https://github.com/es-shims/es5-shim |
| var has = Object.prototype.hasOwnProperty; |
| var toStr = Object.prototype.toString; |
| var isArgs = require('./isArguments'); // eslint-disable-line global-require |
| var isEnumerable = Object.prototype.propertyIsEnumerable; |
| var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); |
| var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); |
| var dontEnums = [ |
| 'toString', |
| 'toLocaleString', |
| 'valueOf', |
| 'hasOwnProperty', |
| 'isPrototypeOf', |
| 'propertyIsEnumerable', |
| 'constructor' |
| ]; |
| var equalsConstructorPrototype = function (o) { |
| var ctor = o.constructor; |
| return ctor && ctor.prototype === o; |
| }; |
| var excludedKeys = { |
| $applicationCache: true, |
| $console: true, |
| $external: true, |
| $frame: true, |
| $frameElement: true, |
| $frames: true, |
| $innerHeight: true, |
| $innerWidth: true, |
| $onmozfullscreenchange: true, |
| $onmozfullscreenerror: true, |
| $outerHeight: true, |
| $outerWidth: true, |
| $pageXOffset: true, |
| $pageYOffset: true, |
| $parent: true, |
| $scrollLeft: true, |
| $scrollTop: true, |
| $scrollX: true, |
| $scrollY: true, |
| $self: true, |
| $webkitIndexedDB: true, |
| $webkitStorageInfo: true, |
| $window: true |
| }; |
| var hasAutomationEqualityBug = (function () { |
| /* global window */ |
| if (typeof window === 'undefined') { return false; } |
| for (var k in window) { |
| try { |
| if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { |
| try { |
| equalsConstructorPrototype(window[k]); |
| } catch (e) { |
| return true; |
| } |
| } |
| } catch (e) { |
| return true; |
| } |
| } |
| return false; |
| }()); |
| var equalsConstructorPrototypeIfNotBuggy = function (o) { |
| /* global window */ |
| if (typeof window === 'undefined' || !hasAutomationEqualityBug) { |
| return equalsConstructorPrototype(o); |
| } |
| try { |
| return equalsConstructorPrototype(o); |
| } catch (e) { |
| return false; |
| } |
| }; |
| |
| keysShim = function keys(object) { |
| var isObject = object !== null && typeof object === 'object'; |
| var isFunction = toStr.call(object) === '[object Function]'; |
| var isArguments = isArgs(object); |
| var isString = isObject && toStr.call(object) === '[object String]'; |
| var theKeys = []; |
| |
| if (!isObject && !isFunction && !isArguments) { |
| throw new TypeError('Object.keys called on a non-object'); |
| } |
| |
| var skipProto = hasProtoEnumBug && isFunction; |
| if (isString && object.length > 0 && !has.call(object, 0)) { |
| for (var i = 0; i < object.length; ++i) { |
| theKeys.push(String(i)); |
| } |
| } |
| |
| if (isArguments && object.length > 0) { |
| for (var j = 0; j < object.length; ++j) { |
| theKeys.push(String(j)); |
| } |
| } else { |
| for (var name in object) { |
| if (!(skipProto && name === 'prototype') && has.call(object, name)) { |
| theKeys.push(String(name)); |
| } |
| } |
| } |
| |
| if (hasDontEnumBug) { |
| var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); |
| |
| for (var k = 0; k < dontEnums.length; ++k) { |
| if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { |
| theKeys.push(dontEnums[k]); |
| } |
| } |
| } |
| return theKeys; |
| }; |
| } |
| module.exports = keysShim; |
| |
| },{"./isArguments":40}],39:[function(require,module,exports){ |
| 'use strict'; |
| |
| var slice = Array.prototype.slice; |
| var isArgs = require('./isArguments'); |
| |
| var origKeys = Object.keys; |
| var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation'); |
| |
| var originalKeys = Object.keys; |
| |
| keysShim.shim = function shimObjectKeys() { |
| if (Object.keys) { |
| var keysWorksWithArguments = (function () { |
| // Safari 5.0 bug |
| var args = Object.keys(arguments); |
| return args && args.length === arguments.length; |
| }(1, 2)); |
| if (!keysWorksWithArguments) { |
| Object.keys = function keys(object) { // eslint-disable-line func-name-matching |
| if (isArgs(object)) { |
| return originalKeys(slice.call(object)); |
| } |
| return originalKeys(object); |
| }; |
| } |
| } else { |
| Object.keys = keysShim; |
| } |
| return Object.keys || keysShim; |
| }; |
| |
| module.exports = keysShim; |
| |
| },{"./implementation":38,"./isArguments":40}],40:[function(require,module,exports){ |
| 'use strict'; |
| |
| var toStr = Object.prototype.toString; |
| |
| module.exports = function isArguments(value) { |
| var str = toStr.call(value); |
| var isArgs = str === '[object Arguments]'; |
| if (!isArgs) { |
| isArgs = str !== '[object Array]' && |
| value !== null && |
| typeof value === 'object' && |
| typeof value.length === 'number' && |
| value.length >= 0 && |
| toStr.call(value.callee) === '[object Function]'; |
| } |
| return isArgs; |
| }; |
| |
| },{}],41:[function(require,module,exports){ |
| 'use strict'; |
| |
| var GetIntrinsic = require('get-intrinsic'); |
| var define = require('define-data-property'); |
| var hasDescriptors = require('has-property-descriptors')(); |
| var gOPD = require('gopd'); |
| |
| var $TypeError = require('es-errors/type'); |
| var $floor = GetIntrinsic('%Math.floor%'); |
| |
| /** @type {import('.')} */ |
| module.exports = function setFunctionLength(fn, length) { |
| if (typeof fn !== 'function') { |
| throw new $TypeError('`fn` is not a function'); |
| } |
| if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) { |
| throw new $TypeError('`length` must be a positive 32-bit integer'); |
| } |
| |
| var loose = arguments.length > 2 && !!arguments[2]; |
| |
| var functionLengthIsConfigurable = true; |
| var functionLengthIsWritable = true; |
| if ('length' in fn && gOPD) { |
| var desc = gOPD(fn, 'length'); |
| if (desc && !desc.configurable) { |
| functionLengthIsConfigurable = false; |
| } |
| if (desc && !desc.writable) { |
| functionLengthIsWritable = false; |
| } |
| } |
| |
| if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { |
| if (hasDescriptors) { |
| define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true); |
| } else { |
| define(/** @type {Parameters<define>[0]} */ (fn), 'length', length); |
| } |
| } |
| return fn; |
| }; |
| |
| },{"define-data-property":12,"es-errors/type":21,"get-intrinsic":26,"gopd":28,"has-property-descriptors":29}],42:[function(require,module,exports){ |
| 'use strict'; |
| |
| var implementation = require('./implementation'); |
| |
| var lacksProperEnumerationOrder = function () { |
| if (!Object.assign) { |
| return false; |
| } |
| /* |
| * v8, specifically in node 4.x, has a bug with incorrect property enumeration order |
| * note: this does not detect the bug unless there's 20 characters |
| */ |
| var str = 'abcdefghijklmnopqrst'; |
| var letters = str.split(''); |
| var map = {}; |
| for (var i = 0; i < letters.length; ++i) { |
| map[letters[i]] = letters[i]; |
| } |
| var obj = Object.assign({}, map); |
| var actual = ''; |
| for (var k in obj) { |
| actual += k; |
| } |
| return str !== actual; |
| }; |
| |
| var assignHasPendingExceptions = function () { |
| if (!Object.assign || !Object.preventExtensions) { |
| return false; |
| } |
| /* |
| * Firefox 37 still has "pending exception" logic in its Object.assign implementation, |
| * which is 72% slower than our shim, and Firefox 40's native implementation. |
| */ |
| var thrower = Object.preventExtensions({ 1: 2 }); |
| try { |
| Object.assign(thrower, 'xy'); |
| } catch (e) { |
| return thrower[1] === 'y'; |
| } |
| return false; |
| }; |
| |
| module.exports = function getPolyfill() { |
| if (!Object.assign) { |
| return implementation; |
| } |
| if (lacksProperEnumerationOrder()) { |
| return implementation; |
| } |
| if (assignHasPendingExceptions()) { |
| return implementation; |
| } |
| return Object.assign; |
| }; |
| |
| },{"./implementation":2}],43:[function(require,module,exports){ |
| 'use strict'; |
| |
| var define = require('define-properties'); |
| var getPolyfill = require('./polyfill'); |
| |
| module.exports = function shimAssign() { |
| var polyfill = getPolyfill(); |
| define( |
| Object, |
| { assign: polyfill }, |
| { assign: function () { return Object.assign !== polyfill; } } |
| ); |
| return polyfill; |
| }; |
| |
| },{"./polyfill":42,"define-properties":13}]},{},[1]); |