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