[d565449] | 1 | (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){
|
---|
| 2 | 'use strict';
|
---|
| 3 |
|
---|
| 4 | var keys = require('object-keys').shim();
|
---|
| 5 | delete keys.shim;
|
---|
| 6 |
|
---|
| 7 | var assign = require('./');
|
---|
| 8 |
|
---|
| 9 | module.exports = assign.shim();
|
---|
| 10 |
|
---|
| 11 | delete assign.shim;
|
---|
| 12 |
|
---|
[79a0317] | 13 | },{"./":3,"object-keys":39}],2:[function(require,module,exports){
|
---|
[d565449] | 14 | 'use strict';
|
---|
| 15 |
|
---|
| 16 | // modified from https://github.com/es-shims/es6-shim
|
---|
| 17 | var objectKeys = require('object-keys');
|
---|
| 18 | var hasSymbols = require('has-symbols/shams')();
|
---|
[79a0317] | 19 | var callBound = require('call-bound');
|
---|
| 20 | var $Object = require('es-object-atoms');
|
---|
[d565449] | 21 | var $push = callBound('Array.prototype.push');
|
---|
| 22 | var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
---|
[79a0317] | 23 | var originalGetSymbols = hasSymbols ? $Object.getOwnPropertySymbols : null;
|
---|
[d565449] | 24 |
|
---|
| 25 | // eslint-disable-next-line no-unused-vars
|
---|
| 26 | module.exports = function assign(target, source1) {
|
---|
| 27 | if (target == null) { throw new TypeError('target must be an object'); }
|
---|
[79a0317] | 28 | var to = $Object(target); // step 1
|
---|
[d565449] | 29 | if (arguments.length === 1) {
|
---|
| 30 | return to; // step 2
|
---|
| 31 | }
|
---|
| 32 | for (var s = 1; s < arguments.length; ++s) {
|
---|
[79a0317] | 33 | var from = $Object(arguments[s]); // step 3.a.i
|
---|
[d565449] | 34 |
|
---|
| 35 | // step 3.a.ii:
|
---|
| 36 | var keys = objectKeys(from);
|
---|
[79a0317] | 37 | var getSymbols = hasSymbols && ($Object.getOwnPropertySymbols || originalGetSymbols);
|
---|
[d565449] | 38 | if (getSymbols) {
|
---|
| 39 | var syms = getSymbols(from);
|
---|
| 40 | for (var j = 0; j < syms.length; ++j) {
|
---|
| 41 | var key = syms[j];
|
---|
| 42 | if ($propIsEnumerable(from, key)) {
|
---|
| 43 | $push(keys, key);
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | // step 3.a.iii:
|
---|
| 49 | for (var i = 0; i < keys.length; ++i) {
|
---|
| 50 | var nextKey = keys[i];
|
---|
| 51 | if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2
|
---|
| 52 | var propValue = from[nextKey]; // step 3.a.iii.2.a
|
---|
| 53 | to[nextKey] = propValue; // step 3.a.iii.2.b
|
---|
| 54 | }
|
---|
| 55 | }
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | return to; // step 4
|
---|
| 59 | };
|
---|
| 60 |
|
---|
[79a0317] | 61 | },{"call-bound":11,"es-object-atoms":23,"has-symbols/shams":31,"object-keys":39}],3:[function(require,module,exports){
|
---|
[d565449] | 62 | 'use strict';
|
---|
| 63 |
|
---|
| 64 | var defineProperties = require('define-properties');
|
---|
| 65 | var callBind = require('call-bind');
|
---|
| 66 |
|
---|
| 67 | var implementation = require('./implementation');
|
---|
| 68 | var getPolyfill = require('./polyfill');
|
---|
| 69 | var shim = require('./shim');
|
---|
| 70 |
|
---|
| 71 | var polyfill = callBind.apply(getPolyfill());
|
---|
| 72 | // eslint-disable-next-line no-unused-vars
|
---|
| 73 | var bound = function assign(target, source1) {
|
---|
| 74 | return polyfill(Object, arguments);
|
---|
| 75 | };
|
---|
| 76 |
|
---|
| 77 | defineProperties(bound, {
|
---|
| 78 | getPolyfill: getPolyfill,
|
---|
| 79 | implementation: implementation,
|
---|
| 80 | shim: shim
|
---|
| 81 | });
|
---|
| 82 |
|
---|
| 83 | module.exports = bound;
|
---|
| 84 |
|
---|
[79a0317] | 85 | },{"./implementation":2,"./polyfill":42,"./shim":43,"call-bind":10,"define-properties":13}],4:[function(require,module,exports){
|
---|
[d565449] | 86 | 'use strict';
|
---|
| 87 |
|
---|
[79a0317] | 88 | var bind = require('function-bind');
|
---|
[d565449] | 89 |
|
---|
[79a0317] | 90 | var $apply = require('./functionApply');
|
---|
| 91 | var $call = require('./functionCall');
|
---|
| 92 | var $reflectApply = require('./reflectApply');
|
---|
[d565449] | 93 |
|
---|
[79a0317] | 94 | /** @type {import('./actualApply')} */
|
---|
| 95 | module.exports = $reflectApply || bind.call($call, $apply);
|
---|
[d565449] | 96 |
|
---|
[79a0317] | 97 | },{"./functionApply":6,"./functionCall":7,"./reflectApply":9,"function-bind":25}],5:[function(require,module,exports){
|
---|
| 98 | 'use strict';
|
---|
| 99 |
|
---|
| 100 | var bind = require('function-bind');
|
---|
| 101 | var $apply = require('./functionApply');
|
---|
| 102 | var actualApply = require('./actualApply');
|
---|
| 103 |
|
---|
| 104 | /** @type {import('./applyBind')} */
|
---|
| 105 | module.exports = function applyBind() {
|
---|
| 106 | return actualApply(bind, $apply, arguments);
|
---|
[d565449] | 107 | };
|
---|
| 108 |
|
---|
[79a0317] | 109 | },{"./actualApply":4,"./functionApply":6,"function-bind":25}],6:[function(require,module,exports){
|
---|
[d565449] | 110 | 'use strict';
|
---|
| 111 |
|
---|
[79a0317] | 112 | /** @type {import('./functionApply')} */
|
---|
| 113 | module.exports = Function.prototype.apply;
|
---|
[d565449] | 114 |
|
---|
[79a0317] | 115 | },{}],7:[function(require,module,exports){
|
---|
| 116 | 'use strict';
|
---|
[d565449] | 117 |
|
---|
[79a0317] | 118 | /** @type {import('./functionCall')} */
|
---|
| 119 | module.exports = Function.prototype.call;
|
---|
[d565449] | 120 |
|
---|
[79a0317] | 121 | },{}],8:[function(require,module,exports){
|
---|
| 122 | 'use strict';
|
---|
[d565449] | 123 |
|
---|
[79a0317] | 124 | var bind = require('function-bind');
|
---|
| 125 | var $TypeError = require('es-errors/type');
|
---|
| 126 |
|
---|
| 127 | var $call = require('./functionCall');
|
---|
| 128 | var $actualApply = require('./actualApply');
|
---|
| 129 |
|
---|
| 130 | /** @type {import('.')} */
|
---|
| 131 | module.exports = function callBindBasic(args) {
|
---|
| 132 | if (args.length < 1 || typeof args[0] !== 'function') {
|
---|
[d565449] | 133 | throw new $TypeError('a function is required');
|
---|
| 134 | }
|
---|
[79a0317] | 135 | return $actualApply(bind, $call, args);
|
---|
| 136 | };
|
---|
| 137 |
|
---|
| 138 | },{"./actualApply":4,"./functionCall":7,"es-errors/type":21,"function-bind":25}],9:[function(require,module,exports){
|
---|
| 139 | 'use strict';
|
---|
| 140 |
|
---|
| 141 | /** @type {import('./reflectApply')} */
|
---|
| 142 | module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
|
---|
| 143 |
|
---|
| 144 | },{}],10:[function(require,module,exports){
|
---|
| 145 | 'use strict';
|
---|
| 146 |
|
---|
| 147 | var setFunctionLength = require('set-function-length');
|
---|
| 148 |
|
---|
| 149 | var $defineProperty = require('es-define-property');
|
---|
| 150 |
|
---|
| 151 | var callBindBasic = require('call-bind-apply-helpers');
|
---|
| 152 | var applyBind = require('call-bind-apply-helpers/applyBind');
|
---|
| 153 |
|
---|
| 154 | module.exports = function callBind(originalFunction) {
|
---|
| 155 | var func = callBindBasic(arguments);
|
---|
| 156 | var adjustedLength = originalFunction.length - (arguments.length - 1);
|
---|
[d565449] | 157 | return setFunctionLength(
|
---|
| 158 | func,
|
---|
[79a0317] | 159 | 1 + (adjustedLength > 0 ? adjustedLength : 0),
|
---|
[d565449] | 160 | true
|
---|
| 161 | );
|
---|
| 162 | };
|
---|
| 163 |
|
---|
| 164 | if ($defineProperty) {
|
---|
| 165 | $defineProperty(module.exports, 'apply', { value: applyBind });
|
---|
| 166 | } else {
|
---|
| 167 | module.exports.apply = applyBind;
|
---|
| 168 | }
|
---|
| 169 |
|
---|
[79a0317] | 170 | },{"call-bind-apply-helpers":8,"call-bind-apply-helpers/applyBind":5,"es-define-property":15,"set-function-length":41}],11:[function(require,module,exports){
|
---|
[d565449] | 171 | 'use strict';
|
---|
| 172 |
|
---|
| 173 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 174 |
|
---|
[79a0317] | 175 | var callBindBasic = require('call-bind-apply-helpers');
|
---|
| 176 |
|
---|
| 177 | /** @type {(thisArg: string, searchString: string, position?: number) => number} */
|
---|
| 178 | var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
|
---|
| 179 |
|
---|
| 180 | /** @type {import('.')} */
|
---|
| 181 | module.exports = function callBoundIntrinsic(name, allowMissing) {
|
---|
| 182 | // eslint-disable-next-line no-extra-parens
|
---|
| 183 | var intrinsic = /** @type {Parameters<typeof callBindBasic>[0][0]} */ (GetIntrinsic(name, !!allowMissing));
|
---|
| 184 | if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
---|
| 185 | return callBindBasic([intrinsic]);
|
---|
[d565449] | 186 | }
|
---|
[79a0317] | 187 | return intrinsic;
|
---|
| 188 | };
|
---|
| 189 |
|
---|
| 190 | },{"call-bind-apply-helpers":8,"get-intrinsic":26}],12:[function(require,module,exports){
|
---|
| 191 | 'use strict';
|
---|
| 192 |
|
---|
| 193 | var $defineProperty = require('es-define-property');
|
---|
[d565449] | 194 |
|
---|
[79a0317] | 195 | var $SyntaxError = require('es-errors/syntax');
|
---|
| 196 | var $TypeError = require('es-errors/type');
|
---|
[d565449] | 197 |
|
---|
| 198 | var gopd = require('gopd');
|
---|
| 199 |
|
---|
[79a0317] | 200 | /** @type {import('.')} */
|
---|
[d565449] | 201 | module.exports = function defineDataProperty(
|
---|
| 202 | obj,
|
---|
| 203 | property,
|
---|
| 204 | value
|
---|
| 205 | ) {
|
---|
| 206 | if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
---|
| 207 | throw new $TypeError('`obj` must be an object or a function`');
|
---|
| 208 | }
|
---|
| 209 | if (typeof property !== 'string' && typeof property !== 'symbol') {
|
---|
| 210 | throw new $TypeError('`property` must be a string or a symbol`');
|
---|
| 211 | }
|
---|
| 212 | if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
---|
| 213 | throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
|
---|
| 214 | }
|
---|
| 215 | if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
---|
| 216 | throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
|
---|
| 217 | }
|
---|
| 218 | if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
---|
| 219 | throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
|
---|
| 220 | }
|
---|
| 221 | if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
---|
| 222 | throw new $TypeError('`loose`, if provided, must be a boolean');
|
---|
| 223 | }
|
---|
| 224 |
|
---|
| 225 | var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
---|
| 226 | var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
---|
| 227 | var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
---|
| 228 | var loose = arguments.length > 6 ? arguments[6] : false;
|
---|
| 229 |
|
---|
| 230 | /* @type {false | TypedPropertyDescriptor<unknown>} */
|
---|
| 231 | var desc = !!gopd && gopd(obj, property);
|
---|
| 232 |
|
---|
| 233 | if ($defineProperty) {
|
---|
| 234 | $defineProperty(obj, property, {
|
---|
| 235 | configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
---|
| 236 | enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
---|
| 237 | value: value,
|
---|
| 238 | writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
---|
| 239 | });
|
---|
| 240 | } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
---|
| 241 | // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
---|
| 242 | obj[property] = value; // eslint-disable-line no-param-reassign
|
---|
| 243 | } else {
|
---|
| 244 | throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
---|
| 245 | }
|
---|
| 246 | };
|
---|
| 247 |
|
---|
[79a0317] | 248 | },{"es-define-property":15,"es-errors/syntax":20,"es-errors/type":21,"gopd":28}],13:[function(require,module,exports){
|
---|
[d565449] | 249 | 'use strict';
|
---|
| 250 |
|
---|
| 251 | var keys = require('object-keys');
|
---|
| 252 | var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
---|
| 253 |
|
---|
| 254 | var toStr = Object.prototype.toString;
|
---|
| 255 | var concat = Array.prototype.concat;
|
---|
| 256 | var defineDataProperty = require('define-data-property');
|
---|
| 257 |
|
---|
| 258 | var isFunction = function (fn) {
|
---|
| 259 | return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
|
---|
| 260 | };
|
---|
| 261 |
|
---|
| 262 | var supportsDescriptors = require('has-property-descriptors')();
|
---|
| 263 |
|
---|
| 264 | var defineProperty = function (object, name, value, predicate) {
|
---|
| 265 | if (name in object) {
|
---|
| 266 | if (predicate === true) {
|
---|
| 267 | if (object[name] === value) {
|
---|
| 268 | return;
|
---|
| 269 | }
|
---|
| 270 | } else if (!isFunction(predicate) || !predicate()) {
|
---|
| 271 | return;
|
---|
| 272 | }
|
---|
| 273 | }
|
---|
| 274 |
|
---|
| 275 | if (supportsDescriptors) {
|
---|
| 276 | defineDataProperty(object, name, value, true);
|
---|
| 277 | } else {
|
---|
| 278 | defineDataProperty(object, name, value);
|
---|
| 279 | }
|
---|
| 280 | };
|
---|
| 281 |
|
---|
| 282 | var defineProperties = function (object, map) {
|
---|
| 283 | var predicates = arguments.length > 2 ? arguments[2] : {};
|
---|
| 284 | var props = keys(map);
|
---|
| 285 | if (hasSymbols) {
|
---|
| 286 | props = concat.call(props, Object.getOwnPropertySymbols(map));
|
---|
| 287 | }
|
---|
| 288 | for (var i = 0; i < props.length; i += 1) {
|
---|
| 289 | defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
|
---|
| 290 | }
|
---|
| 291 | };
|
---|
| 292 |
|
---|
| 293 | defineProperties.supportsDescriptors = !!supportsDescriptors;
|
---|
| 294 |
|
---|
| 295 | module.exports = defineProperties;
|
---|
| 296 |
|
---|
[79a0317] | 297 | },{"define-data-property":12,"has-property-descriptors":29,"object-keys":39}],14:[function(require,module,exports){
|
---|
| 298 | 'use strict';
|
---|
| 299 |
|
---|
| 300 | var callBind = require('call-bind-apply-helpers');
|
---|
| 301 | var gOPD = require('gopd');
|
---|
| 302 |
|
---|
| 303 | var hasProtoAccessor;
|
---|
| 304 | try {
|
---|
| 305 | // eslint-disable-next-line no-extra-parens, no-proto
|
---|
| 306 | hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
|
---|
| 307 | } catch (e) {
|
---|
| 308 | if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
|
---|
| 309 | throw e;
|
---|
| 310 | }
|
---|
| 311 | }
|
---|
| 312 |
|
---|
| 313 | // eslint-disable-next-line no-extra-parens
|
---|
| 314 | var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
|
---|
| 315 |
|
---|
| 316 | var $Object = Object;
|
---|
| 317 | var $getPrototypeOf = $Object.getPrototypeOf;
|
---|
| 318 |
|
---|
| 319 | /** @type {import('./get')} */
|
---|
| 320 | module.exports = desc && typeof desc.get === 'function'
|
---|
| 321 | ? callBind([desc.get])
|
---|
| 322 | : typeof $getPrototypeOf === 'function'
|
---|
| 323 | ? /** @type {import('./get')} */ function getDunder(value) {
|
---|
| 324 | // eslint-disable-next-line eqeqeq
|
---|
| 325 | return $getPrototypeOf(value == null ? value : $Object(value));
|
---|
| 326 | }
|
---|
| 327 | : false;
|
---|
| 328 |
|
---|
| 329 | },{"call-bind-apply-helpers":8,"gopd":28}],15:[function(require,module,exports){
|
---|
| 330 | 'use strict';
|
---|
| 331 |
|
---|
| 332 | /** @type {import('.')} */
|
---|
| 333 | var $defineProperty = Object.defineProperty || false;
|
---|
| 334 | if ($defineProperty) {
|
---|
| 335 | try {
|
---|
| 336 | $defineProperty({}, 'a', { value: 1 });
|
---|
| 337 | } catch (e) {
|
---|
| 338 | // IE 8 has a broken defineProperty
|
---|
| 339 | $defineProperty = false;
|
---|
| 340 | }
|
---|
| 341 | }
|
---|
| 342 |
|
---|
| 343 | module.exports = $defineProperty;
|
---|
| 344 |
|
---|
| 345 | },{}],16:[function(require,module,exports){
|
---|
| 346 | 'use strict';
|
---|
| 347 |
|
---|
| 348 | /** @type {import('./eval')} */
|
---|
| 349 | module.exports = EvalError;
|
---|
| 350 |
|
---|
| 351 | },{}],17:[function(require,module,exports){
|
---|
| 352 | 'use strict';
|
---|
| 353 |
|
---|
| 354 | /** @type {import('.')} */
|
---|
| 355 | module.exports = Error;
|
---|
| 356 |
|
---|
| 357 | },{}],18:[function(require,module,exports){
|
---|
| 358 | 'use strict';
|
---|
| 359 |
|
---|
| 360 | /** @type {import('./range')} */
|
---|
| 361 | module.exports = RangeError;
|
---|
| 362 |
|
---|
| 363 | },{}],19:[function(require,module,exports){
|
---|
| 364 | 'use strict';
|
---|
| 365 |
|
---|
| 366 | /** @type {import('./ref')} */
|
---|
| 367 | module.exports = ReferenceError;
|
---|
| 368 |
|
---|
| 369 | },{}],20:[function(require,module,exports){
|
---|
| 370 | 'use strict';
|
---|
| 371 |
|
---|
| 372 | /** @type {import('./syntax')} */
|
---|
| 373 | module.exports = SyntaxError;
|
---|
| 374 |
|
---|
| 375 | },{}],21:[function(require,module,exports){
|
---|
| 376 | 'use strict';
|
---|
| 377 |
|
---|
| 378 | /** @type {import('./type')} */
|
---|
| 379 | module.exports = TypeError;
|
---|
| 380 |
|
---|
| 381 | },{}],22:[function(require,module,exports){
|
---|
| 382 | 'use strict';
|
---|
| 383 |
|
---|
| 384 | /** @type {import('./uri')} */
|
---|
| 385 | module.exports = URIError;
|
---|
| 386 |
|
---|
| 387 | },{}],23:[function(require,module,exports){
|
---|
| 388 | 'use strict';
|
---|
| 389 |
|
---|
| 390 | /** @type {import('.')} */
|
---|
| 391 | module.exports = Object;
|
---|
| 392 |
|
---|
| 393 | },{}],24:[function(require,module,exports){
|
---|
[d565449] | 394 | 'use strict';
|
---|
| 395 |
|
---|
| 396 | /* eslint no-invalid-this: 1 */
|
---|
| 397 |
|
---|
| 398 | var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
---|
| 399 | var toStr = Object.prototype.toString;
|
---|
| 400 | var max = Math.max;
|
---|
| 401 | var funcType = '[object Function]';
|
---|
| 402 |
|
---|
| 403 | var concatty = function concatty(a, b) {
|
---|
| 404 | var arr = [];
|
---|
| 405 |
|
---|
| 406 | for (var i = 0; i < a.length; i += 1) {
|
---|
| 407 | arr[i] = a[i];
|
---|
| 408 | }
|
---|
| 409 | for (var j = 0; j < b.length; j += 1) {
|
---|
| 410 | arr[j + a.length] = b[j];
|
---|
| 411 | }
|
---|
| 412 |
|
---|
| 413 | return arr;
|
---|
| 414 | };
|
---|
| 415 |
|
---|
| 416 | var slicy = function slicy(arrLike, offset) {
|
---|
| 417 | var arr = [];
|
---|
| 418 | for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
---|
| 419 | arr[j] = arrLike[i];
|
---|
| 420 | }
|
---|
| 421 | return arr;
|
---|
| 422 | };
|
---|
| 423 |
|
---|
| 424 | var joiny = function (arr, joiner) {
|
---|
| 425 | var str = '';
|
---|
| 426 | for (var i = 0; i < arr.length; i += 1) {
|
---|
| 427 | str += arr[i];
|
---|
| 428 | if (i + 1 < arr.length) {
|
---|
| 429 | str += joiner;
|
---|
| 430 | }
|
---|
| 431 | }
|
---|
| 432 | return str;
|
---|
| 433 | };
|
---|
| 434 |
|
---|
| 435 | module.exports = function bind(that) {
|
---|
| 436 | var target = this;
|
---|
| 437 | if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
|
---|
| 438 | throw new TypeError(ERROR_MESSAGE + target);
|
---|
| 439 | }
|
---|
| 440 | var args = slicy(arguments, 1);
|
---|
| 441 |
|
---|
| 442 | var bound;
|
---|
| 443 | var binder = function () {
|
---|
| 444 | if (this instanceof bound) {
|
---|
| 445 | var result = target.apply(
|
---|
| 446 | this,
|
---|
| 447 | concatty(args, arguments)
|
---|
| 448 | );
|
---|
| 449 | if (Object(result) === result) {
|
---|
| 450 | return result;
|
---|
| 451 | }
|
---|
| 452 | return this;
|
---|
| 453 | }
|
---|
| 454 | return target.apply(
|
---|
| 455 | that,
|
---|
| 456 | concatty(args, arguments)
|
---|
| 457 | );
|
---|
| 458 |
|
---|
| 459 | };
|
---|
| 460 |
|
---|
| 461 | var boundLength = max(0, target.length - args.length);
|
---|
| 462 | var boundArgs = [];
|
---|
| 463 | for (var i = 0; i < boundLength; i++) {
|
---|
| 464 | boundArgs[i] = '$' + i;
|
---|
| 465 | }
|
---|
| 466 |
|
---|
| 467 | bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
---|
| 468 |
|
---|
| 469 | if (target.prototype) {
|
---|
| 470 | var Empty = function Empty() {};
|
---|
| 471 | Empty.prototype = target.prototype;
|
---|
| 472 | bound.prototype = new Empty();
|
---|
| 473 | Empty.prototype = null;
|
---|
| 474 | }
|
---|
| 475 |
|
---|
| 476 | return bound;
|
---|
| 477 | };
|
---|
| 478 |
|
---|
[79a0317] | 479 | },{}],25:[function(require,module,exports){
|
---|
[d565449] | 480 | 'use strict';
|
---|
| 481 |
|
---|
| 482 | var implementation = require('./implementation');
|
---|
| 483 |
|
---|
| 484 | module.exports = Function.prototype.bind || implementation;
|
---|
| 485 |
|
---|
[79a0317] | 486 | },{"./implementation":24}],26:[function(require,module,exports){
|
---|
[d565449] | 487 | 'use strict';
|
---|
| 488 |
|
---|
| 489 | var undefined;
|
---|
| 490 |
|
---|
[79a0317] | 491 | var $Object = require('es-object-atoms');
|
---|
| 492 |
|
---|
| 493 | var $Error = require('es-errors');
|
---|
| 494 | var $EvalError = require('es-errors/eval');
|
---|
| 495 | var $RangeError = require('es-errors/range');
|
---|
| 496 | var $ReferenceError = require('es-errors/ref');
|
---|
| 497 | var $SyntaxError = require('es-errors/syntax');
|
---|
| 498 | var $TypeError = require('es-errors/type');
|
---|
| 499 | var $URIError = require('es-errors/uri');
|
---|
| 500 |
|
---|
| 501 | var abs = require('math-intrinsics/abs');
|
---|
| 502 | var floor = require('math-intrinsics/floor');
|
---|
| 503 | var max = require('math-intrinsics/max');
|
---|
| 504 | var min = require('math-intrinsics/min');
|
---|
| 505 | var pow = require('math-intrinsics/pow');
|
---|
| 506 |
|
---|
[d565449] | 507 | var $Function = Function;
|
---|
| 508 |
|
---|
| 509 | // eslint-disable-next-line consistent-return
|
---|
| 510 | var getEvalledConstructor = function (expressionSyntax) {
|
---|
| 511 | try {
|
---|
| 512 | return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
---|
| 513 | } catch (e) {}
|
---|
| 514 | };
|
---|
| 515 |
|
---|
[79a0317] | 516 | var $gOPD = require('gopd');
|
---|
| 517 | var $defineProperty = require('es-define-property');
|
---|
[d565449] | 518 |
|
---|
| 519 | var throwTypeError = function () {
|
---|
| 520 | throw new $TypeError();
|
---|
| 521 | };
|
---|
| 522 | var ThrowTypeError = $gOPD
|
---|
| 523 | ? (function () {
|
---|
| 524 | try {
|
---|
| 525 | // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
---|
| 526 | arguments.callee; // IE 8 does not throw here
|
---|
| 527 | return throwTypeError;
|
---|
| 528 | } catch (calleeThrows) {
|
---|
| 529 | try {
|
---|
| 530 | // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
---|
| 531 | return $gOPD(arguments, 'callee').get;
|
---|
| 532 | } catch (gOPDthrows) {
|
---|
| 533 | return throwTypeError;
|
---|
| 534 | }
|
---|
| 535 | }
|
---|
| 536 | }())
|
---|
| 537 | : throwTypeError;
|
---|
| 538 |
|
---|
| 539 | var hasSymbols = require('has-symbols')();
|
---|
[79a0317] | 540 | var getDunderProto = require('dunder-proto/get');
|
---|
[d565449] | 541 |
|
---|
[79a0317] | 542 | var getProto = (typeof Reflect === 'function' && Reflect.getPrototypeOf)
|
---|
| 543 | || $Object.getPrototypeOf
|
---|
| 544 | || getDunderProto;
|
---|
| 545 |
|
---|
| 546 | var $apply = require('call-bind-apply-helpers/functionApply');
|
---|
| 547 | var $call = require('call-bind-apply-helpers/functionCall');
|
---|
[d565449] | 548 |
|
---|
| 549 | var needsEval = {};
|
---|
| 550 |
|
---|
| 551 | var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
|
---|
| 552 |
|
---|
| 553 | var INTRINSICS = {
|
---|
[79a0317] | 554 | __proto__: null,
|
---|
[d565449] | 555 | '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
---|
| 556 | '%Array%': Array,
|
---|
| 557 | '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
---|
| 558 | '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
|
---|
| 559 | '%AsyncFromSyncIteratorPrototype%': undefined,
|
---|
| 560 | '%AsyncFunction%': needsEval,
|
---|
| 561 | '%AsyncGenerator%': needsEval,
|
---|
| 562 | '%AsyncGeneratorFunction%': needsEval,
|
---|
| 563 | '%AsyncIteratorPrototype%': needsEval,
|
---|
| 564 | '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
---|
| 565 | '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
|
---|
| 566 | '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
|
---|
| 567 | '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
|
---|
| 568 | '%Boolean%': Boolean,
|
---|
| 569 | '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
---|
| 570 | '%Date%': Date,
|
---|
| 571 | '%decodeURI%': decodeURI,
|
---|
| 572 | '%decodeURIComponent%': decodeURIComponent,
|
---|
| 573 | '%encodeURI%': encodeURI,
|
---|
| 574 | '%encodeURIComponent%': encodeURIComponent,
|
---|
[79a0317] | 575 | '%Error%': $Error,
|
---|
[d565449] | 576 | '%eval%': eval, // eslint-disable-line no-eval
|
---|
[79a0317] | 577 | '%EvalError%': $EvalError,
|
---|
[d565449] | 578 | '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
---|
| 579 | '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
---|
| 580 | '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
|
---|
| 581 | '%Function%': $Function,
|
---|
| 582 | '%GeneratorFunction%': needsEval,
|
---|
| 583 | '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
|
---|
| 584 | '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
|
---|
| 585 | '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
---|
| 586 | '%isFinite%': isFinite,
|
---|
| 587 | '%isNaN%': isNaN,
|
---|
| 588 | '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
---|
| 589 | '%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
---|
| 590 | '%Map%': typeof Map === 'undefined' ? undefined : Map,
|
---|
| 591 | '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
|
---|
| 592 | '%Math%': Math,
|
---|
| 593 | '%Number%': Number,
|
---|
[79a0317] | 594 | '%Object%': $Object,
|
---|
| 595 | '%Object.getOwnPropertyDescriptor%': $gOPD,
|
---|
[d565449] | 596 | '%parseFloat%': parseFloat,
|
---|
| 597 | '%parseInt%': parseInt,
|
---|
| 598 | '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
---|
| 599 | '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
---|
[79a0317] | 600 | '%RangeError%': $RangeError,
|
---|
| 601 | '%ReferenceError%': $ReferenceError,
|
---|
[d565449] | 602 | '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
---|
| 603 | '%RegExp%': RegExp,
|
---|
| 604 | '%Set%': typeof Set === 'undefined' ? undefined : Set,
|
---|
| 605 | '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
|
---|
| 606 | '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
---|
| 607 | '%String%': String,
|
---|
| 608 | '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
|
---|
| 609 | '%Symbol%': hasSymbols ? Symbol : undefined,
|
---|
| 610 | '%SyntaxError%': $SyntaxError,
|
---|
| 611 | '%ThrowTypeError%': ThrowTypeError,
|
---|
| 612 | '%TypedArray%': TypedArray,
|
---|
| 613 | '%TypeError%': $TypeError,
|
---|
| 614 | '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
|
---|
| 615 | '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
---|
| 616 | '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
---|
| 617 | '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
---|
[79a0317] | 618 | '%URIError%': $URIError,
|
---|
[d565449] | 619 | '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
---|
| 620 | '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
---|
[79a0317] | 621 | '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
|
---|
| 622 |
|
---|
| 623 | '%Function.prototype.call%': $call,
|
---|
| 624 | '%Function.prototype.apply%': $apply,
|
---|
| 625 | '%Object.defineProperty%': $defineProperty,
|
---|
| 626 | '%Math.abs%': abs,
|
---|
| 627 | '%Math.floor%': floor,
|
---|
| 628 | '%Math.max%': max,
|
---|
| 629 | '%Math.min%': min,
|
---|
| 630 | '%Math.pow%': pow
|
---|
[d565449] | 631 | };
|
---|
| 632 |
|
---|
| 633 | if (getProto) {
|
---|
| 634 | try {
|
---|
| 635 | null.error; // eslint-disable-line no-unused-expressions
|
---|
| 636 | } catch (e) {
|
---|
| 637 | // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
---|
| 638 | var errorProto = getProto(getProto(e));
|
---|
| 639 | INTRINSICS['%Error.prototype%'] = errorProto;
|
---|
| 640 | }
|
---|
| 641 | }
|
---|
| 642 |
|
---|
| 643 | var doEval = function doEval(name) {
|
---|
| 644 | var value;
|
---|
| 645 | if (name === '%AsyncFunction%') {
|
---|
| 646 | value = getEvalledConstructor('async function () {}');
|
---|
| 647 | } else if (name === '%GeneratorFunction%') {
|
---|
| 648 | value = getEvalledConstructor('function* () {}');
|
---|
| 649 | } else if (name === '%AsyncGeneratorFunction%') {
|
---|
| 650 | value = getEvalledConstructor('async function* () {}');
|
---|
| 651 | } else if (name === '%AsyncGenerator%') {
|
---|
| 652 | var fn = doEval('%AsyncGeneratorFunction%');
|
---|
| 653 | if (fn) {
|
---|
| 654 | value = fn.prototype;
|
---|
| 655 | }
|
---|
| 656 | } else if (name === '%AsyncIteratorPrototype%') {
|
---|
| 657 | var gen = doEval('%AsyncGenerator%');
|
---|
| 658 | if (gen && getProto) {
|
---|
| 659 | value = getProto(gen.prototype);
|
---|
| 660 | }
|
---|
| 661 | }
|
---|
| 662 |
|
---|
| 663 | INTRINSICS[name] = value;
|
---|
| 664 |
|
---|
| 665 | return value;
|
---|
| 666 | };
|
---|
| 667 |
|
---|
| 668 | var LEGACY_ALIASES = {
|
---|
[79a0317] | 669 | __proto__: null,
|
---|
[d565449] | 670 | '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
---|
| 671 | '%ArrayPrototype%': ['Array', 'prototype'],
|
---|
| 672 | '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
---|
| 673 | '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
---|
| 674 | '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
---|
| 675 | '%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
---|
| 676 | '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
---|
| 677 | '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
---|
| 678 | '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
---|
| 679 | '%BooleanPrototype%': ['Boolean', 'prototype'],
|
---|
| 680 | '%DataViewPrototype%': ['DataView', 'prototype'],
|
---|
| 681 | '%DatePrototype%': ['Date', 'prototype'],
|
---|
| 682 | '%ErrorPrototype%': ['Error', 'prototype'],
|
---|
| 683 | '%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
---|
| 684 | '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
---|
| 685 | '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
---|
| 686 | '%FunctionPrototype%': ['Function', 'prototype'],
|
---|
| 687 | '%Generator%': ['GeneratorFunction', 'prototype'],
|
---|
| 688 | '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
---|
| 689 | '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
---|
| 690 | '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
---|
| 691 | '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
---|
| 692 | '%JSONParse%': ['JSON', 'parse'],
|
---|
| 693 | '%JSONStringify%': ['JSON', 'stringify'],
|
---|
| 694 | '%MapPrototype%': ['Map', 'prototype'],
|
---|
| 695 | '%NumberPrototype%': ['Number', 'prototype'],
|
---|
| 696 | '%ObjectPrototype%': ['Object', 'prototype'],
|
---|
| 697 | '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
---|
| 698 | '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
---|
| 699 | '%PromisePrototype%': ['Promise', 'prototype'],
|
---|
| 700 | '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
---|
| 701 | '%Promise_all%': ['Promise', 'all'],
|
---|
| 702 | '%Promise_reject%': ['Promise', 'reject'],
|
---|
| 703 | '%Promise_resolve%': ['Promise', 'resolve'],
|
---|
| 704 | '%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
---|
| 705 | '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
---|
| 706 | '%RegExpPrototype%': ['RegExp', 'prototype'],
|
---|
| 707 | '%SetPrototype%': ['Set', 'prototype'],
|
---|
| 708 | '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
---|
| 709 | '%StringPrototype%': ['String', 'prototype'],
|
---|
| 710 | '%SymbolPrototype%': ['Symbol', 'prototype'],
|
---|
| 711 | '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
---|
| 712 | '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
---|
| 713 | '%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
---|
| 714 | '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
---|
| 715 | '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
---|
| 716 | '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
---|
| 717 | '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
---|
| 718 | '%URIErrorPrototype%': ['URIError', 'prototype'],
|
---|
| 719 | '%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
---|
| 720 | '%WeakSetPrototype%': ['WeakSet', 'prototype']
|
---|
| 721 | };
|
---|
| 722 |
|
---|
| 723 | var bind = require('function-bind');
|
---|
| 724 | var hasOwn = require('hasown');
|
---|
[79a0317] | 725 | var $concat = bind.call($call, Array.prototype.concat);
|
---|
| 726 | var $spliceApply = bind.call($apply, Array.prototype.splice);
|
---|
| 727 | var $replace = bind.call($call, String.prototype.replace);
|
---|
| 728 | var $strSlice = bind.call($call, String.prototype.slice);
|
---|
| 729 | var $exec = bind.call($call, RegExp.prototype.exec);
|
---|
[d565449] | 730 |
|
---|
| 731 | /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
---|
| 732 | var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
---|
| 733 | var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
---|
| 734 | var stringToPath = function stringToPath(string) {
|
---|
| 735 | var first = $strSlice(string, 0, 1);
|
---|
| 736 | var last = $strSlice(string, -1);
|
---|
| 737 | if (first === '%' && last !== '%') {
|
---|
| 738 | throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
|
---|
| 739 | } else if (last === '%' && first !== '%') {
|
---|
| 740 | throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
|
---|
| 741 | }
|
---|
| 742 | var result = [];
|
---|
| 743 | $replace(string, rePropName, function (match, number, quote, subString) {
|
---|
| 744 | result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
|
---|
| 745 | });
|
---|
| 746 | return result;
|
---|
| 747 | };
|
---|
| 748 | /* end adaptation */
|
---|
| 749 |
|
---|
| 750 | var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
---|
| 751 | var intrinsicName = name;
|
---|
| 752 | var alias;
|
---|
| 753 | if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
---|
| 754 | alias = LEGACY_ALIASES[intrinsicName];
|
---|
| 755 | intrinsicName = '%' + alias[0] + '%';
|
---|
| 756 | }
|
---|
| 757 |
|
---|
| 758 | if (hasOwn(INTRINSICS, intrinsicName)) {
|
---|
| 759 | var value = INTRINSICS[intrinsicName];
|
---|
| 760 | if (value === needsEval) {
|
---|
| 761 | value = doEval(intrinsicName);
|
---|
| 762 | }
|
---|
| 763 | if (typeof value === 'undefined' && !allowMissing) {
|
---|
| 764 | throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
---|
| 765 | }
|
---|
| 766 |
|
---|
| 767 | return {
|
---|
| 768 | alias: alias,
|
---|
| 769 | name: intrinsicName,
|
---|
| 770 | value: value
|
---|
| 771 | };
|
---|
| 772 | }
|
---|
| 773 |
|
---|
| 774 | throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
|
---|
| 775 | };
|
---|
| 776 |
|
---|
| 777 | module.exports = function GetIntrinsic(name, allowMissing) {
|
---|
| 778 | if (typeof name !== 'string' || name.length === 0) {
|
---|
| 779 | throw new $TypeError('intrinsic name must be a non-empty string');
|
---|
| 780 | }
|
---|
| 781 | if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
---|
| 782 | throw new $TypeError('"allowMissing" argument must be a boolean');
|
---|
| 783 | }
|
---|
| 784 |
|
---|
| 785 | if ($exec(/^%?[^%]*%?$/, name) === null) {
|
---|
| 786 | throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
---|
| 787 | }
|
---|
| 788 | var parts = stringToPath(name);
|
---|
| 789 | var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
---|
| 790 |
|
---|
| 791 | var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
---|
| 792 | var intrinsicRealName = intrinsic.name;
|
---|
| 793 | var value = intrinsic.value;
|
---|
| 794 | var skipFurtherCaching = false;
|
---|
| 795 |
|
---|
| 796 | var alias = intrinsic.alias;
|
---|
| 797 | if (alias) {
|
---|
| 798 | intrinsicBaseName = alias[0];
|
---|
| 799 | $spliceApply(parts, $concat([0, 1], alias));
|
---|
| 800 | }
|
---|
| 801 |
|
---|
| 802 | for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
---|
| 803 | var part = parts[i];
|
---|
| 804 | var first = $strSlice(part, 0, 1);
|
---|
| 805 | var last = $strSlice(part, -1);
|
---|
| 806 | if (
|
---|
| 807 | (
|
---|
| 808 | (first === '"' || first === "'" || first === '`')
|
---|
| 809 | || (last === '"' || last === "'" || last === '`')
|
---|
| 810 | )
|
---|
| 811 | && first !== last
|
---|
| 812 | ) {
|
---|
| 813 | throw new $SyntaxError('property names with quotes must have matching quotes');
|
---|
| 814 | }
|
---|
| 815 | if (part === 'constructor' || !isOwn) {
|
---|
| 816 | skipFurtherCaching = true;
|
---|
| 817 | }
|
---|
| 818 |
|
---|
| 819 | intrinsicBaseName += '.' + part;
|
---|
| 820 | intrinsicRealName = '%' + intrinsicBaseName + '%';
|
---|
| 821 |
|
---|
| 822 | if (hasOwn(INTRINSICS, intrinsicRealName)) {
|
---|
| 823 | value = INTRINSICS[intrinsicRealName];
|
---|
| 824 | } else if (value != null) {
|
---|
| 825 | if (!(part in value)) {
|
---|
| 826 | if (!allowMissing) {
|
---|
| 827 | throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
|
---|
| 828 | }
|
---|
| 829 | return void undefined;
|
---|
| 830 | }
|
---|
| 831 | if ($gOPD && (i + 1) >= parts.length) {
|
---|
| 832 | var desc = $gOPD(value, part);
|
---|
| 833 | isOwn = !!desc;
|
---|
| 834 |
|
---|
| 835 | // By convention, when a data property is converted to an accessor
|
---|
| 836 | // property to emulate a data property that does not suffer from
|
---|
| 837 | // the override mistake, that accessor's getter is marked with
|
---|
| 838 | // an `originalValue` property. Here, when we detect this, we
|
---|
| 839 | // uphold the illusion by pretending to see that original data
|
---|
| 840 | // property, i.e., returning the value rather than the getter
|
---|
| 841 | // itself.
|
---|
| 842 | if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
---|
| 843 | value = desc.get;
|
---|
| 844 | } else {
|
---|
| 845 | value = value[part];
|
---|
| 846 | }
|
---|
| 847 | } else {
|
---|
| 848 | isOwn = hasOwn(value, part);
|
---|
| 849 | value = value[part];
|
---|
| 850 | }
|
---|
| 851 |
|
---|
| 852 | if (isOwn && !skipFurtherCaching) {
|
---|
| 853 | INTRINSICS[intrinsicRealName] = value;
|
---|
| 854 | }
|
---|
| 855 | }
|
---|
| 856 | }
|
---|
| 857 | return value;
|
---|
| 858 | };
|
---|
| 859 |
|
---|
[79a0317] | 860 | },{"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){
|
---|
[d565449] | 861 | 'use strict';
|
---|
| 862 |
|
---|
[79a0317] | 863 | /** @type {import('./gOPD')} */
|
---|
| 864 | module.exports = Object.getOwnPropertyDescriptor;
|
---|
[d565449] | 865 |
|
---|
[79a0317] | 866 | },{}],28:[function(require,module,exports){
|
---|
| 867 | 'use strict';
|
---|
| 868 |
|
---|
| 869 | /** @type {import('.')} */
|
---|
| 870 | var $gOPD = require('./gOPD');
|
---|
[d565449] | 871 |
|
---|
| 872 | if ($gOPD) {
|
---|
| 873 | try {
|
---|
| 874 | $gOPD([], 'length');
|
---|
| 875 | } catch (e) {
|
---|
| 876 | // IE 8 has a broken gOPD
|
---|
| 877 | $gOPD = null;
|
---|
| 878 | }
|
---|
| 879 | }
|
---|
| 880 |
|
---|
| 881 | module.exports = $gOPD;
|
---|
| 882 |
|
---|
[79a0317] | 883 | },{"./gOPD":27}],29:[function(require,module,exports){
|
---|
[d565449] | 884 | 'use strict';
|
---|
| 885 |
|
---|
[79a0317] | 886 | var $defineProperty = require('es-define-property');
|
---|
[d565449] | 887 |
|
---|
| 888 | var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
---|
[79a0317] | 889 | return !!$defineProperty;
|
---|
[d565449] | 890 | };
|
---|
| 891 |
|
---|
| 892 | hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
---|
| 893 | // node v0.6 has a bug where array lengths can be Set but not Defined
|
---|
[79a0317] | 894 | if (!$defineProperty) {
|
---|
[d565449] | 895 | return null;
|
---|
| 896 | }
|
---|
| 897 | try {
|
---|
| 898 | return $defineProperty([], 'length', { value: 1 }).length !== 1;
|
---|
| 899 | } catch (e) {
|
---|
| 900 | // In Firefox 4-22, defining length on an array throws an exception.
|
---|
| 901 | return true;
|
---|
| 902 | }
|
---|
| 903 | };
|
---|
| 904 |
|
---|
| 905 | module.exports = hasPropertyDescriptors;
|
---|
| 906 |
|
---|
[79a0317] | 907 | },{"es-define-property":15}],30:[function(require,module,exports){
|
---|
[d565449] | 908 | 'use strict';
|
---|
| 909 |
|
---|
| 910 | var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
---|
| 911 | var hasSymbolSham = require('./shams');
|
---|
| 912 |
|
---|
[79a0317] | 913 | /** @type {import('.')} */
|
---|
[d565449] | 914 | module.exports = function hasNativeSymbols() {
|
---|
| 915 | if (typeof origSymbol !== 'function') { return false; }
|
---|
| 916 | if (typeof Symbol !== 'function') { return false; }
|
---|
| 917 | if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
---|
| 918 | if (typeof Symbol('bar') !== 'symbol') { return false; }
|
---|
| 919 |
|
---|
| 920 | return hasSymbolSham();
|
---|
| 921 | };
|
---|
| 922 |
|
---|
[79a0317] | 923 | },{"./shams":31}],31:[function(require,module,exports){
|
---|
[d565449] | 924 | 'use strict';
|
---|
| 925 |
|
---|
[79a0317] | 926 | /** @type {import('./shams')} */
|
---|
[d565449] | 927 | /* eslint complexity: [2, 18], max-statements: [2, 33] */
|
---|
| 928 | module.exports = function hasSymbols() {
|
---|
| 929 | if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
---|
| 930 | if (typeof Symbol.iterator === 'symbol') { return true; }
|
---|
| 931 |
|
---|
[79a0317] | 932 | /** @type {{ [k in symbol]?: unknown }} */
|
---|
[d565449] | 933 | var obj = {};
|
---|
| 934 | var sym = Symbol('test');
|
---|
| 935 | var symObj = Object(sym);
|
---|
| 936 | if (typeof sym === 'string') { return false; }
|
---|
| 937 |
|
---|
| 938 | if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
---|
| 939 | if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
---|
| 940 |
|
---|
| 941 | // temp disabled per https://github.com/ljharb/object.assign/issues/17
|
---|
| 942 | // if (sym instanceof Symbol) { return false; }
|
---|
| 943 | // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
---|
| 944 | // if (!(symObj instanceof Symbol)) { return false; }
|
---|
| 945 |
|
---|
| 946 | // if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
---|
| 947 | // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
---|
| 948 |
|
---|
| 949 | var symVal = 42;
|
---|
| 950 | obj[sym] = symVal;
|
---|
[79a0317] | 951 | for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
---|
[d565449] | 952 | if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
---|
| 953 |
|
---|
| 954 | if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
---|
| 955 |
|
---|
| 956 | var syms = Object.getOwnPropertySymbols(obj);
|
---|
| 957 | if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
---|
| 958 |
|
---|
| 959 | if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
---|
| 960 |
|
---|
| 961 | if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
---|
[79a0317] | 962 | // eslint-disable-next-line no-extra-parens
|
---|
| 963 | var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
|
---|
[d565449] | 964 | if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
---|
| 965 | }
|
---|
| 966 |
|
---|
| 967 | return true;
|
---|
| 968 | };
|
---|
| 969 |
|
---|
[79a0317] | 970 | },{}],32:[function(require,module,exports){
|
---|
[d565449] | 971 | 'use strict';
|
---|
| 972 |
|
---|
| 973 | var call = Function.prototype.call;
|
---|
| 974 | var $hasOwn = Object.prototype.hasOwnProperty;
|
---|
| 975 | var bind = require('function-bind');
|
---|
| 976 |
|
---|
[79a0317] | 977 | /** @type {import('.')} */
|
---|
[d565449] | 978 | module.exports = bind.call(call, $hasOwn);
|
---|
| 979 |
|
---|
[79a0317] | 980 | },{"function-bind":25}],33:[function(require,module,exports){
|
---|
| 981 | 'use strict';
|
---|
| 982 |
|
---|
| 983 | /** @type {import('./abs')} */
|
---|
| 984 | module.exports = Math.abs;
|
---|
| 985 |
|
---|
| 986 | },{}],34:[function(require,module,exports){
|
---|
| 987 | 'use strict';
|
---|
| 988 |
|
---|
| 989 | /** @type {import('./abs')} */
|
---|
| 990 | module.exports = Math.floor;
|
---|
| 991 |
|
---|
| 992 | },{}],35:[function(require,module,exports){
|
---|
| 993 | 'use strict';
|
---|
| 994 |
|
---|
| 995 | /** @type {import('./max')} */
|
---|
| 996 | module.exports = Math.max;
|
---|
| 997 |
|
---|
| 998 | },{}],36:[function(require,module,exports){
|
---|
| 999 | 'use strict';
|
---|
| 1000 |
|
---|
| 1001 | /** @type {import('./min')} */
|
---|
| 1002 | module.exports = Math.min;
|
---|
| 1003 |
|
---|
| 1004 | },{}],37:[function(require,module,exports){
|
---|
| 1005 | 'use strict';
|
---|
| 1006 |
|
---|
| 1007 | /** @type {import('./pow')} */
|
---|
| 1008 | module.exports = Math.pow;
|
---|
| 1009 |
|
---|
| 1010 | },{}],38:[function(require,module,exports){
|
---|
[d565449] | 1011 | 'use strict';
|
---|
| 1012 |
|
---|
| 1013 | var keysShim;
|
---|
| 1014 | if (!Object.keys) {
|
---|
| 1015 | // modified from https://github.com/es-shims/es5-shim
|
---|
| 1016 | var has = Object.prototype.hasOwnProperty;
|
---|
| 1017 | var toStr = Object.prototype.toString;
|
---|
| 1018 | var isArgs = require('./isArguments'); // eslint-disable-line global-require
|
---|
| 1019 | var isEnumerable = Object.prototype.propertyIsEnumerable;
|
---|
| 1020 | var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
|
---|
| 1021 | var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
|
---|
| 1022 | var dontEnums = [
|
---|
| 1023 | 'toString',
|
---|
| 1024 | 'toLocaleString',
|
---|
| 1025 | 'valueOf',
|
---|
| 1026 | 'hasOwnProperty',
|
---|
| 1027 | 'isPrototypeOf',
|
---|
| 1028 | 'propertyIsEnumerable',
|
---|
| 1029 | 'constructor'
|
---|
| 1030 | ];
|
---|
| 1031 | var equalsConstructorPrototype = function (o) {
|
---|
| 1032 | var ctor = o.constructor;
|
---|
| 1033 | return ctor && ctor.prototype === o;
|
---|
| 1034 | };
|
---|
| 1035 | var excludedKeys = {
|
---|
| 1036 | $applicationCache: true,
|
---|
| 1037 | $console: true,
|
---|
| 1038 | $external: true,
|
---|
| 1039 | $frame: true,
|
---|
| 1040 | $frameElement: true,
|
---|
| 1041 | $frames: true,
|
---|
| 1042 | $innerHeight: true,
|
---|
| 1043 | $innerWidth: true,
|
---|
| 1044 | $onmozfullscreenchange: true,
|
---|
| 1045 | $onmozfullscreenerror: true,
|
---|
| 1046 | $outerHeight: true,
|
---|
| 1047 | $outerWidth: true,
|
---|
| 1048 | $pageXOffset: true,
|
---|
| 1049 | $pageYOffset: true,
|
---|
| 1050 | $parent: true,
|
---|
| 1051 | $scrollLeft: true,
|
---|
| 1052 | $scrollTop: true,
|
---|
| 1053 | $scrollX: true,
|
---|
| 1054 | $scrollY: true,
|
---|
| 1055 | $self: true,
|
---|
| 1056 | $webkitIndexedDB: true,
|
---|
| 1057 | $webkitStorageInfo: true,
|
---|
| 1058 | $window: true
|
---|
| 1059 | };
|
---|
| 1060 | var hasAutomationEqualityBug = (function () {
|
---|
| 1061 | /* global window */
|
---|
| 1062 | if (typeof window === 'undefined') { return false; }
|
---|
| 1063 | for (var k in window) {
|
---|
| 1064 | try {
|
---|
| 1065 | if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
|
---|
| 1066 | try {
|
---|
| 1067 | equalsConstructorPrototype(window[k]);
|
---|
| 1068 | } catch (e) {
|
---|
| 1069 | return true;
|
---|
| 1070 | }
|
---|
| 1071 | }
|
---|
| 1072 | } catch (e) {
|
---|
| 1073 | return true;
|
---|
| 1074 | }
|
---|
| 1075 | }
|
---|
| 1076 | return false;
|
---|
| 1077 | }());
|
---|
| 1078 | var equalsConstructorPrototypeIfNotBuggy = function (o) {
|
---|
| 1079 | /* global window */
|
---|
| 1080 | if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
|
---|
| 1081 | return equalsConstructorPrototype(o);
|
---|
| 1082 | }
|
---|
| 1083 | try {
|
---|
| 1084 | return equalsConstructorPrototype(o);
|
---|
| 1085 | } catch (e) {
|
---|
| 1086 | return false;
|
---|
| 1087 | }
|
---|
| 1088 | };
|
---|
| 1089 |
|
---|
| 1090 | keysShim = function keys(object) {
|
---|
| 1091 | var isObject = object !== null && typeof object === 'object';
|
---|
| 1092 | var isFunction = toStr.call(object) === '[object Function]';
|
---|
| 1093 | var isArguments = isArgs(object);
|
---|
| 1094 | var isString = isObject && toStr.call(object) === '[object String]';
|
---|
| 1095 | var theKeys = [];
|
---|
| 1096 |
|
---|
| 1097 | if (!isObject && !isFunction && !isArguments) {
|
---|
| 1098 | throw new TypeError('Object.keys called on a non-object');
|
---|
| 1099 | }
|
---|
| 1100 |
|
---|
| 1101 | var skipProto = hasProtoEnumBug && isFunction;
|
---|
| 1102 | if (isString && object.length > 0 && !has.call(object, 0)) {
|
---|
| 1103 | for (var i = 0; i < object.length; ++i) {
|
---|
| 1104 | theKeys.push(String(i));
|
---|
| 1105 | }
|
---|
| 1106 | }
|
---|
| 1107 |
|
---|
| 1108 | if (isArguments && object.length > 0) {
|
---|
| 1109 | for (var j = 0; j < object.length; ++j) {
|
---|
| 1110 | theKeys.push(String(j));
|
---|
| 1111 | }
|
---|
| 1112 | } else {
|
---|
| 1113 | for (var name in object) {
|
---|
| 1114 | if (!(skipProto && name === 'prototype') && has.call(object, name)) {
|
---|
| 1115 | theKeys.push(String(name));
|
---|
| 1116 | }
|
---|
| 1117 | }
|
---|
| 1118 | }
|
---|
| 1119 |
|
---|
| 1120 | if (hasDontEnumBug) {
|
---|
| 1121 | var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
|
---|
| 1122 |
|
---|
| 1123 | for (var k = 0; k < dontEnums.length; ++k) {
|
---|
| 1124 | if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
|
---|
| 1125 | theKeys.push(dontEnums[k]);
|
---|
| 1126 | }
|
---|
| 1127 | }
|
---|
| 1128 | }
|
---|
| 1129 | return theKeys;
|
---|
| 1130 | };
|
---|
| 1131 | }
|
---|
| 1132 | module.exports = keysShim;
|
---|
| 1133 |
|
---|
[79a0317] | 1134 | },{"./isArguments":40}],39:[function(require,module,exports){
|
---|
[d565449] | 1135 | 'use strict';
|
---|
| 1136 |
|
---|
| 1137 | var slice = Array.prototype.slice;
|
---|
| 1138 | var isArgs = require('./isArguments');
|
---|
| 1139 |
|
---|
| 1140 | var origKeys = Object.keys;
|
---|
| 1141 | var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
|
---|
| 1142 |
|
---|
| 1143 | var originalKeys = Object.keys;
|
---|
| 1144 |
|
---|
| 1145 | keysShim.shim = function shimObjectKeys() {
|
---|
| 1146 | if (Object.keys) {
|
---|
| 1147 | var keysWorksWithArguments = (function () {
|
---|
| 1148 | // Safari 5.0 bug
|
---|
| 1149 | var args = Object.keys(arguments);
|
---|
| 1150 | return args && args.length === arguments.length;
|
---|
| 1151 | }(1, 2));
|
---|
| 1152 | if (!keysWorksWithArguments) {
|
---|
| 1153 | Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
---|
| 1154 | if (isArgs(object)) {
|
---|
| 1155 | return originalKeys(slice.call(object));
|
---|
| 1156 | }
|
---|
| 1157 | return originalKeys(object);
|
---|
| 1158 | };
|
---|
| 1159 | }
|
---|
| 1160 | } else {
|
---|
| 1161 | Object.keys = keysShim;
|
---|
| 1162 | }
|
---|
| 1163 | return Object.keys || keysShim;
|
---|
| 1164 | };
|
---|
| 1165 |
|
---|
| 1166 | module.exports = keysShim;
|
---|
| 1167 |
|
---|
[79a0317] | 1168 | },{"./implementation":38,"./isArguments":40}],40:[function(require,module,exports){
|
---|
[d565449] | 1169 | 'use strict';
|
---|
| 1170 |
|
---|
| 1171 | var toStr = Object.prototype.toString;
|
---|
| 1172 |
|
---|
| 1173 | module.exports = function isArguments(value) {
|
---|
| 1174 | var str = toStr.call(value);
|
---|
| 1175 | var isArgs = str === '[object Arguments]';
|
---|
| 1176 | if (!isArgs) {
|
---|
| 1177 | isArgs = str !== '[object Array]' &&
|
---|
| 1178 | value !== null &&
|
---|
| 1179 | typeof value === 'object' &&
|
---|
| 1180 | typeof value.length === 'number' &&
|
---|
| 1181 | value.length >= 0 &&
|
---|
| 1182 | toStr.call(value.callee) === '[object Function]';
|
---|
| 1183 | }
|
---|
| 1184 | return isArgs;
|
---|
| 1185 | };
|
---|
| 1186 |
|
---|
[79a0317] | 1187 | },{}],41:[function(require,module,exports){
|
---|
[d565449] | 1188 | 'use strict';
|
---|
| 1189 |
|
---|
| 1190 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 1191 | var define = require('define-data-property');
|
---|
| 1192 | var hasDescriptors = require('has-property-descriptors')();
|
---|
| 1193 | var gOPD = require('gopd');
|
---|
| 1194 |
|
---|
[79a0317] | 1195 | var $TypeError = require('es-errors/type');
|
---|
[d565449] | 1196 | var $floor = GetIntrinsic('%Math.floor%');
|
---|
| 1197 |
|
---|
[79a0317] | 1198 | /** @type {import('.')} */
|
---|
[d565449] | 1199 | module.exports = function setFunctionLength(fn, length) {
|
---|
| 1200 | if (typeof fn !== 'function') {
|
---|
| 1201 | throw new $TypeError('`fn` is not a function');
|
---|
| 1202 | }
|
---|
| 1203 | if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
|
---|
| 1204 | throw new $TypeError('`length` must be a positive 32-bit integer');
|
---|
| 1205 | }
|
---|
| 1206 |
|
---|
| 1207 | var loose = arguments.length > 2 && !!arguments[2];
|
---|
| 1208 |
|
---|
| 1209 | var functionLengthIsConfigurable = true;
|
---|
| 1210 | var functionLengthIsWritable = true;
|
---|
| 1211 | if ('length' in fn && gOPD) {
|
---|
| 1212 | var desc = gOPD(fn, 'length');
|
---|
| 1213 | if (desc && !desc.configurable) {
|
---|
| 1214 | functionLengthIsConfigurable = false;
|
---|
| 1215 | }
|
---|
| 1216 | if (desc && !desc.writable) {
|
---|
| 1217 | functionLengthIsWritable = false;
|
---|
| 1218 | }
|
---|
| 1219 | }
|
---|
| 1220 |
|
---|
| 1221 | if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
---|
| 1222 | if (hasDescriptors) {
|
---|
[79a0317] | 1223 | define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
|
---|
[d565449] | 1224 | } else {
|
---|
[79a0317] | 1225 | define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
---|
[d565449] | 1226 | }
|
---|
| 1227 | }
|
---|
| 1228 | return fn;
|
---|
| 1229 | };
|
---|
| 1230 |
|
---|
[79a0317] | 1231 | },{"define-data-property":12,"es-errors/type":21,"get-intrinsic":26,"gopd":28,"has-property-descriptors":29}],42:[function(require,module,exports){
|
---|
[d565449] | 1232 | 'use strict';
|
---|
| 1233 |
|
---|
| 1234 | var implementation = require('./implementation');
|
---|
| 1235 |
|
---|
| 1236 | var lacksProperEnumerationOrder = function () {
|
---|
| 1237 | if (!Object.assign) {
|
---|
| 1238 | return false;
|
---|
| 1239 | }
|
---|
| 1240 | /*
|
---|
| 1241 | * v8, specifically in node 4.x, has a bug with incorrect property enumeration order
|
---|
| 1242 | * note: this does not detect the bug unless there's 20 characters
|
---|
| 1243 | */
|
---|
| 1244 | var str = 'abcdefghijklmnopqrst';
|
---|
| 1245 | var letters = str.split('');
|
---|
| 1246 | var map = {};
|
---|
| 1247 | for (var i = 0; i < letters.length; ++i) {
|
---|
| 1248 | map[letters[i]] = letters[i];
|
---|
| 1249 | }
|
---|
| 1250 | var obj = Object.assign({}, map);
|
---|
| 1251 | var actual = '';
|
---|
| 1252 | for (var k in obj) {
|
---|
| 1253 | actual += k;
|
---|
| 1254 | }
|
---|
| 1255 | return str !== actual;
|
---|
| 1256 | };
|
---|
| 1257 |
|
---|
| 1258 | var assignHasPendingExceptions = function () {
|
---|
| 1259 | if (!Object.assign || !Object.preventExtensions) {
|
---|
| 1260 | return false;
|
---|
| 1261 | }
|
---|
| 1262 | /*
|
---|
| 1263 | * Firefox 37 still has "pending exception" logic in its Object.assign implementation,
|
---|
| 1264 | * which is 72% slower than our shim, and Firefox 40's native implementation.
|
---|
| 1265 | */
|
---|
| 1266 | var thrower = Object.preventExtensions({ 1: 2 });
|
---|
| 1267 | try {
|
---|
| 1268 | Object.assign(thrower, 'xy');
|
---|
| 1269 | } catch (e) {
|
---|
| 1270 | return thrower[1] === 'y';
|
---|
| 1271 | }
|
---|
| 1272 | return false;
|
---|
| 1273 | };
|
---|
| 1274 |
|
---|
| 1275 | module.exports = function getPolyfill() {
|
---|
| 1276 | if (!Object.assign) {
|
---|
| 1277 | return implementation;
|
---|
| 1278 | }
|
---|
| 1279 | if (lacksProperEnumerationOrder()) {
|
---|
| 1280 | return implementation;
|
---|
| 1281 | }
|
---|
| 1282 | if (assignHasPendingExceptions()) {
|
---|
| 1283 | return implementation;
|
---|
| 1284 | }
|
---|
| 1285 | return Object.assign;
|
---|
| 1286 | };
|
---|
| 1287 |
|
---|
[79a0317] | 1288 | },{"./implementation":2}],43:[function(require,module,exports){
|
---|
[d565449] | 1289 | 'use strict';
|
---|
| 1290 |
|
---|
| 1291 | var define = require('define-properties');
|
---|
| 1292 | var getPolyfill = require('./polyfill');
|
---|
| 1293 |
|
---|
| 1294 | module.exports = function shimAssign() {
|
---|
| 1295 | var polyfill = getPolyfill();
|
---|
| 1296 | define(
|
---|
| 1297 | Object,
|
---|
| 1298 | { assign: polyfill },
|
---|
| 1299 | { assign: function () { return Object.assign !== polyfill; } }
|
---|
| 1300 | );
|
---|
| 1301 | return polyfill;
|
---|
| 1302 | };
|
---|
| 1303 |
|
---|
[79a0317] | 1304 | },{"./polyfill":42,"define-properties":13}]},{},[1]);
|
---|