From 81c519dcdf50ceb95968387e14bc12281015a1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Thu, 12 Jan 2023 11:09:22 +0800 Subject: [PATCH] js: font style for input --- doric-js/bundle/doric-lib.es5.js | 8 +- doric-js/bundle/doric-lib.js | 40 +- doric-js/bundle/doric-sandbox.es5.js | 1732 ++++++++++++++---------- doric-js/bundle/doric-sandbox.js | 20 +- doric-js/bundle/doric-vm.js | 60 +- doric-js/index.d.ts | 3 +- doric-js/lib/index.web.d.ts | 4 +- doric-js/lib/src/pattern/mvvm.d.ts | 2 +- doric-js/lib/src/pattern/provider.d.ts | 4 +- doric-js/lib/src/runtime/global.d.ts | 2 +- doric-js/lib/src/runtime/sandbox.d.ts | 6 +- doric-js/lib/src/runtime/sandbox.js | 20 +- doric-js/lib/src/ui/animation.d.ts | 2 +- doric-js/lib/src/ui/view.d.ts | 8 +- doric-js/lib/src/ui/view.js | 36 +- doric-js/lib/src/util/flexbox.d.ts | 2 +- doric-js/lib/src/util/types.d.ts | 8 +- doric-js/lib/src/widget/input.d.ts | 1 + doric-js/lib/src/widget/input.js | 4 + doric-js/src/widget/input.ts | 3 + 20 files changed, 1129 insertions(+), 836 deletions(-) diff --git a/doric-js/bundle/doric-lib.es5.js b/doric-js/bundle/doric-lib.es5.js index bfb3a23a..b3f501d0 100644 --- a/doric-js/bundle/doric-lib.es5.js +++ b/doric-js/bundle/doric-lib.es5.js @@ -3412,6 +3412,10 @@ var Input = /** @class */ (function (_super) { Property, __metadata$6("design:type", Gravity) ], Input.prototype, "textAlignment", void 0); + __decorate$6([ + Property, + __metadata$6("design:type", String) + ], Input.prototype, "fontStyle", void 0); __decorate$6([ Property, __metadata$6("design:type", Function) @@ -4356,7 +4360,7 @@ var __generator$1 = (undefined && undefined.__generator) || function (thisArg, b function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) { throw new TypeError("Generator is already executing."); } - while (_) { try { + while (g && (g = 0, op[0] && (_ = 0)), _) { try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) { return t; } if (y = 0, t) { op = [op[0] & 2, t.value]; } switch (op[0]) { @@ -4585,7 +4589,7 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) { throw new TypeError("Generator is already executing."); } - while (_) { try { + while (g && (g = 0, op[0] && (_ = 0)), _) { try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) { return t; } if (y = 0, t) { op = [op[0] & 2, t.value]; } switch (op[0]) { diff --git a/doric-js/bundle/doric-lib.js b/doric-js/bundle/doric-lib.js index 496c922b..7f0641dd 100644 --- a/doric-js/bundle/doric-lib.js +++ b/doric-js/bundle/doric-lib.js @@ -161,6 +161,24 @@ function createRef() { return new Ref; } class View { + callback2Id(f) { + const id = uniqueId('Function'); + this.callbacks.set(id, f); + return id; + } + id2Callback(id) { + let f = this.callbacks.get(id); + if (f === undefined) { + f = Reflect.get(this, id); + } + return f; + } + findViewByTag(tag) { + if (tag === this.tag) { + return this; + } + return undefined; + } constructor() { this.width = 0; this.height = 0; @@ -192,24 +210,6 @@ class View { } }); } - callback2Id(f) { - const id = uniqueId('Function'); - this.callbacks.set(id, f); - return id; - } - id2Callback(id) { - let f = this.callbacks.get(id); - if (f === undefined) { - f = Reflect.get(this, id); - } - return f; - } - findViewByTag(tag) { - if (tag === this.tag) { - return this; - } - return undefined; - } /** Anchor start*/ get left() { return this.x; @@ -2628,6 +2628,10 @@ __decorate$6([ Property, __metadata$6("design:type", Gravity) ], Input.prototype, "textAlignment", void 0); +__decorate$6([ + Property, + __metadata$6("design:type", String) +], Input.prototype, "fontStyle", void 0); __decorate$6([ Property, __metadata$6("design:type", Function) diff --git a/doric-js/bundle/doric-sandbox.es5.js b/doric-js/bundle/doric-sandbox.es5.js index f402cdc4..453d6823 100644 --- a/doric-js/bundle/doric-sandbox.es5.js +++ b/doric-js/bundle/doric-sandbox.es5.js @@ -23,7 +23,7 @@ var doric = (function (exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global_1 = - // eslint-disable-next-line es-x/no-global-this -- safe + // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe @@ -42,12 +42,12 @@ var doric = (function (exports) { // Detect IE8's incomplete defineProperty implementation var descriptors = !fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); var functionBindNative = !fails(function () { - // eslint-disable-next-line es-x/no-function-prototype-bind -- safe + // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); @@ -60,16 +60,16 @@ var doric = (function (exports) { }; var $propertyIsEnumerable$2 = {}.propertyIsEnumerable; - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - var getOwnPropertyDescriptor$a = Object.getOwnPropertyDescriptor; + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + var getOwnPropertyDescriptor$b = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug - var NASHORN_BUG = getOwnPropertyDescriptor$a && !$propertyIsEnumerable$2.call({ 1: 2 }, 1); + var NASHORN_BUG = getOwnPropertyDescriptor$b && !$propertyIsEnumerable$2.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable var f$8 = NASHORN_BUG ? function propertyIsEnumerable(V) { - var descriptor = getOwnPropertyDescriptor$a(this, V); + var descriptor = getOwnPropertyDescriptor$b(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable$2; @@ -87,14 +87,11 @@ var doric = (function (exports) { }; var FunctionPrototype$4 = Function.prototype; - var bind$2 = FunctionPrototype$4.bind; var call$1 = FunctionPrototype$4.call; - var uncurryThis = functionBindNative && bind$2.bind(call$1, call$1); + var uncurryThisWithBind = functionBindNative && FunctionPrototype$4.bind.bind(call$1, call$1); - var functionUncurryThis = functionBindNative ? function (fn) { - return fn && uncurryThis(fn); - } : function (fn) { - return fn && function () { + var functionUncurryThis = functionBindNative ? uncurryThisWithBind : function (fn) { + return function () { return call$1.apply(fn, arguments); }; }; @@ -118,12 +115,18 @@ var doric = (function (exports) { return classofRaw(it) == 'String' ? split$3(it, '') : $Object$6(it); } : $Object$6; - var $TypeError$z = TypeError; + // we can't use just `it == null` since of `document.all` special case + // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec + var isNullOrUndefined = function (it) { + return it === null || it === undefined; + }; + + var $TypeError$A = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible = function (it) { - if (it == undefined) { throw $TypeError$z("Can't call method on " + it); } + if (isNullOrUndefined(it)) { throw $TypeError$A("Can't call method on " + it); } return it; }; @@ -135,13 +138,31 @@ var doric = (function (exports) { return indexedObject(requireObjectCoercible(it)); }; + var documentAll$2 = typeof document == 'object' && document.all; + + // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot + var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined; + + var documentAll_1 = { + all: documentAll$2, + IS_HTMLDDA: IS_HTMLDDA + }; + + var documentAll$1 = documentAll_1.all; + // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable - var isCallable = function (argument) { + var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) { + return typeof argument == 'function' || argument === documentAll$1; + } : function (argument) { return typeof argument == 'function'; }; - var isObject = function (it) { + var documentAll = documentAll_1.all; + + var isObject = documentAll_1.IS_HTMLDDA ? function (it) { + return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll; + } : function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; @@ -182,12 +203,12 @@ var doric = (function (exports) { var engineV8Version = version; - /* eslint-disable es-x/no-symbol -- required for testing */ + /* eslint-disable es/no-symbol -- required for testing */ - // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing - var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () { + // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing + var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances @@ -196,10 +217,10 @@ var doric = (function (exports) { !Symbol.sham && engineV8Version && engineV8Version < 41; }); - /* eslint-disable es-x/no-symbol -- required for testing */ + /* eslint-disable es/no-symbol -- required for testing */ - var useSymbolAsUid = nativeSymbol + var useSymbolAsUid = symbolConstructorDetection && !Symbol.sham && typeof Symbol.iterator == 'symbol'; @@ -222,22 +243,22 @@ var doric = (function (exports) { } }; - var $TypeError$y = TypeError; + var $TypeError$z = TypeError; // `Assert: IsCallable(argument) is true` var aCallable = function (argument) { if (isCallable(argument)) { return argument; } - throw $TypeError$y(tryToString(argument) + ' is not a function'); + throw $TypeError$z(tryToString(argument) + ' is not a function'); }; // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod var getMethod = function (V, P) { var func = V[P]; - return func == null ? undefined : aCallable(func); + return isNullOrUndefined(func) ? undefined : aCallable(func); }; - var $TypeError$x = TypeError; + var $TypeError$y = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive @@ -246,17 +267,17 @@ var doric = (function (exports) { if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) { return val; } if (isCallable(fn = input.valueOf) && !isObject(val = functionCall(fn, input))) { return val; } if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = functionCall(fn, input))) { return val; } - throw $TypeError$x("Can't convert object to primitive value"); + throw $TypeError$y("Can't convert object to primitive value"); }; var isPure = false; - // eslint-disable-next-line es-x/no-object-defineproperty -- safe - var defineProperty$f = Object.defineProperty; + // eslint-disable-next-line es/no-object-defineproperty -- safe + var defineProperty$g = Object.defineProperty; var defineGlobalProperty = function (key, value) { try { - defineProperty$f(global_1, key, { value: value, configurable: true, writable: true }); + defineProperty$g(global_1, key, { value: value, configurable: true, writable: true }); } catch (error) { global_1[key] = value; } return value; @@ -271,10 +292,10 @@ var doric = (function (exports) { (module.exports = function (key, value) { return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {}); })('versions', []).push({ - version: '3.24.1', + version: '3.26.1', mode: 'global', copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE', + license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE', source: 'https://github.com/zloirock/core-js' }); }); @@ -291,7 +312,7 @@ var doric = (function (exports) { // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty - // eslint-disable-next-line es-x/no-object-hasown -- safe + // eslint-disable-next-line es/no-object-hasown -- safe var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; @@ -310,9 +331,9 @@ var doric = (function (exports) { var createWellKnownSymbol = useSymbolAsUid ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid; var wellKnownSymbol = function (name) { - if (!hasOwnProperty_1(WellKnownSymbolsStore$1, name) || !(nativeSymbol || typeof WellKnownSymbolsStore$1[name] == 'string')) { + if (!hasOwnProperty_1(WellKnownSymbolsStore$1, name) || !(symbolConstructorDetection || typeof WellKnownSymbolsStore$1[name] == 'string')) { var description = 'Symbol.' + name; - if (nativeSymbol && hasOwnProperty_1(Symbol$3, name)) { + if (symbolConstructorDetection && hasOwnProperty_1(Symbol$3, name)) { WellKnownSymbolsStore$1[name] = Symbol$3[name]; } else if (useSymbolAsUid && symbolFor) { WellKnownSymbolsStore$1[name] = symbolFor(description); @@ -322,7 +343,7 @@ var doric = (function (exports) { } return WellKnownSymbolsStore$1[name]; }; - var $TypeError$w = TypeError; + var $TypeError$x = TypeError; var TO_PRIMITIVE$1 = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation @@ -335,7 +356,7 @@ var doric = (function (exports) { if (pref === undefined) { pref = 'default'; } result = functionCall(exoticToPrim, input, pref); if (!isObject(result) || isSymbol(result)) { return result; } - throw $TypeError$w("Can't convert object to primitive value"); + throw $TypeError$x("Can't convert object to primitive value"); } if (pref === undefined) { pref = 'number'; } return ordinaryToPrimitive(input, pref); @@ -358,13 +379,13 @@ var doric = (function (exports) { // Thanks to IE8 for its funny defineProperty var ie8DomDefine = !descriptors && !fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(documentCreateElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method @@ -385,7 +406,7 @@ var doric = (function (exports) { // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 var v8PrototypeDefineBug = descriptors && fails(function () { - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing + // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false @@ -393,18 +414,18 @@ var doric = (function (exports) { }); var $String$4 = String; - var $TypeError$v = TypeError; + var $TypeError$w = TypeError; // `Assert: Type(argument) is Object` var anObject = function (argument) { if (isObject(argument)) { return argument; } - throw $TypeError$v($String$4(argument) + ' is not an object'); + throw $TypeError$w($String$4(argument) + ' is not an object'); }; - var $TypeError$u = TypeError; - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + var $TypeError$v = TypeError; + // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty$1 = Object.defineProperty; - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE$1 = 'configurable'; @@ -434,7 +455,7 @@ var doric = (function (exports) { if (ie8DomDefine) { try { return $defineProperty$1(O, P, Attributes); } catch (error) { /* empty */ } } - if ('get' in Attributes || 'set' in Attributes) { throw $TypeError$u('Accessors not supported'); } + if ('get' in Attributes || 'set' in Attributes) { throw $TypeError$v('Accessors not supported'); } if ('value' in Attributes) { O[P] = Attributes.value; } return O; }; @@ -451,7 +472,7 @@ var doric = (function (exports) { }; var FunctionPrototype$3 = Function.prototype; - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = descriptors && Object.getOwnPropertyDescriptor; var EXISTS = hasOwnProperty_1(FunctionPrototype$3, 'name'); @@ -478,7 +499,7 @@ var doric = (function (exports) { var WeakMap$4 = global_1.WeakMap; - var nativeWeakMap = isCallable(WeakMap$4) && /native code/.test(inspectSource(WeakMap$4)); + var weakMapBasicDetection = isCallable(WeakMap$4) && /native code/.test(String(WeakMap$4)); var keys$3 = shared('keys'); @@ -506,28 +527,30 @@ var doric = (function (exports) { }; }; - if (nativeWeakMap || sharedStore.state) { + if (weakMapBasicDetection || sharedStore.state) { var store$2 = sharedStore.state || (sharedStore.state = new WeakMap$3()); - var wmget = functionUncurryThis(store$2.get); - var wmhas = functionUncurryThis(store$2.has); - var wmset = functionUncurryThis(store$2.set); + /* eslint-disable no-self-assign -- prototype methods protection */ + store$2.get = store$2.get; + store$2.has = store$2.has; + store$2.set = store$2.set; + /* eslint-enable no-self-assign -- prototype methods protection */ set$3 = function (it, metadata) { - if (wmhas(store$2, it)) { throw new TypeError$8(OBJECT_ALREADY_INITIALIZED); } + if (store$2.has(it)) { throw TypeError$8(OBJECT_ALREADY_INITIALIZED); } metadata.facade = it; - wmset(store$2, it, metadata); + store$2.set(it, metadata); return metadata; }; get$2 = function (it) { - return wmget(store$2, it) || {}; + return store$2.get(it) || {}; }; has = function (it) { - return wmhas(store$2, it); + return store$2.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys$1[STATE] = true; set$3 = function (it, metadata) { - if (hasOwnProperty_1(it, STATE)) { throw new TypeError$8(OBJECT_ALREADY_INITIALIZED); } + if (hasOwnProperty_1(it, STATE)) { throw TypeError$8(OBJECT_ALREADY_INITIALIZED); } metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; @@ -555,7 +578,7 @@ var doric = (function (exports) { var enforceInternalState = internalState.enforce; var getInternalState = internalState.get; - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; var CONFIGURABLE_LENGTH = descriptors && !fails(function () { @@ -624,7 +647,7 @@ var doric = (function (exports) { // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc - // eslint-disable-next-line es-x/no-math-trunc -- safe + // eslint-disable-next-line es/no-math-trunc -- safe var mathTrunc = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor$a : ceil$1)(n); @@ -725,7 +748,7 @@ var doric = (function (exports) { // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames - // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe + // eslint-disable-next-line es/no-object-getownpropertynames -- safe var f$5 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return objectKeysInternal(O, hiddenKeys); }; @@ -734,7 +757,7 @@ var doric = (function (exports) { f: f$5 }; - // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe + // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe var f$4 = Object.getOwnPropertySymbols; var objectGetOwnPropertySymbols = { @@ -782,7 +805,7 @@ var doric = (function (exports) { var isForced_1 = isForced; - var getOwnPropertyDescriptor$9 = objectGetOwnPropertyDescriptor.f; + var getOwnPropertyDescriptor$a = objectGetOwnPropertyDescriptor.f; @@ -819,7 +842,7 @@ var doric = (function (exports) { if (target) { for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { - descriptor = getOwnPropertyDescriptor$9(target, key); + descriptor = getOwnPropertyDescriptor$a(target, key); targetProperty = descriptor && descriptor.value; } else { targetProperty = target[key]; } FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); @@ -877,14 +900,14 @@ var doric = (function (exports) { // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys - // eslint-disable-next-line es-x/no-object-keys -- safe + // eslint-disable-next-line es/no-object-keys -- safe var objectKeys$1 = Object.keys || function keys(O) { return objectKeysInternal(O, enumBugKeys); }; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties - // eslint-disable-next-line es-x/no-object-defineproperties -- safe + // eslint-disable-next-line es/no-object-defineproperties -- safe var f$3 = descriptors && !v8PrototypeDefineBug ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); @@ -973,7 +996,7 @@ var doric = (function (exports) { // `Object.create` method // https://tc39.es/ecma262/#sec-object.create - // eslint-disable-next-line es-x/no-object-create -- safe + // eslint-disable-next-line es/no-object-create -- safe var objectCreate = Object.create || function create(O, Properties) { var result; if (O !== null) { @@ -992,20 +1015,20 @@ var doric = (function (exports) { else { object[propertyKey] = value; } }; - var $Array$a = Array; + var $Array$b = Array; var max$8 = Math.max; var arraySliceSimple = function (O, start, end) { var length = lengthOfArrayLike(O); var k = toAbsoluteIndex(start, length); var fin = toAbsoluteIndex(end === undefined ? length : end, length); - var result = $Array$a(max$8(fin - k, 0)); + var result = $Array$b(max$8(fin - k, 0)); for (var n = 0; k < fin; k++, n++) { createProperty(result, n, O[k]); } result.length = n; return result; }; - /* eslint-disable es-x/no-object-getownpropertynames -- safe */ + /* eslint-disable es/no-object-getownpropertynames -- safe */ var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; @@ -1041,11 +1064,11 @@ var doric = (function (exports) { var path = global_1; - var defineProperty$e = objectDefineProperty.f; + var defineProperty$f = objectDefineProperty.f; - var defineWellKnownSymbol = function (NAME) { + var wellKnownSymbolDefine = function (NAME) { var Symbol = path.Symbol || (path.Symbol = {}); - if (!hasOwnProperty_1(Symbol, NAME)) { defineProperty$e(Symbol, NAME, { + if (!hasOwnProperty_1(Symbol, NAME)) { defineProperty$f(Symbol, NAME, { value: wellKnownSymbolWrapped.f(NAME) }); } }; @@ -1066,7 +1089,7 @@ var doric = (function (exports) { } }; - var defineProperty$d = objectDefineProperty.f; + var defineProperty$e = objectDefineProperty.f; @@ -1075,11 +1098,18 @@ var doric = (function (exports) { var setToStringTag = function (target, TAG, STATIC) { if (target && !STATIC) { target = target.prototype; } if (target && !hasOwnProperty_1(target, TO_STRING_TAG$7)) { - defineProperty$d(target, TO_STRING_TAG$7, { configurable: true, value: TAG }); + defineProperty$e(target, TO_STRING_TAG$7, { configurable: true, value: TAG }); } }; - var bind$1 = functionUncurryThis(functionUncurryThis.bind); + var functionUncurryThisClause = function (fn) { + // Nashorn bug: + // https://github.com/zloirock/core-js/issues/1128 + // https://github.com/zloirock/core-js/issues/1130 + if (classofRaw(fn) === 'Function') { return functionUncurryThis(fn); } + }; + + var bind$1 = functionUncurryThisClause(functionUncurryThisClause.bind); // optional / simple context binding var functionBindContext = function (fn, that) { @@ -1091,7 +1121,7 @@ var doric = (function (exports) { // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray - // eslint-disable-next-line es-x/no-array-isarray -- safe + // eslint-disable-next-line es/no-array-isarray -- safe var isArray = Array.isArray || function isArray(argument) { return classofRaw(argument) == 'Array'; }; @@ -1143,7 +1173,7 @@ var doric = (function (exports) { }) ? isConstructorLegacy : isConstructorModern; var SPECIES$6 = wellKnownSymbol('species'); - var $Array$9 = Array; + var $Array$a = Array; // a part of `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate @@ -1152,12 +1182,12 @@ var doric = (function (exports) { if (isArray(originalArray)) { C = originalArray.constructor; // cross-realm fallback - if (isConstructor(C) && (C === $Array$9 || isArray(C.prototype))) { C = undefined; } + if (isConstructor(C) && (C === $Array$a || isArray(C.prototype))) { C = undefined; } else if (isObject(C)) { C = C[SPECIES$6]; if (C === null) { C = undefined; } } - } return C === undefined ? $Array$9 : C; + } return C === undefined ? $Array$a : C; }; // `ArraySpeciesCreate` abstract operation @@ -1242,7 +1272,7 @@ var doric = (function (exports) { var setInternalState$i = internalState.set; var getInternalState$e = internalState.getterFor(SYMBOL); - var ObjectPrototype$4 = Object[PROTOTYPE$1]; + var ObjectPrototype$5 = Object[PROTOTYPE$1]; var $Symbol = global_1.Symbol; var SymbolPrototype$1 = $Symbol && $Symbol[PROTOTYPE$1]; var TypeError$7 = global_1.TypeError; @@ -1266,11 +1296,11 @@ var doric = (function (exports) { get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (O, P, Attributes) { - var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$4, P); - if (ObjectPrototypeDescriptor) { delete ObjectPrototype$4[P]; } + var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$5, P); + if (ObjectPrototypeDescriptor) { delete ObjectPrototype$5[P]; } nativeDefineProperty(O, P, Attributes); - if (ObjectPrototypeDescriptor && O !== ObjectPrototype$4) { - nativeDefineProperty(ObjectPrototype$4, P, ObjectPrototypeDescriptor); + if (ObjectPrototypeDescriptor && O !== ObjectPrototype$5) { + nativeDefineProperty(ObjectPrototype$5, P, ObjectPrototypeDescriptor); } } : nativeDefineProperty; @@ -1286,7 +1316,7 @@ var doric = (function (exports) { }; var $defineProperty = function defineProperty(O, P, Attributes) { - if (O === ObjectPrototype$4) { $defineProperty(ObjectPrototypeSymbols, P, Attributes); } + if (O === ObjectPrototype$5) { $defineProperty(ObjectPrototypeSymbols, P, Attributes); } anObject(O); var key = toPropertyKey(P); anObject(Attributes); @@ -1318,7 +1348,7 @@ var doric = (function (exports) { var $propertyIsEnumerable$1 = function propertyIsEnumerable(V) { var P = toPropertyKey(V); var enumerable = functionCall(nativePropertyIsEnumerable, this, P); - if (this === ObjectPrototype$4 && hasOwnProperty_1(AllSymbols, P) && !hasOwnProperty_1(ObjectPrototypeSymbols, P)) { return false; } + if (this === ObjectPrototype$5 && hasOwnProperty_1(AllSymbols, P) && !hasOwnProperty_1(ObjectPrototypeSymbols, P)) { return false; } return enumerable || !hasOwnProperty_1(this, P) || !hasOwnProperty_1(AllSymbols, P) || hasOwnProperty_1(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; }; @@ -1326,7 +1356,7 @@ var doric = (function (exports) { var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject(O); var key = toPropertyKey(P); - if (it === ObjectPrototype$4 && hasOwnProperty_1(AllSymbols, key) && !hasOwnProperty_1(ObjectPrototypeSymbols, key)) { return; } + if (it === ObjectPrototype$5 && hasOwnProperty_1(AllSymbols, key) && !hasOwnProperty_1(ObjectPrototypeSymbols, key)) { return; } var descriptor = nativeGetOwnPropertyDescriptor$1(it, key); if (descriptor && hasOwnProperty_1(AllSymbols, key) && !(hasOwnProperty_1(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true; @@ -1344,11 +1374,11 @@ var doric = (function (exports) { }; var $getOwnPropertySymbols = function (O) { - var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$4; + var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$5; var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); var result = []; $forEach$3(names, function (key) { - if (hasOwnProperty_1(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwnProperty_1(ObjectPrototype$4, key))) { + if (hasOwnProperty_1(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwnProperty_1(ObjectPrototype$5, key))) { push$k(result, AllSymbols[key]); } }); @@ -1357,17 +1387,17 @@ var doric = (function (exports) { // `Symbol` constructor // https://tc39.es/ecma262/#sec-symbol-constructor - if (!nativeSymbol) { + if (!symbolConstructorDetection) { $Symbol = function Symbol() { if (objectIsPrototypeOf(SymbolPrototype$1, this)) { throw TypeError$7('Symbol is not a constructor'); } var description = !arguments.length || arguments[0] === undefined ? undefined : toString_1(arguments[0]); var tag = uid(description); var setter = function (value) { - if (this === ObjectPrototype$4) { functionCall(setter, ObjectPrototypeSymbols, value); } + if (this === ObjectPrototype$5) { functionCall(setter, ObjectPrototypeSymbols, value); } if (hasOwnProperty_1(this, HIDDEN) && hasOwnProperty_1(this[HIDDEN], tag)) { this[HIDDEN][tag] = false; } setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); }; - if (descriptors && USE_SETTER) { setSymbolDescriptor(ObjectPrototype$4, tag, { configurable: true, set: setter }); } + if (descriptors && USE_SETTER) { setSymbolDescriptor(ObjectPrototype$5, tag, { configurable: true, set: setter }); } return wrap$1(tag, description); }; @@ -1401,25 +1431,25 @@ var doric = (function (exports) { } }); { - defineBuiltIn(ObjectPrototype$4, 'propertyIsEnumerable', $propertyIsEnumerable$1, { unsafe: true }); + defineBuiltIn(ObjectPrototype$5, 'propertyIsEnumerable', $propertyIsEnumerable$1, { unsafe: true }); } } } - _export({ global: true, constructor: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, { + _export({ global: true, constructor: true, wrap: true, forced: !symbolConstructorDetection, sham: !symbolConstructorDetection }, { Symbol: $Symbol }); $forEach$3(objectKeys$1(WellKnownSymbolsStore), function (name) { - defineWellKnownSymbol(name); + wellKnownSymbolDefine(name); }); - _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, { + _export({ target: SYMBOL, stat: true, forced: !symbolConstructorDetection }, { useSetter: function () { USE_SETTER = true; }, useSimple: function () { USE_SETTER = false; } }); - _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, { + _export({ target: 'Object', stat: true, forced: !symbolConstructorDetection, sham: !descriptors }, { // `Object.create` method // https://tc39.es/ecma262/#sec-object.create create: $create, @@ -1434,7 +1464,7 @@ var doric = (function (exports) { getOwnPropertyDescriptor: $getOwnPropertyDescriptor }); - _export({ target: 'Object', stat: true, forced: !nativeSymbol }, { + _export({ target: 'Object', stat: true, forced: !symbolConstructorDetection }, { // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames @@ -1450,15 +1480,15 @@ var doric = (function (exports) { hiddenKeys$1[HIDDEN] = true; - /* eslint-disable es-x/no-symbol -- safe */ - var nativeSymbolRegistry = nativeSymbol && !!Symbol['for'] && !!Symbol.keyFor; + /* eslint-disable es/no-symbol -- safe */ + var symbolRegistryDetection = symbolConstructorDetection && !!Symbol['for'] && !!Symbol.keyFor; var StringToSymbolRegistry = shared('string-to-symbol-registry'); var SymbolToStringRegistry$1 = shared('symbol-to-string-registry'); // `Symbol.for` method // https://tc39.es/ecma262/#sec-symbol.for - _export({ target: 'Symbol', stat: true, forced: !nativeSymbolRegistry }, { + _export({ target: 'Symbol', stat: true, forced: !symbolRegistryDetection }, { 'for': function (key) { var string = toString_1(key); if (hasOwnProperty_1(StringToSymbolRegistry, string)) { return StringToSymbolRegistry[string]; } @@ -1473,7 +1503,7 @@ var doric = (function (exports) { // `Symbol.keyFor` method // https://tc39.es/ecma262/#sec-symbol.keyfor - _export({ target: 'Symbol', stat: true, forced: !nativeSymbolRegistry }, { + _export({ target: 'Symbol', stat: true, forced: !symbolRegistryDetection }, { keyFor: function keyFor(sym) { if (!isSymbol(sym)) { throw TypeError(tryToString(sym) + ' is not a symbol'); } if (hasOwnProperty_1(SymbolToStringRegistry, sym)) { return SymbolToStringRegistry[sym]; } @@ -1484,7 +1514,7 @@ var doric = (function (exports) { var apply = FunctionPrototype$2.apply; var call = FunctionPrototype$2.call; - // eslint-disable-next-line es-x/no-reflect -- safe + // eslint-disable-next-line es/no-reflect -- safe var functionApply = typeof Reflect == 'object' && Reflect.apply || (functionBindNative ? call.bind(apply) : function () { return call.apply(apply, arguments); }); @@ -1493,8 +1523,8 @@ var doric = (function (exports) { var $stringify = getBuiltIn('JSON', 'stringify'); var exec$a = functionUncurryThis(/./.exec); - var charAt$h = functionUncurryThis(''.charAt); - var charCodeAt$5 = functionUncurryThis(''.charCodeAt); + var charAt$i = functionUncurryThis(''.charAt); + var charCodeAt$7 = functionUncurryThis(''.charCodeAt); var replace$b = functionUncurryThis(''.replace); var numberToString$3 = functionUncurryThis(1.0.toString); @@ -1502,7 +1532,7 @@ var doric = (function (exports) { var low = /^[\uD800-\uDBFF]$/; var hi = /^[\uDC00-\uDFFF]$/; - var WRONG_SYMBOLS_CONVERSION = !nativeSymbol || fails(function () { + var WRONG_SYMBOLS_CONVERSION = !symbolConstructorDetection || fails(function () { var symbol = getBuiltIn('Symbol')(); // MS Edge converts symbol values to JSON as {} return $stringify([symbol]) != '[null]' @@ -1531,10 +1561,10 @@ var doric = (function (exports) { }; var fixIllFormed = function (match, offset, string) { - var prev = charAt$h(string, offset - 1); - var next = charAt$h(string, offset + 1); + var prev = charAt$i(string, offset - 1); + var next = charAt$i(string, offset + 1); if ((exec$a(low, match) && !exec$a(hi, next)) || (exec$a(hi, match) && !exec$a(low, prev))) { - return '\\u' + numberToString$3(charCodeAt$5(match, 0), 16); + return '\\u' + numberToString$3(charCodeAt$7(match, 0), 16); } return match; }; @@ -1553,7 +1583,7 @@ var doric = (function (exports) { // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 - var FORCED$n = !nativeSymbol || fails(function () { objectGetOwnPropertySymbols.f(1); }); + var FORCED$n = !symbolConstructorDetection || fails(function () { objectGetOwnPropertySymbols.f(1); }); // `Object.getOwnPropertySymbols` method // https://tc39.es/ecma262/#sec-object.getownpropertysymbols @@ -1564,7 +1594,7 @@ var doric = (function (exports) { } }); - var defineProperty$c = objectDefineProperty.f; + var defineProperty$d = objectDefineProperty.f; var NativeSymbol = global_1.Symbol; @@ -1591,18 +1621,18 @@ var doric = (function (exports) { SymbolPrototype.constructor = SymbolWrapper; var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)'; - var symbolToString = functionUncurryThis(SymbolPrototype.toString); - var symbolValueOf = functionUncurryThis(SymbolPrototype.valueOf); + var thisSymbolValue = functionUncurryThis(SymbolPrototype.valueOf); + var symbolDescriptiveString = functionUncurryThis(SymbolPrototype.toString); var regexp = /^Symbol\((.*)\)[^)]+$/; var replace$a = functionUncurryThis(''.replace); var stringSlice$g = functionUncurryThis(''.slice); - defineProperty$c(SymbolPrototype, 'description', { + defineProperty$d(SymbolPrototype, 'description', { configurable: true, get: function description() { - var symbol = symbolValueOf(this); - var string = symbolToString(symbol); + var symbol = thisSymbolValue(this); if (hasOwnProperty_1(EmptyStringDescriptionStore, symbol)) { return ''; } + var string = symbolDescriptiveString(symbol); var desc = NATIVE_SYMBOL ? stringSlice$g(string, 7, -1) : replace$a(string, regexp, '$1'); return desc === '' ? undefined : desc; } @@ -1615,47 +1645,47 @@ var doric = (function (exports) { // `Symbol.asyncIterator` well-known symbol // https://tc39.es/ecma262/#sec-symbol.asynciterator - defineWellKnownSymbol('asyncIterator'); + wellKnownSymbolDefine('asyncIterator'); // `Symbol.hasInstance` well-known symbol // https://tc39.es/ecma262/#sec-symbol.hasinstance - defineWellKnownSymbol('hasInstance'); + wellKnownSymbolDefine('hasInstance'); // `Symbol.isConcatSpreadable` well-known symbol // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable - defineWellKnownSymbol('isConcatSpreadable'); + wellKnownSymbolDefine('isConcatSpreadable'); // `Symbol.iterator` well-known symbol // https://tc39.es/ecma262/#sec-symbol.iterator - defineWellKnownSymbol('iterator'); + wellKnownSymbolDefine('iterator'); // `Symbol.match` well-known symbol // https://tc39.es/ecma262/#sec-symbol.match - defineWellKnownSymbol('match'); + wellKnownSymbolDefine('match'); // `Symbol.matchAll` well-known symbol // https://tc39.es/ecma262/#sec-symbol.matchall - defineWellKnownSymbol('matchAll'); + wellKnownSymbolDefine('matchAll'); // `Symbol.replace` well-known symbol // https://tc39.es/ecma262/#sec-symbol.replace - defineWellKnownSymbol('replace'); + wellKnownSymbolDefine('replace'); // `Symbol.search` well-known symbol // https://tc39.es/ecma262/#sec-symbol.search - defineWellKnownSymbol('search'); + wellKnownSymbolDefine('search'); // `Symbol.species` well-known symbol // https://tc39.es/ecma262/#sec-symbol.species - defineWellKnownSymbol('species'); + wellKnownSymbolDefine('species'); // `Symbol.split` well-known symbol // https://tc39.es/ecma262/#sec-symbol.split - defineWellKnownSymbol('split'); + wellKnownSymbolDefine('split'); // `Symbol.toPrimitive` well-known symbol // https://tc39.es/ecma262/#sec-symbol.toprimitive - defineWellKnownSymbol('toPrimitive'); + wellKnownSymbolDefine('toPrimitive'); // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive @@ -1663,7 +1693,7 @@ var doric = (function (exports) { // `Symbol.toStringTag` well-known symbol // https://tc39.es/ecma262/#sec-symbol.tostringtag - defineWellKnownSymbol('toStringTag'); + wellKnownSymbolDefine('toStringTag'); // `Symbol.prototype[@@toStringTag]` property // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag @@ -1671,14 +1701,14 @@ var doric = (function (exports) { // `Symbol.unscopables` well-known symbol // https://tc39.es/ecma262/#sec-symbol.unscopables - defineWellKnownSymbol('unscopables'); + wellKnownSymbolDefine('unscopables'); var $String$2 = String; - var $TypeError$t = TypeError; + var $TypeError$u = TypeError; var aPossiblePrototype = function (argument) { if (typeof argument == 'object' || isCallable(argument)) { return argument; } - throw $TypeError$t("Can't set " + $String$2(argument) + ' as a prototype'); + throw $TypeError$u("Can't set " + $String$2(argument) + ' as a prototype'); }; /* eslint-disable no-proto -- safe */ @@ -1689,13 +1719,13 @@ var doric = (function (exports) { // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. - // eslint-disable-next-line es-x/no-object-setprototypeof -- safe + // eslint-disable-next-line es/no-object-setprototypeof -- safe var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe setter = functionUncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set); setter(test, []); CORRECT_SETTER = test instanceof Array; @@ -1709,10 +1739,10 @@ var doric = (function (exports) { }; }() : undefined); - var defineProperty$b = objectDefineProperty.f; + var defineProperty$c = objectDefineProperty.f; var proxyAccessor = function (Target, Source, key) { - key in Target || defineProperty$b(Target, key, { + key in Target || defineProperty$c(Target, key, { configurable: true, get: function () { return Source[key]; }, set: function (it) { Source[key] = it; } @@ -1753,7 +1783,7 @@ var doric = (function (exports) { var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); - var clearErrorStack = function (stack, dropEntries) { + var errorStackClear = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error$1.prepareStackTrace) { while (dropEntries--) { stack = replace$9(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } } return stack; @@ -1762,7 +1792,7 @@ var doric = (function (exports) { var errorStackInstallable = !fails(function () { var error = Error('a'); if (!('stack' in error)) { return true; } - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7)); return error.stack !== 7; }); @@ -1789,7 +1819,7 @@ var doric = (function (exports) { var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined); var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError(); if (message !== undefined) { createNonEnumerableProperty(result, 'message', message); } - if (errorStackInstallable) { createNonEnumerableProperty(result, 'stack', clearErrorStack(result.stack, 2)); } + if (errorStackInstallable) { createNonEnumerableProperty(result, 'stack', errorStackClear(result.stack, 2)); } if (this && objectIsPrototypeOf(OriginalErrorPrototype, this)) { inheritIfRequired(result, this, WrappedError); } if (arguments.length > OPTIONS_POSITION) { installErrorCause(result, arguments[OPTIONS_POSITION]); } return result; @@ -1880,7 +1910,7 @@ var doric = (function (exports) { var INCORRECT_TO_STRING$1 = fails(function () { if (descriptors) { // Chrome 32- incorrectly call accessor - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe var object = objectCreate(Object.defineProperty({}, 'name', { get: function () { return this === object; } })); @@ -1910,24 +1940,24 @@ var doric = (function (exports) { var correctPrototypeGetter = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; - // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing + // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); var IE_PROTO = sharedKey('IE_PROTO'); var $Object$2 = Object; - var ObjectPrototype$3 = $Object$2.prototype; + var ObjectPrototype$4 = $Object$2.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof - // eslint-disable-next-line es-x/no-object-getprototypeof -- safe + // eslint-disable-next-line es/no-object-getprototypeof -- safe var objectGetPrototypeOf = correctPrototypeGetter ? $Object$2.getPrototypeOf : function (O) { var object = toObject(O); if (hasOwnProperty_1(object, IE_PROTO)) { return object[IE_PROTO]; } var constructor = object.constructor; if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype; - } return object instanceof $Object$2 ? ObjectPrototype$3 : null; + } return object instanceof $Object$2 ? ObjectPrototype$4 : null; }; var iterators = {}; @@ -1943,17 +1973,17 @@ var doric = (function (exports) { var ITERATOR$9 = wellKnownSymbol('iterator'); var getIteratorMethod = function (it) { - if (it != undefined) { return getMethod(it, ITERATOR$9) + if (!isNullOrUndefined(it)) { return getMethod(it, ITERATOR$9) || getMethod(it, '@@iterator') || iterators[classof(it)]; } }; - var $TypeError$s = TypeError; + var $TypeError$t = TypeError; var getIterator = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) { return anObject(functionCall(iteratorMethod, argument)); } - throw $TypeError$s(tryToString(argument) + ' is not iterable'); + throw $TypeError$t(tryToString(argument) + ' is not iterable'); }; var iteratorClose = function (iterator, kind, value) { @@ -1976,7 +2006,7 @@ var doric = (function (exports) { return value; }; - var $TypeError$r = TypeError; + var $TypeError$s = TypeError; var Result = function (stopped, result) { this.stopped = stopped; @@ -2012,7 +2042,7 @@ var doric = (function (exports) { iterator = iterable; } else { iterFn = getIteratorMethod(iterable); - if (!iterFn) { throw $TypeError$r(tryToString(iterable) + ' is not iterable'); } + if (!iterFn) { throw $TypeError$s(tryToString(iterable) + ' is not iterable'); } // optimisation for array iterators if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { @@ -2043,13 +2073,13 @@ var doric = (function (exports) { var isInstance = objectIsPrototypeOf(AggregateErrorPrototype, this); var that; if (objectSetPrototypeOf) { - that = objectSetPrototypeOf(new $Error(), isInstance ? objectGetPrototypeOf(this) : AggregateErrorPrototype); + that = objectSetPrototypeOf($Error(), isInstance ? objectGetPrototypeOf(this) : AggregateErrorPrototype); } else { that = isInstance ? this : objectCreate(AggregateErrorPrototype); createNonEnumerableProperty(that, TO_STRING_TAG$6, 'Error'); } if (message !== undefined) { createNonEnumerableProperty(that, 'message', normalizeStringArgument(message)); } - if (errorStackInstallable) { createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1)); } + if (errorStackInstallable) { createNonEnumerableProperty(that, 'stack', errorStackClear(that.stack, 1)); } installErrorCause(that, options); var errorsArray = []; iterate(errors, push$j, { that: errorsArray }); @@ -2074,6 +2104,7 @@ var doric = (function (exports) { var AGGREGATE_ERROR = 'AggregateError'; var $AggregateError = getBuiltIn(AGGREGATE_ERROR); + var FORCED$l = !fails(function () { return $AggregateError([1]).errors[0] !== 1; }) && fails(function () { @@ -2088,7 +2119,7 @@ var doric = (function (exports) { }, FORCED$l, true) }); - var defineProperty$a = objectDefineProperty.f; + var defineProperty$b = objectDefineProperty.f; var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype$1 = Array.prototype; @@ -2096,7 +2127,7 @@ var doric = (function (exports) { // Array.prototype[@@unscopables] // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype$1[UNSCOPABLES] == undefined) { - defineProperty$a(ArrayPrototype$1, UNSCOPABLES, { + defineProperty$b(ArrayPrototype$1, UNSCOPABLES, { configurable: true, value: objectCreate(null) }); @@ -2121,11 +2152,11 @@ var doric = (function (exports) { addToUnscopables('at'); - var $TypeError$q = TypeError; + var $TypeError$r = TypeError; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991 var doesNotExceedSafeInteger = function (it) { - if (it > MAX_SAFE_INTEGER) { throw $TypeError$q('Maximum allowed index exceeded'); } + if (it > MAX_SAFE_INTEGER) { throw $TypeError$r('Maximum allowed index exceeded'); } return it; }; @@ -2194,17 +2225,17 @@ var doric = (function (exports) { } }); - var $TypeError$p = TypeError; + var $TypeError$q = TypeError; var deletePropertyOrThrow = function (O, P) { - if (!delete O[P]) { throw $TypeError$p('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O)); } + if (!delete O[P]) { throw $TypeError$q('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O)); } }; var min$a = Math.min; // `Array.prototype.copyWithin` method implementation // https://tc39.es/ecma262/#sec-array.prototype.copywithin - // eslint-disable-next-line es-x/no-array-prototype-copywithin -- safe + // eslint-disable-next-line es/no-array-prototype-copywithin -- safe var arrayCopyWithin = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { var O = toObject(this); var len = lengthOfArrayLike(O); @@ -2453,12 +2484,12 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-array.prototype.foreach var arrayForEach = !STRICT_METHOD$7 ? function forEach(callbackfn /* , thisArg */) { return $forEach$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); - // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe + // eslint-disable-next-line es/no-array-prototype-foreach -- safe } : [].forEach; // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach - // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe + // eslint-disable-next-line es/no-array-prototype-foreach -- safe _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, { forEach: arrayForEach }); @@ -2472,7 +2503,7 @@ var doric = (function (exports) { } }; - var $Array$8 = Array; + var $Array$9 = Array; // `Array.from` method implementation // https://tc39.es/ecma262/#sec-array.from @@ -2487,7 +2518,7 @@ var doric = (function (exports) { var index = 0; var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case - if (iteratorMethod && !(this === $Array$8 && isArrayIteratorMethod(iteratorMethod))) { + if (iteratorMethod && !(this === $Array$9 && isArrayIteratorMethod(iteratorMethod))) { iterator = getIterator(O, iteratorMethod); next = iterator.next; result = IS_CONSTRUCTOR ? new this() : []; @@ -2497,7 +2528,7 @@ var doric = (function (exports) { } } else { length = lengthOfArrayLike(O); - result = IS_CONSTRUCTOR ? new this(length) : $Array$8(length); + result = IS_CONSTRUCTOR ? new this(length) : $Array$9(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty(result, index, value); @@ -2523,7 +2554,7 @@ var doric = (function (exports) { iteratorWithReturn[ITERATOR$8] = function () { return this; }; - // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing + // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing Array.from(iteratorWithReturn, function () { throw 2; }); } catch (error) { /* empty */ } @@ -2545,7 +2576,7 @@ var doric = (function (exports) { }; var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { - // eslint-disable-next-line es-x/no-array-from -- required for testing + // eslint-disable-next-line es/no-array-from -- required for testing Array.from(iterable); }); @@ -2575,15 +2606,15 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('includes'); - /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */ + /* eslint-disable es/no-array-prototype-indexof -- required for testing */ - var $IndexOf = arrayIncludes.indexOf; + var $indexOf$1 = arrayIncludes.indexOf; - var un$IndexOf = functionUncurryThis([].indexOf); + var nativeIndexOf = functionUncurryThisClause([].indexOf); - var NEGATIVE_ZERO$1 = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0; + var NEGATIVE_ZERO$1 = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0; var STRICT_METHOD$6 = arrayMethodIsStrict('indexOf'); // `Array.prototype.indexOf` method @@ -2593,8 +2624,8 @@ var doric = (function (exports) { var fromIndex = arguments.length > 1 ? arguments[1] : undefined; return NEGATIVE_ZERO$1 // convert -0 to +0 - ? un$IndexOf(this, searchElement, fromIndex) || 0 - : $IndexOf(this, searchElement, fromIndex); + ? nativeIndexOf(this, searchElement, fromIndex) || 0 + : $indexOf$1(this, searchElement, fromIndex); } }); @@ -2611,7 +2642,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype$5, PrototypeOfArrayIteratorPrototype, arrayIterator$1; - /* eslint-disable es-x/no-array-prototype-keys -- safe */ + /* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { arrayIterator$1 = [].keys(); // Safari 8 has buggy iterators w/o `next` @@ -2622,7 +2653,7 @@ var doric = (function (exports) { } } - var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$5 == undefined || fails(function () { + var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$5) || fails(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype$5[ITERATOR$7].call(test) !== test; @@ -2651,7 +2682,7 @@ var doric = (function (exports) { var returnThis$1 = function () { return this; }; - var createIteratorConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { + var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = objectCreate(IteratorPrototype$4, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false); @@ -2670,8 +2701,8 @@ var doric = (function (exports) { var returnThis = function () { return this; }; - var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); + var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + iteratorCreateConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) { return defaultIterator; } @@ -2742,7 +2773,14 @@ var doric = (function (exports) { return methods; }; - var defineProperty$9 = objectDefineProperty.f; + // `CreateIterResultObject` abstract operation + // https://tc39.es/ecma262/#sec-createiterresultobject + var createIterResultObject = function (value, done) { + return { value: value, done: done }; + }; + + var defineProperty$a = objectDefineProperty.f; + @@ -2761,7 +2799,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.es/ecma262/#sec-createarrayiterator - var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) { + var es_array_iterator = iteratorDefine(Array, 'Array', function (iterated, kind) { setInternalState$h(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target @@ -2777,11 +2815,11 @@ var doric = (function (exports) { var index = state.index++; if (!target || index >= target.length) { state.target = undefined; - return { value: undefined, done: true }; + return createIterResultObject(undefined, true); } - if (kind == 'keys') { return { value: index, done: false }; } - if (kind == 'values') { return { value: target[index], done: false }; } - return { value: [index, target[index]], done: false }; + if (kind == 'keys') { return createIterResultObject(index, false); } + if (kind == 'values') { return createIterResultObject(target[index], false); } + return createIterResultObject([index, target[index]], false); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% @@ -2796,10 +2834,10 @@ var doric = (function (exports) { // V8 ~ Chrome 45- bug if (descriptors && values.name !== 'values') { try { - defineProperty$9(values, 'name', { value: 'values' }); + defineProperty$a(values, 'name', { value: 'values' }); } catch (error) { /* empty */ } } - var un$Join = functionUncurryThis([].join); + var nativeJoin = functionUncurryThis([].join); var ES3_STRINGS = indexedObject != Object; var STRICT_METHOD$5 = arrayMethodIsStrict('join', ','); @@ -2808,11 +2846,11 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-array.prototype.join _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$5 }, { join: function join(separator) { - return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator); + return nativeJoin(toIndexedObject(this), separator === undefined ? ',' : separator); } }); - /* eslint-disable es-x/no-array-prototype-lastindexof -- safe */ + /* eslint-disable es/no-array-prototype-lastindexof -- safe */ @@ -2841,7 +2879,7 @@ var doric = (function (exports) { // `Array.prototype.lastIndexOf` method // https://tc39.es/ecma262/#sec-array.prototype.lastindexof - // eslint-disable-next-line es-x/no-array-prototype-lastindexof -- required for testing + // eslint-disable-next-line es/no-array-prototype-lastindexof -- required for testing _export({ target: 'Array', proto: true, forced: arrayLastIndexOf !== [].lastIndexOf }, { lastIndexOf: arrayLastIndexOf }); @@ -2860,12 +2898,12 @@ var doric = (function (exports) { } }); - var $Array$7 = Array; + var $Array$8 = Array; var ISNT_GENERIC = fails(function () { function F() { /* empty */ } - // eslint-disable-next-line es-x/no-array-of -- safe - return !($Array$7.of.call(F) instanceof F); + // eslint-disable-next-line es/no-array-of -- safe + return !($Array$8.of.call(F) instanceof F); }); // `Array.of` method @@ -2877,13 +2915,37 @@ var doric = (function (exports) { var index = 0; var argumentsLength = arguments.length; - var result = new (isConstructor(this) ? this : $Array$7)(argumentsLength); + var result = new (isConstructor(this) ? this : $Array$8)(argumentsLength); while (argumentsLength > index) { createProperty(result, index, arguments$1[index++]); } result.length = argumentsLength; return result; } }); + var $TypeError$p = TypeError; + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + var getOwnPropertyDescriptor$9 = Object.getOwnPropertyDescriptor; + + // Safari < 13 does not throw an error in this case + var SILENT_ON_NON_WRITABLE_LENGTH_SET = descriptors && !function () { + // makes no sense without proper strict mode support + if (this !== undefined) { return true; } + try { + // eslint-disable-next-line es/no-object-defineproperty -- safe + Object.defineProperty([], 'length', { writable: false }).length = 1; + } catch (error) { + return error instanceof TypeError; + } + }(); + + var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) { + if (isArray(O) && !getOwnPropertyDescriptor$9(O, 'length').writable) { + throw $TypeError$p('Cannot set read only .length'); + } return O.length = length; + } : function (O, length) { + return O.length = length; + }; + var INCORRECT_TO_LENGTH = fails(function () { return [].push.call({ length: 0x100000000 }, 1) !== 4294967297; }); @@ -2892,7 +2954,7 @@ var doric = (function (exports) { // https://bugs.chromium.org/p/v8/issues/detail?id=12681 var SILENT_ON_NON_WRITABLE_LENGTH$1 = !function () { try { - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).push(); } catch (error) { return error instanceof TypeError; @@ -2914,7 +2976,7 @@ var doric = (function (exports) { O[len] = arguments$1[i]; len++; } - O.length = len; + arraySetLength(O, len); return len; } }); @@ -2996,7 +3058,7 @@ var doric = (function (exports) { } }); - var un$Reverse = functionUncurryThis([].reverse); + var nativeReverse = functionUncurryThis([].reverse); var test$1 = [1, 2]; // `Array.prototype.reverse` method @@ -3007,14 +3069,14 @@ var doric = (function (exports) { reverse: function reverse() { // eslint-disable-next-line no-self-assign -- dirty hack if (isArray(this)) { this.length = this.length; } - return un$Reverse(this); + return nativeReverse(this); } }); var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('slice'); var SPECIES$4 = wellKnownSymbol('species'); - var $Array$6 = Array; + var $Array$7 = Array; var max$7 = Math.max; // `Array.prototype.slice` method @@ -3031,17 +3093,17 @@ var doric = (function (exports) { if (isArray(O)) { Constructor = O.constructor; // cross-realm fallback - if (isConstructor(Constructor) && (Constructor === $Array$6 || isArray(Constructor.prototype))) { + if (isConstructor(Constructor) && (Constructor === $Array$7 || isArray(Constructor.prototype))) { Constructor = undefined; } else if (isObject(Constructor)) { Constructor = Constructor[SPECIES$4]; if (Constructor === null) { Constructor = undefined; } } - if (Constructor === $Array$6 || Constructor === undefined) { + if (Constructor === $Array$7 || Constructor === undefined) { return arraySlice$1(O, k, fin); } } - result = new (Constructor === undefined ? $Array$6 : Constructor)(max$7(fin - k, 0)); + result = new (Constructor === undefined ? $Array$7 : Constructor)(max$7(fin - k, 0)); for (n = 0; k < fin; k++, n++) { if (k in O) { createProperty(result, n, O[k]); } } result.length = n; return result; @@ -3115,7 +3177,7 @@ var doric = (function (exports) { var engineWebkitVersion = !!webkit && +webkit[1]; var test = []; - var un$Sort$1 = functionUncurryThis(test.sort); + var nativeSort$1 = functionUncurryThis(test.sort); var push$i = functionUncurryThis(test.push); // IE8- @@ -3183,7 +3245,7 @@ var doric = (function (exports) { var array = toObject(this); - if (STABLE_SORT$1) { return comparefn === undefined ? un$Sort$1(array) : un$Sort$1(array, comparefn); } + if (STABLE_SORT$1) { return comparefn === undefined ? nativeSort$1(array) : nativeSort$1(array, comparefn); } var items = []; var arrayLength = lengthOfArrayLike(array); @@ -3195,7 +3257,7 @@ var doric = (function (exports) { arraySort(items, getSortCompare$1(comparefn)); - itemsLength = items.length; + itemsLength = lengthOfArrayLike(items); index = 0; while (index < itemsLength) { array[index] = items[index++]; } @@ -3275,7 +3337,7 @@ var doric = (function (exports) { for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments$1[k + 2]; } - O.length = len - actualDeleteCount + insertCount; + arraySetLength(O, len - actualDeleteCount + insertCount); return A; } }); @@ -3300,7 +3362,7 @@ var doric = (function (exports) { // V8 ~ Chrome < 71 and Safari <= 15.4, FF < 23 throws InternalError var SILENT_ON_NON_WRITABLE_LENGTH = !function () { try { - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty([], 'length', { writable: false }).unshift(); } catch (error) { return error instanceof TypeError; @@ -3328,12 +3390,12 @@ var doric = (function (exports) { for (var j = 0; j < argCount; j++) { O[j] = arguments$1[j]; } - } return O.length = len + argCount; + } return arraySetLength(O, len + argCount); } }); - // eslint-disable-next-line es-x/no-typed-arrays -- safe - var arrayBufferNative = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; + // eslint-disable-next-line es/no-typed-arrays -- safe + var arrayBufferBasicDetection = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; var defineBuiltIns = function (target, src, options) { for (var key in src) { defineBuiltIn(target, key, src[key], options); } @@ -3360,7 +3422,7 @@ var doric = (function (exports) { }; // IEEE754 conversions based on https://github.com/feross/ieee754 - var $Array$5 = Array; + var $Array$6 = Array; var abs$8 = Math.abs; var pow$5 = Math.pow; var floor$8 = Math.floor; @@ -3368,7 +3430,7 @@ var doric = (function (exports) { var LN2$2 = Math.LN2; var pack = function (number, mantissaLength, bytes) { - var buffer = $Array$5(bytes); + var buffer = $Array$6(bytes); var exponentLength = bytes * 8 - mantissaLength - 1; var eMax = (1 << exponentLength) - 1; var eBias = eMax >> 1; @@ -3463,7 +3525,7 @@ var doric = (function (exports) { }; var getOwnPropertyNames$3 = objectGetOwnPropertyNames.f; - var defineProperty$8 = objectDefineProperty.f; + var defineProperty$9 = objectDefineProperty.f; @@ -3483,7 +3545,7 @@ var doric = (function (exports) { var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE]; var $DataView = global_1[DATA_VIEW]; var DataViewPrototype$1 = $DataView && $DataView[PROTOTYPE]; - var ObjectPrototype$2 = Object.prototype; + var ObjectPrototype$3 = Object.prototype; var Array$2 = global_1.Array; var RangeError$3 = global_1.RangeError; var fill = functionUncurryThis(arrayFill); @@ -3517,7 +3579,7 @@ var doric = (function (exports) { }; var addGetter = function (Constructor, key) { - defineProperty$8(Constructor[PROTOTYPE], key, { get: function () { return getInternalState$c(this)[key]; } }); + defineProperty$9(Constructor[PROTOTYPE], key, { get: function () { return getInternalState$c(this)[key]; } }); }; var get$1 = function (view, count, index, isLittleEndian) { @@ -3540,7 +3602,7 @@ var doric = (function (exports) { for (var i = 0; i < count; i++) { bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; } }; - if (!arrayBufferNative) { + if (!arrayBufferBasicDetection) { $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, ArrayBufferPrototype); var byteLength = toIndex(length); @@ -3645,9 +3707,9 @@ var doric = (function (exports) { new NativeArrayBuffer$1(); new NativeArrayBuffer$1(1.5); new NativeArrayBuffer$1(NaN); - return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; + return NativeArrayBuffer$1.length != 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; })) { - /* eslint-enable no-new -- required for testing */ + /* eslint-enable no-new -- required for testing */ $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, ArrayBufferPrototype); return new NativeArrayBuffer$1(toIndex(length)); @@ -3667,8 +3729,8 @@ var doric = (function (exports) { } // WebKit bug - the same parent prototype for typed arrays and data view - if (objectSetPrototypeOf && objectGetPrototypeOf(DataViewPrototype$1) !== ObjectPrototype$2) { - objectSetPrototypeOf(DataViewPrototype$1, ObjectPrototype$2); + if (objectSetPrototypeOf && objectGetPrototypeOf(DataViewPrototype$1) !== ObjectPrototype$3) { + objectSetPrototypeOf(DataViewPrototype$1, ObjectPrototype$3); } // iOS Safari 7.x bug @@ -3706,7 +3768,7 @@ var doric = (function (exports) { setSpecies(ARRAY_BUFFER); - var defineProperty$7 = objectDefineProperty.f; + var defineProperty$8 = objectDefineProperty.f; @@ -3722,14 +3784,14 @@ var doric = (function (exports) { var Uint8ClampedArrayPrototype = Uint8ClampedArray$1 && Uint8ClampedArray$1.prototype; var TypedArray = Int8Array$4 && objectGetPrototypeOf(Int8Array$4); var TypedArrayPrototype$1 = Int8ArrayPrototype$1 && objectGetPrototypeOf(Int8ArrayPrototype$1); - var ObjectPrototype$1 = Object.prototype; + var ObjectPrototype$2 = Object.prototype; var TypeError$6 = global_1.TypeError; var TO_STRING_TAG$5 = wellKnownSymbol('toStringTag'); var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; // Fixing native typed arrays in Opera Presto crashes the browser, see #595 - var NATIVE_ARRAY_BUFFER_VIEWS$2 = arrayBufferNative && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera'; + var NATIVE_ARRAY_BUFFER_VIEWS$2 = arrayBufferBasicDetection && !!objectSetPrototypeOf && classof(global_1.opera) !== 'Opera'; var TYPED_ARRAY_TAG_REQUIRED = false; var NAME$1, Constructor, Prototype; @@ -3850,7 +3912,7 @@ var doric = (function (exports) { } } } - if (!NATIVE_ARRAY_BUFFER_VIEWS$2 || !TypedArrayPrototype$1 || TypedArrayPrototype$1 === ObjectPrototype$1) { + if (!NATIVE_ARRAY_BUFFER_VIEWS$2 || !TypedArrayPrototype$1 || TypedArrayPrototype$1 === ObjectPrototype$2) { TypedArrayPrototype$1 = TypedArray.prototype; if (NATIVE_ARRAY_BUFFER_VIEWS$2) { for (NAME$1 in TypedArrayConstructorsList) { if (global_1[NAME$1]) { objectSetPrototypeOf(global_1[NAME$1].prototype, TypedArrayPrototype$1); } @@ -3864,7 +3926,7 @@ var doric = (function (exports) { if (descriptors && !hasOwnProperty_1(TypedArrayPrototype$1, TO_STRING_TAG$5)) { TYPED_ARRAY_TAG_REQUIRED = true; - defineProperty$7(TypedArrayPrototype$1, TO_STRING_TAG$5, { get: function () { + defineProperty$8(TypedArrayPrototype$1, TO_STRING_TAG$5, { get: function () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); for (NAME$1 in TypedArrayConstructorsList) { if (global_1[NAME$1]) { @@ -3909,15 +3971,15 @@ var doric = (function (exports) { var speciesConstructor = function (O, defaultConstructor) { var C = anObject(O).constructor; var S; - return C === undefined || (S = anObject(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor(S); + return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES$2]) ? defaultConstructor : aConstructor(S); }; var ArrayBuffer$2 = arrayBuffer.ArrayBuffer; var DataView$1 = arrayBuffer.DataView; var DataViewPrototype = DataView$1.prototype; - var un$ArrayBufferSlice = functionUncurryThis(ArrayBuffer$2.prototype.slice); - var getUint8 = functionUncurryThis(DataViewPrototype.getUint8); - var setUint8 = functionUncurryThis(DataViewPrototype.setUint8); + var nativeArrayBufferSlice = functionUncurryThisClause(ArrayBuffer$2.prototype.slice); + var getUint8 = functionUncurryThisClause(DataViewPrototype.getUint8); + var setUint8 = functionUncurryThisClause(DataViewPrototype.setUint8); var INCORRECT_SLICE = fails(function () { return !new ArrayBuffer$2(2).slice(1, undefined).byteLength; @@ -3927,8 +3989,8 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice _export({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { slice: function slice(start, end) { - if (un$ArrayBufferSlice && end === undefined) { - return un$ArrayBufferSlice(anObject(this), start); // FF fix + if (nativeArrayBufferSlice && end === undefined) { + return nativeArrayBufferSlice(anObject(this), start); // FF fix } var length = anObject(this).byteLength; var first = toAbsoluteIndex(start, length); @@ -3945,7 +4007,7 @@ var doric = (function (exports) { // `DataView` constructor // https://tc39.es/ecma262/#sec-dataview-constructor - _export({ global: true, constructor: true, forced: !arrayBufferNative }, { + _export({ global: true, constructor: true, forced: !arrayBufferBasicDetection }, { DataView: arrayBuffer.DataView }); @@ -3968,18 +4030,18 @@ var doric = (function (exports) { var $Date = Date; - var getTime$4 = functionUncurryThis($Date.prototype.getTime); + var thisTimeValue$4 = functionUncurryThis($Date.prototype.getTime); // `Date.now` method // https://tc39.es/ecma262/#sec-date.now _export({ target: 'Date', stat: true }, { now: function now() { - return getTime$4(new $Date()); + return thisTimeValue$4(new $Date()); } }); var DatePrototype$3 = Date.prototype; - var getTime$3 = functionUncurryThis(DatePrototype$3.getTime); + var thisTimeValue$3 = functionUncurryThis(DatePrototype$3.getTime); var setFullYear = functionUncurryThis(DatePrototype$3.setFullYear); // `Date.prototype.setYear` method @@ -3987,7 +4049,7 @@ var doric = (function (exports) { _export({ target: 'Date', proto: true }, { setYear: function setYear(year) { // validate - getTime$3(this); + thisTimeValue$3(this); var yi = toIntegerOrInfinity(year); var yyyy = 0 <= yi && yi <= 99 ? yi + 1900 : yi; return setFullYear(this, yyyy); @@ -4052,10 +4114,11 @@ var doric = (function (exports) { var padStart = stringPad.start; var $RangeError$a = RangeError; + var $isFinite$1 = isFinite; var abs$7 = Math.abs; var DatePrototype$2 = Date.prototype; - var n$DateToISOString = DatePrototype$2.toISOString; - var getTime$2 = functionUncurryThis(DatePrototype$2.getTime); + var nativeDateToISOString = DatePrototype$2.toISOString; + var thisTimeValue$2 = functionUncurryThis(DatePrototype$2.getTime); var getUTCDate = functionUncurryThis(DatePrototype$2.getUTCDate); var getUTCFullYear = functionUncurryThis(DatePrototype$2.getUTCFullYear); var getUTCHours = functionUncurryThis(DatePrototype$2.getUTCHours); @@ -4068,11 +4131,11 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit fails here: var dateToIsoString = (fails(function () { - return n$DateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; + return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; }) || !fails(function () { - n$DateToISOString.call(new Date(NaN)); + nativeDateToISOString.call(new Date(NaN)); })) ? function toISOString() { - if (!isFinite(getTime$2(this))) { throw $RangeError$a('Invalid time value'); } + if (!$isFinite$1(thisTimeValue$2(this))) { throw $RangeError$a('Invalid time value'); } var date = this; var year = getUTCFullYear(date); var milliseconds = getUTCMilliseconds(date); @@ -4085,7 +4148,7 @@ var doric = (function (exports) { ':' + padStart(getUTCSeconds(date), 2, 0) + '.' + padStart(milliseconds, 3, 0) + 'Z'; - } : n$DateToISOString; + } : nativeDateToISOString; // `Date.prototype.toISOString` method // https://tc39.es/ecma262/#sec-date.prototype.toisostring @@ -4137,21 +4200,21 @@ var doric = (function (exports) { var DatePrototype = Date.prototype; var INVALID_DATE = 'Invalid Date'; var TO_STRING$1 = 'toString'; - var un$DateToString = functionUncurryThis(DatePrototype[TO_STRING$1]); - var getTime$1 = functionUncurryThis(DatePrototype.getTime); + var nativeDateToString = functionUncurryThis(DatePrototype[TO_STRING$1]); + var thisTimeValue$1 = functionUncurryThis(DatePrototype.getTime); // `Date.prototype.toString` method // https://tc39.es/ecma262/#sec-date.prototype.tostring if (String(new Date(NaN)) != INVALID_DATE) { defineBuiltIn(DatePrototype, TO_STRING$1, function toString() { - var value = getTime$1(this); + var value = thisTimeValue$1(this); // eslint-disable-next-line no-self-compare -- NaN check - return value === value ? un$DateToString(this) : INVALID_DATE; + return value === value ? nativeDateToString(this) : INVALID_DATE; }); } - var charAt$g = functionUncurryThis(''.charAt); - var charCodeAt$4 = functionUncurryThis(''.charCodeAt); + var charAt$h = functionUncurryThis(''.charAt); + var charCodeAt$6 = functionUncurryThis(''.charCodeAt); var exec$9 = functionUncurryThis(/./.exec); var numberToString$2 = functionUncurryThis(1.0.toString); var toUpperCase = functionUncurryThis(''.toUpperCase); @@ -4174,11 +4237,11 @@ var doric = (function (exports) { var index = 0; var chr, code; while (index < length) { - chr = charAt$g(str, index++); + chr = charAt$h(str, index++); if (exec$9(raw, chr)) { result += chr; } else { - code = charCodeAt$4(chr, 0); + code = charCodeAt$6(chr, 0); if (code < 256) { result += '%' + hex$1(code, 2); } else { @@ -4191,13 +4254,13 @@ var doric = (function (exports) { var $Function = Function; var concat$3 = functionUncurryThis([].concat); - var join$7 = functionUncurryThis([].join); + var join$8 = functionUncurryThis([].join); var factories = {}; var construct = function (C, argsLength, args) { if (!hasOwnProperty_1(factories, argsLength)) { for (var list = [], i = 0; i < argsLength; i++) { list[i] = 'a[' + i + ']'; } - factories[argsLength] = $Function('C,a', 'return new C(' + join$7(list, ',') + ')'); + factories[argsLength] = $Function('C,a', 'return new C(' + join$8(list, ',') + ')'); } return factories[argsLength](C, args); }; @@ -4243,7 +4306,7 @@ var doric = (function (exports) { var FUNCTION_NAME_EXISTS = functionName.EXISTS; - var defineProperty$6 = objectDefineProperty.f; + var defineProperty$7 = objectDefineProperty.f; var FunctionPrototype = Function.prototype; var functionToString = functionUncurryThis(FunctionPrototype.toString); @@ -4254,7 +4317,7 @@ var doric = (function (exports) { // Function instances `.name` property // https://tc39.es/ecma262/#sec-function-instances-name if (descriptors && !FUNCTION_NAME_EXISTS) { - defineProperty$6(FunctionPrototype, NAME, { + defineProperty$7(FunctionPrototype, NAME, { configurable: true, get: function () { try { @@ -4268,7 +4331,7 @@ var doric = (function (exports) { // `globalThis` object // https://tc39.es/ecma262/#sec-globalthis - _export({ global: true }, { + _export({ global: true, forced: global_1.globalThis !== global_1 }, { globalThis: global_1 }); @@ -4282,12 +4345,12 @@ var doric = (function (exports) { var arrayBufferNonExtensible = fails(function () { if (typeof ArrayBuffer == 'function') { var buffer = new ArrayBuffer(8); - // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe if (Object.isExtensible(buffer)) { Object.defineProperty(buffer, 'a', { value: 8 }); } } }); - // eslint-disable-next-line es-x/no-object-isextensible -- safe + // eslint-disable-next-line es/no-object-isextensible -- safe var $isExtensible = Object.isExtensible; var FAILS_ON_PRIMITIVES$9 = fails(function () { $isExtensible(1); }); @@ -4300,7 +4363,7 @@ var doric = (function (exports) { } : $isExtensible; var freezing = !fails(function () { - // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-preventextensions -- required for testing + // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing return Object.isExtensible(Object.preventExtensions({})); }); @@ -4452,7 +4515,7 @@ var doric = (function (exports) { Constructor = wrapper(function (dummy, iterable) { anInstance(dummy, NativePrototype); var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); - if (iterable != undefined) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } + if (!isNullOrUndefined(iterable)) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } return that; }); Constructor.prototype = NativePrototype; @@ -4481,7 +4544,9 @@ var doric = (function (exports) { return Constructor; }; - var defineProperty$5 = objectDefineProperty.f; + var defineProperty$6 = objectDefineProperty.f; + + @@ -4508,7 +4573,7 @@ var doric = (function (exports) { size: 0 }); if (!descriptors) { that.size = 0; } - if (iterable != undefined) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } + if (!isNullOrUndefined(iterable)) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } }); var Prototype = Constructor.prototype; @@ -4632,7 +4697,7 @@ var doric = (function (exports) { return define(this, value = value === 0 ? 0 : value, value); } }); - if (descriptors) { defineProperty$5(Prototype, 'size', { + if (descriptors) { defineProperty$6(Prototype, 'size', { get: function () { return getInternalState(this).size; } @@ -4652,7 +4717,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-set.prototype.keys // https://tc39.es/ecma262/#sec-set.prototype.values // https://tc39.es/ecma262/#sec-set.prototype-@@iterator - defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { + iteratorDefine(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { setInternalState$f(this, { type: ITERATOR_NAME, target: iterated, @@ -4670,12 +4735,12 @@ var doric = (function (exports) { if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { // or finish the iteration state.target = undefined; - return { value: undefined, done: true }; + return createIterResultObject(undefined, true); } // return step by kind - if (kind == 'keys') { return { value: entry.key, done: false }; } - if (kind == 'values') { return { value: entry.value, done: false }; } - return { value: [entry.key, entry.value], done: false }; + if (kind == 'keys') { return createIterResultObject(entry.key, false); } + if (kind == 'values') { return createIterResultObject(entry.value, false); } + return createIterResultObject([entry.key, entry.value], false); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // `{ Map, Set }.prototype[@@species]` accessors @@ -4695,13 +4760,13 @@ var doric = (function (exports) { // `Math.log1p` method implementation // https://tc39.es/ecma262/#sec-math.log1p - // eslint-disable-next-line es-x/no-math-log1p -- safe + // eslint-disable-next-line es/no-math-log1p -- safe var mathLog1p = Math.log1p || function log1p(x) { var n = +x; return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log$8(1 + n); }; - // eslint-disable-next-line es-x/no-math-acosh -- required for testing + // eslint-disable-next-line es/no-math-acosh -- required for testing var $acosh = Math.acosh; var log$7 = Math.log; var sqrt$2 = Math.sqrt; @@ -4724,7 +4789,7 @@ var doric = (function (exports) { } }); - // eslint-disable-next-line es-x/no-math-asinh -- required for testing + // eslint-disable-next-line es/no-math-asinh -- required for testing var $asinh = Math.asinh; var log$6 = Math.log; var sqrt$1 = Math.sqrt; @@ -4741,7 +4806,7 @@ var doric = (function (exports) { asinh: asinh }); - // eslint-disable-next-line es-x/no-math-atanh -- required for testing + // eslint-disable-next-line es/no-math-atanh -- required for testing var $atanh = Math.atanh; var log$5 = Math.log; @@ -4757,7 +4822,7 @@ var doric = (function (exports) { // `Math.sign` method implementation // https://tc39.es/ecma262/#sec-math.sign - // eslint-disable-next-line es-x/no-math-sign -- safe + // eslint-disable-next-line es/no-math-sign -- safe var mathSign = Math.sign || function sign(x) { var n = +x; // eslint-disable-next-line no-self-compare -- NaN check @@ -4789,7 +4854,7 @@ var doric = (function (exports) { } }); - // eslint-disable-next-line es-x/no-math-expm1 -- safe + // eslint-disable-next-line es/no-math-expm1 -- safe var $expm1 = Math.expm1; var exp$2 = Math.exp; @@ -4805,7 +4870,7 @@ var doric = (function (exports) { return n == 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp$2(n) - 1; } : $expm1; - // eslint-disable-next-line es-x/no-math-cosh -- required for testing + // eslint-disable-next-line es/no-math-cosh -- required for testing var $cosh = Math.cosh; var abs$5 = Math.abs; var E$1 = Math.E; @@ -4821,7 +4886,7 @@ var doric = (function (exports) { // `Math.expm1` method // https://tc39.es/ecma262/#sec-math.expm1 - // eslint-disable-next-line es-x/no-math-expm1 -- required for testing + // eslint-disable-next-line es/no-math-expm1 -- required for testing _export({ target: 'Math', stat: true, forced: mathExpm1 != Math.expm1 }, { expm1: mathExpm1 }); var abs$4 = Math.abs; @@ -4837,7 +4902,7 @@ var doric = (function (exports) { // `Math.fround` method implementation // https://tc39.es/ecma262/#sec-math.fround - // eslint-disable-next-line es-x/no-math-fround -- safe + // eslint-disable-next-line es/no-math-fround -- safe var mathFround = Math.fround || function fround(x) { var n = +x; var $abs = abs$4(n); @@ -4855,7 +4920,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-math.fround _export({ target: 'Math', stat: true }, { fround: mathFround }); - // eslint-disable-next-line es-x/no-math-hypot -- required for testing + // eslint-disable-next-line es/no-math-hypot -- required for testing var $hypot = Math.hypot; var abs$3 = Math.abs; var sqrt = Math.sqrt; @@ -4891,7 +4956,7 @@ var doric = (function (exports) { } }); - // eslint-disable-next-line es-x/no-math-imul -- required for testing + // eslint-disable-next-line es/no-math-imul -- required for testing var $imul = Math.imul; var FORCED$e = fails(function () { @@ -4915,7 +4980,7 @@ var doric = (function (exports) { var log$3 = Math.log; var LOG10E = Math.LOG10E; - // eslint-disable-next-line es-x/no-math-log10 -- safe + // eslint-disable-next-line es/no-math-log10 -- safe var mathLog10 = Math.log10 || function log10(x) { return log$3(x) * LOG10E; }; @@ -4952,7 +5017,7 @@ var doric = (function (exports) { var E = Math.E; var FORCED$d = fails(function () { - // eslint-disable-next-line es-x/no-math-sinh -- required for testing + // eslint-disable-next-line es/no-math-sinh -- required for testing return Math.sinh(-2e-17) != -2e-17; }); @@ -4991,7 +5056,7 @@ var doric = (function (exports) { // `thisNumberValue` abstract operation // https://tc39.es/ecma262/#sec-thisnumbervalue - var thisNumberValue = functionUncurryThis(1.0.valueOf); + var thisNumberValue$1 = functionUncurryThis(1.0.valueOf); // a string of all valid unicode whitespaces var whitespaces$1 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + @@ -5026,7 +5091,7 @@ var doric = (function (exports) { var getOwnPropertyNames$2 = objectGetOwnPropertyNames.f; var getOwnPropertyDescriptor$8 = objectGetOwnPropertyDescriptor.f; - var defineProperty$4 = objectDefineProperty.f; + var defineProperty$5 = objectDefineProperty.f; var trim$2 = stringTrim.trim; @@ -5035,7 +5100,7 @@ var doric = (function (exports) { var NumberPrototype = NativeNumber.prototype; var TypeError$5 = global_1.TypeError; var arraySlice = functionUncurryThis(''.slice); - var charCodeAt$3 = functionUncurryThis(''.charCodeAt); + var charCodeAt$5 = functionUncurryThis(''.charCodeAt); // `ToNumeric` abstract operation // https://tc39.es/ecma262/#sec-tonumeric @@ -5052,12 +5117,12 @@ var doric = (function (exports) { if (isSymbol(it)) { throw TypeError$5('Cannot convert a Symbol value to a number'); } if (typeof it == 'string' && it.length > 2) { it = trim$2(it); - first = charCodeAt$3(it, 0); + first = charCodeAt$5(it, 0); if (first === 43 || first === 45) { - third = charCodeAt$3(it, 2); + third = charCodeAt$5(it, 2); if (third === 88 || third === 120) { return NaN; } // Number('+0x1') should be NaN, old V8 fix } else if (first === 48) { - switch (charCodeAt$3(it, 1)) { + switch (charCodeAt$5(it, 1)) { case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i default: return +it; @@ -5065,7 +5130,7 @@ var doric = (function (exports) { digits = arraySlice(it, 2); length = digits.length; for (index = 0; index < length; index++) { - code = charCodeAt$3(digits, index); + code = charCodeAt$5(digits, index); // parseInt parses a string to a first unavailable symbol // but ToNumber should return NaN if a string contains unavailable symbols if (code < 48 || code > maxCode) { return NaN; } @@ -5081,7 +5146,7 @@ var doric = (function (exports) { var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); var dummy = this; // check on 1..constructor(foo) case - return objectIsPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); }) + return objectIsPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue$1(dummy); }) ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n; }; for (var keys$1 = descriptors ? getOwnPropertyNames$2(NativeNumber) : ( @@ -5093,7 +5158,7 @@ var doric = (function (exports) { 'fromString,range' ).split(','), j = 0, key$2; keys$1.length > j; j++) { if (hasOwnProperty_1(NativeNumber, key$2 = keys$1[j]) && !hasOwnProperty_1(NumberWrapper, key$2)) { - defineProperty$4(NumberWrapper, key$2, getOwnPropertyDescriptor$8(NativeNumber, key$2)); + defineProperty$5(NumberWrapper, key$2, getOwnPropertyDescriptor$8(NativeNumber, key$2)); } } NumberWrapper.prototype = NumberPrototype; @@ -5111,7 +5176,7 @@ var doric = (function (exports) { // `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite - // eslint-disable-next-line es-x/no-number-isfinite -- safe + // eslint-disable-next-line es/no-number-isfinite -- safe var numberIsFinite = Number.isFinite || function isFinite(it) { return typeof it == 'number' && globalIsFinite(it); }; @@ -5124,7 +5189,7 @@ var doric = (function (exports) { // `IsIntegralNumber` abstract operation // https://tc39.es/ecma262/#sec-isintegralnumber - // eslint-disable-next-line es-x/no-number-isinteger -- safe + // eslint-disable-next-line es/no-number-isinteger -- safe var isIntegralNumber = Number.isInteger || function isInteger(it) { return !isObject(it) && isFinite(it) && floor$6(it) === it; }; @@ -5169,25 +5234,25 @@ var doric = (function (exports) { var trim$1 = stringTrim.trim; - var charAt$f = functionUncurryThis(''.charAt); - var n$ParseFloat = global_1.parseFloat; + var charAt$g = functionUncurryThis(''.charAt); + var $parseFloat = global_1.parseFloat; var Symbol$2 = global_1.Symbol; var ITERATOR$5 = Symbol$2 && Symbol$2.iterator; - var FORCED$c = 1 / n$ParseFloat(whitespaces$1 + '-0') !== -Infinity + var FORCED$c = 1 / $parseFloat(whitespaces$1 + '-0') !== -Infinity // MS Edge 18- broken with boxed symbols - || (ITERATOR$5 && !fails(function () { n$ParseFloat(Object(ITERATOR$5)); })); + || (ITERATOR$5 && !fails(function () { $parseFloat(Object(ITERATOR$5)); })); // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string var numberParseFloat = FORCED$c ? function parseFloat(string) { var trimmedString = trim$1(toString_1(string)); - var result = n$ParseFloat(trimmedString); - return result === 0 && charAt$f(trimmedString, 0) == '-' ? -0 : result; - } : n$ParseFloat; + var result = $parseFloat(trimmedString); + return result === 0 && charAt$g(trimmedString, 0) == '-' ? -0 : result; + } : $parseFloat; // `Number.parseFloat` method // https://tc39.es/ecma262/#sec-number.parseFloat - // eslint-disable-next-line es-x/no-number-parsefloat -- required for testing + // eslint-disable-next-line es/no-number-parsefloat -- required for testing _export({ target: 'Number', stat: true, forced: Number.parseFloat != numberParseFloat }, { parseFloat: numberParseFloat }); @@ -5213,7 +5278,7 @@ var doric = (function (exports) { // `Number.parseInt` method // https://tc39.es/ecma262/#sec-number.parseint - // eslint-disable-next-line es-x/no-number-parseint -- required for testing + // eslint-disable-next-line es/no-number-parseint -- required for testing _export({ target: 'Number', stat: true, forced: Number.parseInt != numberParseInt }, { parseInt: numberParseInt }); @@ -5225,31 +5290,31 @@ var doric = (function (exports) { var floor$5 = Math.floor; var pow$2 = Math.pow; var round = Math.round; - var un$ToExponential = functionUncurryThis(1.0.toExponential); + var nativeToExponential = functionUncurryThis(1.0.toExponential); var repeat$1 = functionUncurryThis(stringRepeat); var stringSlice$e = functionUncurryThis(''.slice); // Edge 17- - var ROUNDS_PROPERLY = un$ToExponential(-6.9e-11, 4) === '-6.9000e-11' + var ROUNDS_PROPERLY = nativeToExponential(-6.9e-11, 4) === '-6.9000e-11' // IE11- && Edge 14- - && un$ToExponential(1.255, 2) === '1.25e+0' + && nativeToExponential(1.255, 2) === '1.25e+0' // FF86-, V8 ~ Chrome 49-50 - && un$ToExponential(12345, 3) === '1.235e+4' + && nativeToExponential(12345, 3) === '1.235e+4' // FF86-, V8 ~ Chrome 49-50 - && un$ToExponential(25, 0) === '3e+1'; + && nativeToExponential(25, 0) === '3e+1'; // IE8- var THROWS_ON_INFINITY_FRACTION = fails(function () { - un$ToExponential(1, Infinity); + nativeToExponential(1, Infinity); }) && fails(function () { - un$ToExponential(1, -Infinity); + nativeToExponential(1, -Infinity); }); // Safari <11 && FF <50 var PROPER_NON_FINITE_THIS_CHECK = !fails(function () { - un$ToExponential(Infinity, Infinity); + nativeToExponential(Infinity, Infinity); }) && !fails(function () { - un$ToExponential(NaN, Infinity); + nativeToExponential(NaN, Infinity); }); var FORCED$a = !ROUNDS_PROPERLY || !THROWS_ON_INFINITY_FRACTION || !PROPER_NON_FINITE_THIS_CHECK; @@ -5258,13 +5323,13 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-number.prototype.toexponential _export({ target: 'Number', proto: true, forced: FORCED$a }, { toExponential: function toExponential(fractionDigits) { - var x = thisNumberValue(this); - if (fractionDigits === undefined) { return un$ToExponential(x); } + var x = thisNumberValue$1(this); + if (fractionDigits === undefined) { return nativeToExponential(x); } var f = toIntegerOrInfinity(fractionDigits); if (!$isFinite(x)) { return String(x); } // TODO: ES2018 increased the maximum number of fraction digits to 100, need to improve the implementation if (f < 0 || f > 20) { throw $RangeError$9('Incorrect fraction digits'); } - if (ROUNDS_PROPERLY) { return un$ToExponential(x, f); } + if (ROUNDS_PROPERLY) { return nativeToExponential(x, f); } var s = ''; var m = ''; var e = 0; @@ -5314,7 +5379,7 @@ var doric = (function (exports) { var floor$4 = Math.floor; var repeat = functionUncurryThis(stringRepeat); var stringSlice$d = functionUncurryThis(''.slice); - var un$ToFixed = functionUncurryThis(1.0.toFixed); + var nativeToFixed = functionUncurryThis(1.0.toFixed); var pow$1 = function (x, n, acc) { return n === 0 ? acc : n % 2 === 1 ? pow$1(x, n - 1, acc * x) : pow$1(x * x, n / 2, acc); @@ -5365,20 +5430,20 @@ var doric = (function (exports) { }; var FORCED$9 = fails(function () { - return un$ToFixed(0.00008, 3) !== '0.000' || - un$ToFixed(0.9, 0) !== '1' || - un$ToFixed(1.255, 2) !== '1.25' || - un$ToFixed(1000000000000000128.0, 0) !== '1000000000000000128'; + return nativeToFixed(0.00008, 3) !== '0.000' || + nativeToFixed(0.9, 0) !== '1' || + nativeToFixed(1.255, 2) !== '1.25' || + nativeToFixed(1000000000000000128.0, 0) !== '1000000000000000128'; }) || !fails(function () { // V8 ~ Android 4.3- - un$ToFixed({}); + nativeToFixed({}); }); // `Number.prototype.toFixed` method // https://tc39.es/ecma262/#sec-number.prototype.tofixed _export({ target: 'Number', proto: true, forced: FORCED$9 }, { toFixed: function toFixed(fractionDigits) { - var number = thisNumberValue(this); + var number = thisNumberValue$1(this); var fractDigits = toIntegerOrInfinity(fractionDigits); var data = [0, 0, 0, 0, 0, 0]; var sign = ''; @@ -5433,14 +5498,14 @@ var doric = (function (exports) { } }); - var un$ToPrecision = functionUncurryThis(1.0.toPrecision); + var nativeToPrecision = functionUncurryThis(1.0.toPrecision); var FORCED$8 = fails(function () { // IE7- - return un$ToPrecision(1, undefined) !== '1'; + return nativeToPrecision(1, undefined) !== '1'; }) || !fails(function () { // V8 ~ Android 4.3- - un$ToPrecision({}); + nativeToPrecision({}); }); // `Number.prototype.toPrecision` method @@ -5448,25 +5513,25 @@ var doric = (function (exports) { _export({ target: 'Number', proto: true, forced: FORCED$8 }, { toPrecision: function toPrecision(precision) { return precision === undefined - ? un$ToPrecision(thisNumberValue(this)) - : un$ToPrecision(thisNumberValue(this), precision); + ? nativeToPrecision(thisNumberValue$1(this)) + : nativeToPrecision(thisNumberValue$1(this), precision); } }); - // eslint-disable-next-line es-x/no-object-assign -- safe + // eslint-disable-next-line es/no-object-assign -- safe var $assign = Object.assign; - // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing - var defineProperty$3 = Object.defineProperty; + // eslint-disable-next-line es/no-object-defineproperty -- required for testing + var defineProperty$4 = Object.defineProperty; var concat$2 = functionUncurryThis([].concat); // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign var objectAssign = !$assign || fails(function () { // should have correct order of operations (Edge bug) - if (descriptors && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', { + if (descriptors && $assign({ b: 1 }, $assign(defineProperty$4({}, 'a', { enumerable: true, get: function () { - defineProperty$3(this, 'b', { + defineProperty$4(this, 'b', { value: 3, enumerable: false }); @@ -5475,7 +5540,7 @@ var doric = (function (exports) { // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; - // eslint-disable-next-line es-x/no-symbol -- safe + // eslint-disable-next-line es/no-symbol -- safe var symbol = Symbol(); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; @@ -5504,7 +5569,7 @@ var doric = (function (exports) { // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign - // eslint-disable-next-line es-x/no-object-assign -- required for testing + // eslint-disable-next-line es/no-object-assign -- required for testing _export({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== objectAssign }, { assign: objectAssign }); @@ -5527,7 +5592,7 @@ var doric = (function (exports) { if (engineWebkitVersion && engineWebkitVersion < 535) { return; } var key = Math.random(); // In FF throws only define methods - // eslint-disable-next-line no-undef, no-useless-call, es-x/no-legacy-object-prototype-accessor-methods -- required for testing + // eslint-disable-next-line no-undef, no-useless-call, es/no-legacy-object-prototype-accessor-methods -- required for testing __defineSetter__.call(null, key, function () { /* empty */ }); delete global_1[key]; }); @@ -5546,18 +5611,18 @@ var doric = (function (exports) { // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties - // eslint-disable-next-line es-x/no-object-defineproperties -- safe + // eslint-disable-next-line es/no-object-defineproperties -- safe _export({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties$1, sham: !descriptors }, { defineProperties: defineProperties$1 }); - var defineProperty$2 = objectDefineProperty.f; + var defineProperty$3 = objectDefineProperty.f; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty - // eslint-disable-next-line es-x/no-object-defineproperty -- safe - _export({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty$2, sham: !descriptors }, { - defineProperty: defineProperty$2 + // eslint-disable-next-line es/no-object-defineproperty -- safe + _export({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty$3, sham: !descriptors }, { + defineProperty: defineProperty$3 }); // `Object.prototype.__defineSetter__` method @@ -5615,7 +5680,7 @@ var doric = (function (exports) { var onFreeze$2 = internalMetadata.onFreeze; - // eslint-disable-next-line es-x/no-object-freeze -- safe + // eslint-disable-next-line es/no-object-freeze -- safe var $freeze = Object.freeze; var FAILS_ON_PRIMITIVES$8 = fails(function () { $freeze(1); }); @@ -5673,7 +5738,7 @@ var doric = (function (exports) { var getOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f; - // eslint-disable-next-line es-x/no-object-getownpropertynames -- required for testing + // eslint-disable-next-line es/no-object-getownpropertynames -- required for testing var FAILS_ON_PRIMITIVES$6 = fails(function () { return !Object.getOwnPropertyNames(1); }); // `Object.getOwnPropertyNames` method @@ -5700,7 +5765,7 @@ var doric = (function (exports) { // `SameValue` abstract operation // https://tc39.es/ecma262/#sec-samevalue - // eslint-disable-next-line es-x/no-object-is -- safe + // eslint-disable-next-line es/no-object-is -- safe var sameValue = Object.is || function is(x, y) { // eslint-disable-next-line no-self-compare -- NaN check return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; @@ -5714,12 +5779,12 @@ var doric = (function (exports) { // `Object.isExtensible` method // https://tc39.es/ecma262/#sec-object.isextensible - // eslint-disable-next-line es-x/no-object-isextensible -- safe + // eslint-disable-next-line es/no-object-isextensible -- safe _export({ target: 'Object', stat: true, forced: Object.isExtensible !== objectIsExtensible }, { isExtensible: objectIsExtensible }); - // eslint-disable-next-line es-x/no-object-isfrozen -- safe + // eslint-disable-next-line es/no-object-isfrozen -- safe var $isFrozen = Object.isFrozen; var FAILS_ON_PRIMITIVES$4 = fails(function () { $isFrozen(1); }); @@ -5733,7 +5798,7 @@ var doric = (function (exports) { } }); - // eslint-disable-next-line es-x/no-object-issealed -- safe + // eslint-disable-next-line es/no-object-issealed -- safe var $isSealed = Object.isSealed; var FAILS_ON_PRIMITIVES$3 = fails(function () { $isSealed(1); }); @@ -5795,7 +5860,7 @@ var doric = (function (exports) { - // eslint-disable-next-line es-x/no-object-preventextensions -- safe + // eslint-disable-next-line es/no-object-preventextensions -- safe var $preventExtensions = Object.preventExtensions; var FAILS_ON_PRIMITIVES$1 = fails(function () { $preventExtensions(1); }); @@ -5807,11 +5872,40 @@ var doric = (function (exports) { } }); + var defineBuiltInAccessor = function (target, name, descriptor) { + if (descriptor.get) { makeBuiltIn_1(descriptor.get, name, { getter: true }); } + if (descriptor.set) { makeBuiltIn_1(descriptor.set, name, { setter: true }); } + return objectDefineProperty.f(target, name, descriptor); + }; + + // eslint-disable-next-line es/no-object-getprototypeof -- safe + var getPrototypeOf = Object.getPrototypeOf; + // eslint-disable-next-line es/no-object-setprototypeof -- safe + var setPrototypeOf = Object.setPrototypeOf; + var ObjectPrototype$1 = Object.prototype; + var PROTO = '__proto__'; + + // `Object.prototype.__proto__` accessor + // https://tc39.es/ecma262/#sec-object.prototype.__proto__ + if (descriptors && getPrototypeOf && setPrototypeOf && !(PROTO in ObjectPrototype$1)) { try { + defineBuiltInAccessor(ObjectPrototype$1, PROTO, { + configurable: true, + get: function __proto__() { + return getPrototypeOf(toObject(this)); + }, + set: function __proto__(proto) { + var O = requireObjectCoercible(this); + if (!isObject(proto) && proto !== null || !isObject(O)) { return; } + setPrototypeOf(O, proto); + } + }); + } catch (error) { /* empty */ } } + var onFreeze = internalMetadata.onFreeze; - // eslint-disable-next-line es-x/no-object-seal -- safe + // eslint-disable-next-line es/no-object-seal -- safe var $seal = Object.seal; var FAILS_ON_PRIMITIVES = fails(function () { $seal(1); }); @@ -5882,11 +5976,11 @@ var doric = (function (exports) { var counter = 0; var queue$1 = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; - var location, defer, channel, port; + var $location, defer, channel, port; try { // Deno throws a ReferenceError on `location` access without `--location` flag - location = global_1.location; + $location = global_1.location; } catch (error) { /* empty */ } var run = function (id) { @@ -5909,7 +6003,7 @@ var doric = (function (exports) { var post = function (id) { // old engines have not location.origin - global_1.postMessage(String$1(id), location.protocol + '//' + location.host); + global_1.postMessage(String$1(id), $location.protocol + '//' + $location.host); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: @@ -5950,7 +6044,7 @@ var doric = (function (exports) { global_1.addEventListener && isCallable(global_1.postMessage) && !global_1.importScripts && - location && location.protocol !== 'file:' && + $location && $location.protocol !== 'file:' && !fails(post) ) { defer = post; @@ -6147,10 +6241,12 @@ var doric = (function (exports) { SUBCLASSING: SUBCLASSING }; + var $TypeError$j = TypeError; + var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) { throw TypeError('Bad Promise constructor'); } + if (resolve !== undefined || reject !== undefined) { throw $TypeError$j('Bad Promise constructor'); } resolve = $$resolve; reject = $$reject; }); @@ -6665,7 +6761,7 @@ var doric = (function (exports) { // MS Edge argumentsList argument is optional var OPTIONAL_ARGUMENTS_LIST = !fails(function () { - // eslint-disable-next-line es-x/no-reflect -- required for testing + // eslint-disable-next-line es/no-reflect -- required for testing Reflect.apply(function () { /* empty */ }); }); @@ -6726,7 +6822,7 @@ var doric = (function (exports) { // MS Edge has broken Reflect.defineProperty - throwing instead of returning false var ERROR_INSTEAD_OF_FALSE = fails(function () { - // eslint-disable-next-line es-x/no-reflect -- required for testing + // eslint-disable-next-line es/no-reflect -- required for testing Reflect.defineProperty(objectDefineProperty.f({}, 1, { value: 1 }), 1, { value: 2 }); }); @@ -6863,7 +6959,7 @@ var doric = (function (exports) { var MS_EDGE_BUG = fails(function () { var Constructor = function () { /* empty */ }; var object = objectDefineProperty.f(new Constructor(), 'a', { configurable: true }); - // eslint-disable-next-line es-x/no-reflect -- required for testing + // eslint-disable-next-line es/no-reflect -- required for testing return Reflect.set(Constructor.prototype, 'a', 1, object) !== false; }); @@ -6991,7 +7087,7 @@ var doric = (function (exports) { var RegExpPrototype$6 = NativeRegExp.prototype; var SyntaxError$2 = global_1.SyntaxError; var exec$7 = functionUncurryThis(RegExpPrototype$6.exec); - var charAt$e = functionUncurryThis(''.charAt); + var charAt$f = functionUncurryThis(''.charAt); var replace$7 = functionUncurryThis(''.replace); var stringIndexOf$4 = functionUncurryThis(''.indexOf); var stringSlice$c = functionUncurryThis(''.slice); @@ -7020,9 +7116,9 @@ var doric = (function (exports) { var brackets = false; var chr; for (; index <= length; index++) { - chr = charAt$e(string, index); + chr = charAt$f(string, index); if (chr === '\\') { - result += chr + charAt$e(string, ++index); + result += chr + charAt$f(string, ++index); continue; } if (!brackets && chr === '.') { @@ -7049,9 +7145,9 @@ var doric = (function (exports) { var groupname = ''; var chr; for (; index <= length; index++) { - chr = charAt$e(string, index); + chr = charAt$f(string, index); if (chr === '\\') { - chr = chr + charAt$e(string, ++index); + chr = chr + charAt$f(string, ++index); } else if (chr === ']') { brackets = false; } else if (!brackets) { switch (true) { @@ -7155,16 +7251,10 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-get-regexp-@@species setSpecies('RegExp'); - var defineBuiltInAccessor = function (target, name, descriptor) { - if (descriptor.get) { makeBuiltIn_1(descriptor.get, name, { getter: true }); } - if (descriptor.set) { makeBuiltIn_1(descriptor.set, name, { setter: true }); } - return objectDefineProperty.f(target, name, descriptor); - }; - var getInternalState$a = internalState.get; var RegExpPrototype$5 = RegExp.prototype; - var $TypeError$j = TypeError; + var $TypeError$i = TypeError; // `RegExp.prototype.dotAll` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.dotall @@ -7178,7 +7268,7 @@ var doric = (function (exports) { if (classofRaw(this) === 'RegExp') { return !!getInternalState$a(this).dotAll; } - throw $TypeError$j('Incompatible receiver, RegExp required'); + throw $TypeError$i('Incompatible receiver, RegExp required'); } }); } @@ -7199,7 +7289,7 @@ var doric = (function (exports) { var nativeReplace = shared('native-string-replace', String.prototype.replace); var nativeExec = RegExp.prototype.exec; var patchedExec = nativeExec; - var charAt$d = functionUncurryThis(''.charAt); + var charAt$e = functionUncurryThis(''.charAt); var indexOf$1 = functionUncurryThis(''.indexOf); var replace$6 = functionUncurryThis(''.replace); var stringSlice$b = functionUncurryThis(''.slice); @@ -7249,7 +7339,7 @@ var doric = (function (exports) { strCopy = stringSlice$b(str, re.lastIndex); // Support anchored sticky behavior. - if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$d(str, re.lastIndex - 1) !== '\n')) { + if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$e(str, re.lastIndex - 1) !== '\n')) { source = '(?: ' + source + ')'; strCopy = ' ' + strCopy; charsAdded++; @@ -7326,7 +7416,7 @@ var doric = (function (exports) { var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy'; var addGetter = function (key, chr) { - // eslint-disable-next-line es-x/no-object-defineproperty -- safe + // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(O, key, { get: function () { calls += chr; return true; @@ -7345,7 +7435,7 @@ var doric = (function (exports) { for (var key in pairs) { addGetter(key, pairs[key]); } - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var result = Object.getOwnPropertyDescriptor(RegExpPrototype$4, 'flags').get.call(O); return result !== expected || calls !== expected; @@ -7364,7 +7454,7 @@ var doric = (function (exports) { var getInternalState$8 = internalState.get; var RegExpPrototype$3 = RegExp.prototype; - var $TypeError$i = TypeError; + var $TypeError$h = TypeError; // `RegExp.prototype.sticky` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky @@ -7378,7 +7468,7 @@ var doric = (function (exports) { if (classofRaw(this) === 'RegExp') { return !!getInternalState$8(this).sticky; } - throw $TypeError$i('Incompatible receiver, RegExp required'); + throw $TypeError$h('Incompatible receiver, RegExp required'); } }); } @@ -7401,20 +7491,20 @@ var doric = (function (exports) { return re.test('abc') === true && execCalled; }(); - var $TypeError$h = TypeError; - var un$Test = functionUncurryThis(/./.test); + var nativeTest = /./.test; // `RegExp.prototype.test` method // https://tc39.es/ecma262/#sec-regexp.prototype.test _export({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, { - test: function (str) { - var exec = this.exec; - if (!isCallable(exec)) { return un$Test(this, str); } - var result = functionCall(exec, this, str); - if (result !== null && !isObject(result)) { - throw new $TypeError$h('RegExp exec method returned something other than an Object or null'); - } - return !!result; + test: function (S) { + var R = anObject(this); + var string = toString_1(S); + var exec = R.exec; + if (!isCallable(exec)) { return functionCall(nativeTest, R, string); } + var result = functionCall(exec, R, string); + if (result === null) { return false; } + anObject(result); + return true; } }); @@ -7427,11 +7517,11 @@ var doric = (function (exports) { var TO_STRING = 'toString'; var RegExpPrototype$2 = RegExp.prototype; - var n$ToString = RegExpPrototype$2[TO_STRING]; + var nativeToString = RegExpPrototype$2[TO_STRING]; - var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); + var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); // FF44- RegExp#toString has a wrong name - var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && n$ToString.name != TO_STRING; + var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && nativeToString.name != TO_STRING; // `RegExp.prototype.toString` method // https://tc39.es/ecma262/#sec-regexp.prototype.tostring @@ -7450,10 +7540,10 @@ var doric = (function (exports) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); - var charAt$c = functionUncurryThis(''.charAt); + var charAt$d = functionUncurryThis(''.charAt); var FORCED$4 = fails(function () { - // eslint-disable-next-line es-x/no-array-string-prototype-at -- safe + // eslint-disable-next-line es/no-array-string-prototype-at -- safe return '𠮷'.at(-2) !== '\uD842'; }); @@ -7465,12 +7555,12 @@ var doric = (function (exports) { var len = S.length; var relativeIndex = toIntegerOrInfinity(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; - return (k < 0 || k >= len) ? undefined : charAt$c(S, k); + return (k < 0 || k >= len) ? undefined : charAt$d(S, k); } }); - var charAt$b = functionUncurryThis(''.charAt); - var charCodeAt$2 = functionUncurryThis(''.charCodeAt); + var charAt$c = functionUncurryThis(''.charAt); + var charCodeAt$4 = functionUncurryThis(''.charCodeAt); var stringSlice$a = functionUncurryThis(''.slice); var createMethod$1 = function (CONVERT_TO_STRING) { @@ -7480,11 +7570,11 @@ var doric = (function (exports) { var size = S.length; var first, second; if (position < 0 || position >= size) { return CONVERT_TO_STRING ? '' : undefined; } - first = charCodeAt$2(S, position); + first = charCodeAt$4(S, position); return first < 0xD800 || first > 0xDBFF || position + 1 === size - || (second = charCodeAt$2(S, position + 1)) < 0xDC00 || second > 0xDFFF + || (second = charCodeAt$4(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING - ? charAt$b(S, position) + ? charAt$c(S, position) : first : CONVERT_TO_STRING ? stringSlice$a(S, position, position + 2) @@ -7541,9 +7631,9 @@ var doric = (function (exports) { - // eslint-disable-next-line es-x/no-string-prototype-endswith -- safe - var un$EndsWith = functionUncurryThis(''.endsWith); - var slice$2 = functionUncurryThis(''.slice); + // eslint-disable-next-line es/no-string-prototype-endswith -- safe + var nativeEndsWith = functionUncurryThisClause(''.endsWith); + var slice$2 = functionUncurryThisClause(''.slice); var min$7 = Math.min; var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegexpLogic('endsWith'); @@ -7563,17 +7653,17 @@ var doric = (function (exports) { var len = that.length; var end = endPosition === undefined ? len : min$7(toLength(endPosition), len); var search = toString_1(searchString); - return un$EndsWith - ? un$EndsWith(that, search, end) + return nativeEndsWith + ? nativeEndsWith(that, search, end) : slice$2(that, end - search.length, end) === search; } }); var $RangeError$7 = RangeError; var fromCharCode$3 = String.fromCharCode; - // eslint-disable-next-line es-x/no-string-fromcodepoint -- required for testing + // eslint-disable-next-line es/no-string-fromcodepoint -- required for testing var $fromCodePoint = String.fromCodePoint; - var join$6 = functionUncurryThis([].join); + var join$7 = functionUncurryThis([].join); // length should be 1, old FF problem var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1; @@ -7595,7 +7685,7 @@ var doric = (function (exports) { elements[i] = code < 0x10000 ? fromCharCode$3(code) : fromCharCode$3(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00); - } return join$6(elements, ''); + } return join$7(elements, ''); } }); @@ -7613,7 +7703,8 @@ var doric = (function (exports) { } }); - var charAt$a = stringMultibyte.charAt; + var charAt$b = stringMultibyte.charAt; + @@ -7624,7 +7715,7 @@ var doric = (function (exports) { // `String.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-string.prototype-@@iterator - defineIterator(String, 'String', function (iterated) { + iteratorDefine(String, 'String', function (iterated) { setInternalState$d(this, { type: STRING_ITERATOR$1, string: toString_1(iterated), @@ -7637,10 +7728,10 @@ var doric = (function (exports) { var string = state.string; var index = state.index; var point; - if (index >= string.length) { return { value: undefined, done: true }; } - point = charAt$a(string, index); + if (index >= string.length) { return createIterResultObject(undefined, true); } + point = charAt$b(string, index); state.index += point.length; - return { value: point, done: false }; + return createIterResultObject(point, false); }); // TODO: Remove from `core-js@4` since it's moved to entry points @@ -7694,9 +7785,9 @@ var doric = (function (exports) { !DELEGATES_TO_EXEC || FORCED ) { - var uncurriedNativeRegExpMethod = functionUncurryThis(/./[SYMBOL]); + var uncurriedNativeRegExpMethod = functionUncurryThisClause(/./[SYMBOL]); var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { - var uncurriedNativeMethod = functionUncurryThis(nativeMethod); + var uncurriedNativeMethod = functionUncurryThisClause(nativeMethod); var $exec = regexp.exec; if ($exec === regexpExec || $exec === RegExpPrototype$1.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { @@ -7717,12 +7808,12 @@ var doric = (function (exports) { if (SHAM) { createNonEnumerableProperty(RegExpPrototype$1[SYMBOL], 'sham', true); } }; - var charAt$9 = stringMultibyte.charAt; + var charAt$a = stringMultibyte.charAt; // `AdvanceStringIndex` abstract operation // https://tc39.es/ecma262/#sec-advancestringindex var advanceStringIndex = function (S, index, unicode) { - return index + (unicode ? charAt$9(S, index).length : 1); + return index + (unicode ? charAt$a(S, index).length : 1); }; var $TypeError$f = TypeError; @@ -7747,7 +7838,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-string.prototype.match function match(regexp) { var O = requireObjectCoercible(this); - var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH); + var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH); return matcher ? functionCall(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString_1(O)); }, // `RegExp.prototype[@@match]` method @@ -7777,7 +7868,9 @@ var doric = (function (exports) { ]; }); - /* eslint-disable es-x/no-string-prototype-matchall -- safe */ + /* eslint-disable es/no-string-prototype-matchall -- safe */ + + @@ -7806,14 +7899,14 @@ var doric = (function (exports) { var getInternalState$6 = internalState.getterFor(REGEXP_STRING_ITERATOR); var RegExpPrototype = RegExp.prototype; var $TypeError$e = TypeError; - var stringIndexOf$2 = functionUncurryThis(''.indexOf); - var un$MatchAll = functionUncurryThis(''.matchAll); + var stringIndexOf$2 = functionUncurryThisClause(''.indexOf); + var nativeMatchAll = functionUncurryThisClause(''.matchAll); - var WORKS_WITH_NON_GLOBAL_REGEX = !!un$MatchAll && !fails(function () { - un$MatchAll('a', /./); + var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails(function () { + nativeMatchAll('a', /./); }); - var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, $global, fullUnicode) { + var $RegExpStringIterator = iteratorCreateConstructor(function RegExpStringIterator(regexp, string, $global, fullUnicode) { setInternalState$c(this, { type: REGEXP_STRING_ITERATOR, regexp: regexp, @@ -7824,17 +7917,20 @@ var doric = (function (exports) { }); }, REGEXP_STRING, function next() { var state = getInternalState$6(this); - if (state.done) { return { value: undefined, done: true }; } + if (state.done) { return createIterResultObject(undefined, true); } var R = state.regexp; var S = state.string; var match = regexpExecAbstract(R, S); - if (match === null) { return { value: undefined, done: state.done = true }; } + if (match === null) { + state.done = true; + return createIterResultObject(undefined, true); + } if (state.global) { if (toString_1(match[0]) === '') { R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode); } - return { value: match, done: false }; + return createIterResultObject(match, false); } state.done = true; - return { value: match, done: false }; + return createIterResultObject(match, false); }); var $matchAll = function (string) { @@ -7856,16 +7952,16 @@ var doric = (function (exports) { matchAll: function matchAll(regexp) { var O = requireObjectCoercible(this); var flags, S, matcher, rx; - if (regexp != null) { + if (!isNullOrUndefined(regexp)) { if (isRegexp(regexp)) { flags = toString_1(requireObjectCoercible(regexpGetFlags(regexp))); if (!~stringIndexOf$2(flags, 'g')) { throw $TypeError$e('`.matchAll` does not allow non-global regexes'); } } - if (WORKS_WITH_NON_GLOBAL_REGEX) { return un$MatchAll(O, regexp); } + if (WORKS_WITH_NON_GLOBAL_REGEX) { return nativeMatchAll(O, regexp); } matcher = getMethod(regexp, MATCH_ALL); if (matcher === undefined && isPure && classofRaw(regexp) == 'RegExp') { matcher = $matchAll; } if (matcher) { return functionCall(matcher, regexp, O); } - } else if (WORKS_WITH_NON_GLOBAL_REGEX) { return un$MatchAll(O, regexp); } + } else if (WORKS_WITH_NON_GLOBAL_REGEX) { return nativeMatchAll(O, regexp); } S = toString_1(O); rx = new RegExp(regexp, 'g'); return rx[MATCH_ALL](S); @@ -7902,7 +7998,7 @@ var doric = (function (exports) { }); var push$f = functionUncurryThis([].push); - var join$5 = functionUncurryThis([].join); + var join$6 = functionUncurryThis([].join); // `String.raw` method // https://tc39.es/ecma262/#sec-string.raw @@ -7917,7 +8013,7 @@ var doric = (function (exports) { var i = 0; while (literalSegments > i) { push$f(elements, toString_1(rawTemplate[i++])); - if (i === literalSegments) { return join$5(elements, ''); } + if (i === literalSegments) { return join$6(elements, ''); } if (i < argumentsLength) { push$f(elements, toString_1(arguments$1[i])); } } } @@ -7930,7 +8026,7 @@ var doric = (function (exports) { }); var floor$3 = Math.floor; - var charAt$8 = functionUncurryThis(''.charAt); + var charAt$9 = functionUncurryThis(''.charAt); var replace$5 = functionUncurryThis(''.replace); var stringSlice$9 = functionUncurryThis(''.slice); var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g; @@ -7948,7 +8044,7 @@ var doric = (function (exports) { } return replace$5(replacement, symbols, function (match, ch) { var capture; - switch (charAt$8(ch, 0)) { + switch (charAt$9(ch, 0)) { case '$': return '$'; case '&': return matched; case '`': return stringSlice$9(str, 0, position); @@ -7962,7 +8058,7 @@ var doric = (function (exports) { if (n > m) { var f = floor$3(n / 10); if (f === 0) { return match; } - if (f <= m) { return captures[f - 1] === undefined ? charAt$8(ch, 1) : captures[f - 1] + charAt$8(ch, 1); } + if (f <= m) { return captures[f - 1] === undefined ? charAt$9(ch, 1) : captures[f - 1] + charAt$9(ch, 1); } return match; } capture = captures[n - 1]; @@ -8018,7 +8114,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = requireObjectCoercible(this); - var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE$1); + var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE$1); return replacer ? functionCall(replacer, searchValue, O, replaceValue) : functionCall(nativeReplace, toString_1(O), searchValue, replaceValue); @@ -8112,7 +8208,7 @@ var doric = (function (exports) { var position = 0; var endOfLastMatch = 0; var result = ''; - if (searchValue != null) { + if (!isNullOrUndefined(searchValue)) { IS_REG_EXP = isRegexp(searchValue); if (IS_REG_EXP) { flags = toString_1(requireObjectCoercible(regexpGetFlags(searchValue))); @@ -8152,7 +8248,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-string.prototype.search function search(regexp) { var O = requireObjectCoercible(this); - var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH); + var searcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, SEARCH); return searcher ? functionCall(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString_1(O)); }, // `RegExp.prototype[@@search]` method @@ -8252,7 +8348,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = requireObjectCoercible(this); - var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT); + var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT); return splitter ? functionCall(splitter, separator, O, limit) : functionCall(internalSplit, toString_1(O), separator, limit); @@ -8319,9 +8415,9 @@ var doric = (function (exports) { - // eslint-disable-next-line es-x/no-string-prototype-startswith -- safe - var un$StartsWith = functionUncurryThis(''.startsWith); - var stringSlice$5 = functionUncurryThis(''.slice); + // eslint-disable-next-line es/no-string-prototype-startswith -- safe + var nativeStartsWith = functionUncurryThisClause(''.startsWith); + var stringSlice$5 = functionUncurryThisClause(''.slice); var min$4 = Math.min; var CORRECT_IS_REGEXP_LOGIC = correctIsRegexpLogic('startsWith'); @@ -8339,8 +8435,8 @@ var doric = (function (exports) { notARegexp(searchString); var index = toLength(min$4(arguments.length > 1 ? arguments[1] : undefined, that.length)); var search = toString_1(searchString); - return un$StartsWith - ? un$StartsWith(that, search, index) + return nativeStartsWith + ? nativeStartsWith(that, search, index) : stringSlice$5(that, index, index + search.length) === search; } }); @@ -8349,7 +8445,7 @@ var doric = (function (exports) { var max$3 = Math.max; var min$3 = Math.min; - // eslint-disable-next-line unicorn/prefer-string-slice, es-x/no-string-prototype-substr -- required for testing + // eslint-disable-next-line unicorn/prefer-string-slice, es/no-string-prototype-substr -- required for testing var FORCED$3 = !''.substr || 'ab'.substr(-1) !== 'b'; // `String.prototype.substr` method @@ -8404,12 +8500,12 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#String.prototype.trimright var stringTrimEnd = stringTrimForced('trimEnd') ? function trimEnd() { return $trimEnd(this); - // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe + // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimEnd; // `String.prototype.trimRight` method // https://tc39.es/ecma262/#sec-string.prototype.trimend - // eslint-disable-next-line es-x/no-string-prototype-trimleft-trimright -- safe + // eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe _export({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimRight !== stringTrimEnd }, { trimRight: stringTrimEnd }); @@ -8421,7 +8517,7 @@ var doric = (function (exports) { // `String.prototype.trimEnd` method // https://tc39.es/ecma262/#sec-string.prototype.trimend - // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe + // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe _export({ target: 'String', proto: true, name: 'trimEnd', forced: ''.trimEnd !== stringTrimEnd }, { trimEnd: stringTrimEnd }); @@ -8434,12 +8530,12 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#String.prototype.trimleft var stringTrimStart = stringTrimForced('trimStart') ? function trimStart() { return $trimStart(this); - // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe + // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimStart; // `String.prototype.trimLeft` method // https://tc39.es/ecma262/#sec-string.prototype.trimleft - // eslint-disable-next-line es-x/no-string-prototype-trimleft-trimright -- safe + // eslint-disable-next-line es/no-string-prototype-trimleft-trimright -- safe _export({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimLeft !== stringTrimStart }, { trimLeft: stringTrimStart }); @@ -8451,7 +8547,7 @@ var doric = (function (exports) { // `String.prototype.trimStart` method // https://tc39.es/ecma262/#sec-string.prototype.trimstart - // eslint-disable-next-line es-x/no-string-prototype-trimstart-trimend -- safe + // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe _export({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimStart !== stringTrimStart }, { trimStart: stringTrimStart }); @@ -8620,8 +8716,26 @@ var doric = (function (exports) { return offset; }; + var slice$1 = functionUncurryThis(''.slice); + + var isBigIntArray = function (it) { + return slice$1(classof(it), 0, 3) === 'Big'; + }; + + var $TypeError$c = TypeError; + + // `ToBigInt` abstract operation + // https://tc39.es/ecma262/#sec-tobigint + var toBigInt = function (argument) { + var prim = toPrimitive(argument, 'number'); + if (typeof prim == 'number') { throw $TypeError$c("Can't convert number to bigint"); } + // eslint-disable-next-line es/no-bigint -- safe + return BigInt(prim); + }; + var aTypedArrayConstructor$3 = arrayBufferViewCore.aTypedArrayConstructor; + var typedArrayFrom = function from(source /* , mapfn, thisArg */) { var C = aConstructor(this); var O = toObject(source); @@ -8629,7 +8743,7 @@ var doric = (function (exports) { var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var iteratorMethod = getIteratorMethod(O); - var i, length, result, step, iterator, next; + var i, length, result, thisIsBigIntArray, value, step, iterator, next; if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { iterator = getIterator(O, iteratorMethod); next = iterator.next; @@ -8643,8 +8757,11 @@ var doric = (function (exports) { } length = lengthOfArrayLike(O); result = new (aTypedArrayConstructor$3(C))(length); + thisIsBigIntArray = isBigIntArray(result); for (i = 0; length > i; i++) { - result[i] = mapping ? mapfn(O[i], i) : O[i]; + value = mapping ? mapfn(O[i], i) : O[i]; + // FF30- typed arrays doesn't properly convert objects to typed array values + result[i] = thisIsBigIntArray ? toBigInt(value) : +value; } return result; }; @@ -8999,25 +9116,14 @@ var doric = (function (exports) { return $every$1(aTypedArray$u(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); - var $TypeError$c = TypeError; - - // `ToBigInt` abstract operation - // https://tc39.es/ecma262/#sec-tobigint - var toBigInt = function (argument) { - var prim = toPrimitive(argument, 'number'); - if (typeof prim == 'number') { throw $TypeError$c("Can't convert number to bigint"); } - // eslint-disable-next-line es-x/no-bigint -- safe - return BigInt(prim); - }; - var aTypedArray$t = arrayBufferViewCore.aTypedArray; var exportTypedArrayMethod$u = arrayBufferViewCore.exportTypedArrayMethod; - var slice$1 = functionUncurryThis(''.slice); + var slice = functionUncurryThis(''.slice); // V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18 var CONVERSION_BUG = fails(function () { var count = 0; - // eslint-disable-next-line es-x/no-typed-arrays -- safe + // eslint-disable-next-line es/no-typed-arrays -- safe new Int8Array(2).fill({ valueOf: function () { return count++; } }); return count !== 1; }); @@ -9027,7 +9133,7 @@ var doric = (function (exports) { exportTypedArrayMethod$u('fill', function fill(value /* , start, end */) { var length = arguments.length; aTypedArray$t(this); - var actualValue = slice$1(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value; + var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value; return functionCall(arrayFill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined); }, CONVERSION_BUG); @@ -9288,7 +9394,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$e = arrayBufferViewCore.exportTypedArrayMethod; var WORKS_WITH_OBJECTS_AND_GEERIC_ON_TYPED_ARRAYS = !fails(function () { - // eslint-disable-next-line es-x/no-typed-arrays -- required for testing + // eslint-disable-next-line es/no-typed-arrays -- required for testing var array = new Uint8ClampedArray(2); functionCall($set, array, { length: 1, 0: 3 }, 1); return array[1] !== 3; @@ -9320,7 +9426,7 @@ var doric = (function (exports) { var exportTypedArrayMethod$d = arrayBufferViewCore.exportTypedArrayMethod; var FORCED$2 = fails(function () { - // eslint-disable-next-line es-x/no-typed-arrays -- required for testing + // eslint-disable-next-line es/no-typed-arrays -- required for testing new Int8Array(1).slice(); }); @@ -9350,16 +9456,16 @@ var doric = (function (exports) { var aTypedArray$a = arrayBufferViewCore.aTypedArray; var exportTypedArrayMethod$b = arrayBufferViewCore.exportTypedArrayMethod; var Uint16Array = global_1.Uint16Array; - var un$Sort = Uint16Array && functionUncurryThis(Uint16Array.prototype.sort); + var nativeSort = Uint16Array && functionUncurryThisClause(Uint16Array.prototype.sort); // WebKit - var ACCEPT_INCORRECT_ARGUMENTS = !!un$Sort && !(fails(function () { - un$Sort(new Uint16Array(2), null); + var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () { + nativeSort(new Uint16Array(2), null); }) && fails(function () { - un$Sort(new Uint16Array(2), {}); + nativeSort(new Uint16Array(2), {}); })); - var STABLE_SORT = !!un$Sort && !fails(function () { + var STABLE_SORT = !!nativeSort && !fails(function () { // feature detection can be too slow, so check engines versions if (engineV8Version) { return engineV8Version < 74; } if (engineFfVersion) { return engineFfVersion < 67; } @@ -9376,7 +9482,7 @@ var doric = (function (exports) { expected[index] = index - 2 * mod + 3; } - un$Sort(array, function (a, b) { + nativeSort(array, function (a, b) { return (a / 4 | 0) - (b / 4 | 0); }); @@ -9401,7 +9507,7 @@ var doric = (function (exports) { // https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort exportTypedArrayMethod$b('sort', function sort(comparefn) { if (comparefn !== undefined) { aCallable(comparefn); } - if (STABLE_SORT) { return un$Sort(this, comparefn); } + if (STABLE_SORT) { return nativeSort(this, comparefn); } return arraySort(aTypedArray$a(this), getSortCompare(comparefn)); }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS); @@ -9457,11 +9563,11 @@ var doric = (function (exports) { var Uint8Array$1 = global_1.Uint8Array; var Uint8ArrayPrototype = Uint8Array$1 && Uint8Array$1.prototype || {}; var arrayToString = [].toString; - var join$4 = functionUncurryThis([].join); + var join$5 = functionUncurryThis([].join); if (fails(function () { arrayToString.call({}); })) { arrayToString = function toString() { - return join$4(this); + return join$5(this); }; } @@ -9472,7 +9578,7 @@ var doric = (function (exports) { exportTypedArrayMethod$8('toString', arrayToString, IS_NOT_ARRAY_METHOD); var fromCharCode$2 = String.fromCharCode; - var charAt$7 = functionUncurryThis(''.charAt); + var charAt$8 = functionUncurryThis(''.charAt); var exec$5 = functionUncurryThis(/./.exec); var stringSlice$3 = functionUncurryThis(''.slice); @@ -9489,9 +9595,9 @@ var doric = (function (exports) { var index = 0; var chr, part; while (index < length) { - chr = charAt$7(str, index++); + chr = charAt$8(str, index++); if (chr === '%') { - if (charAt$7(str, index) === 'u') { + if (charAt$8(str, index) === 'u') { part = stringSlice$3(str, index + 1, index + 5); if (exec$5(hex4, part)) { result += fromCharCode$2(parseInt(part, 16)); @@ -9521,6 +9627,7 @@ var doric = (function (exports) { + var setInternalState$b = internalState.set; var internalStateGetterFor = internalState.getterFor; var find$1 = arrayIteration.find; @@ -9574,7 +9681,7 @@ var doric = (function (exports) { id: id++, frozen: undefined }); - if (iterable != undefined) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } + if (!isNullOrUndefined(iterable)) { iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); } }); var Prototype = Constructor.prototype; @@ -9659,7 +9766,7 @@ var doric = (function (exports) { // IE11 WeakMap frozen keys fix // We can't use feature detection because it crash some old IE builds // https://github.com/zloirock/core-js/issues/485 - if (nativeWeakMap && IS_IE11) { + if (weakMapBasicDetection && IS_IE11) { InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); internalMetadata.enable(); var WeakMapPrototype = $WeakMap.prototype; @@ -9743,16 +9850,13 @@ var doric = (function (exports) { var asyncFromSyncIteratorContinuation = function (result, resolve, reject) { var done = result.done; Promise$3.resolve(result.value).then(function (value) { - resolve({ done: done, value: value }); + resolve(createIterResultObject(value, done)); }, reject); }; - var AsyncFromSyncIterator = function AsyncIterator(iterator) { - setInternalState$a(this, { - type: ASYNC_FROM_SYNC_ITERATOR, - iterator: anObject(iterator), - next: iterator.next - }); + var AsyncFromSyncIterator = function AsyncIterator(iteratorRecord) { + iteratorRecord.type = ASYNC_FROM_SYNC_ITERATOR; + setInternalState$a(this, iteratorRecord); }; AsyncFromSyncIterator.prototype = defineBuiltIns(objectCreate(asyncIteratorPrototype), { @@ -9767,7 +9871,7 @@ var doric = (function (exports) { var iterator = getInternalState$5(this).iterator; return new Promise$3(function (resolve, reject) { var $return = getMethod(iterator, 'return'); - if ($return === undefined) { return resolve({ done: true, value: undefined }); } + if ($return === undefined) { return resolve(createIterResultObject(undefined, true)); } var result = anObject(functionCall($return, iterator)); asyncFromSyncIteratorContinuation(result, resolve, reject); }); @@ -9776,17 +9880,6 @@ var doric = (function (exports) { var asyncFromSyncIterator = AsyncFromSyncIterator; - var ASYNC_ITERATOR$2 = wellKnownSymbol('asyncIterator'); - - var getAsyncIterator = function (it, usingIterator) { - var method = arguments.length < 2 ? getMethod(it, ASYNC_ITERATOR$2) : usingIterator; - return method ? anObject(functionCall(method, it)) : new asyncFromSyncIterator(getIterator(it)); - }; - - var entryVirtual = function (CONSTRUCTOR) { - return global_1[CONSTRUCTOR].prototype; - }; - var getIteratorDirect = function (obj) { return { iterator: obj, @@ -9794,6 +9887,17 @@ var doric = (function (exports) { }; }; + var ASYNC_ITERATOR$2 = wellKnownSymbol('asyncIterator'); + + var getAsyncIterator = function (it, usingIterator) { + var method = arguments.length < 2 ? getMethod(it, ASYNC_ITERATOR$2) : usingIterator; + return method ? anObject(functionCall(method, it)) : new asyncFromSyncIterator(getIteratorDirect(getIterator(it))); + }; + + var entryVirtual = function (CONSTRUCTOR) { + return global_1[CONSTRUCTOR].prototype; + }; + var asyncIteratorClose = function (iterator, method, argument, reject) { try { var returnMethod = getMethod(iterator, 'return'); @@ -9819,6 +9923,7 @@ var doric = (function (exports) { + var createMethod = function (TYPE) { var IS_TO_ARRAY = TYPE == 0; var IS_FOR_EACH = TYPE == 1; @@ -9829,7 +9934,7 @@ var doric = (function (exports) { var Promise = getBuiltIn('Promise'); var iterator = record.iterator; var next = record.next; - var index = 0; + var counter = 0; var MAPPING = fn !== undefined; if (MAPPING || !IS_TO_ARRAY) { aCallable(fn); } @@ -9840,36 +9945,41 @@ var doric = (function (exports) { var loop = function () { try { - if (IS_TO_ARRAY && MAPPING) { try { - doesNotExceedSafeInteger(index); + if (MAPPING) { try { + doesNotExceedSafeInteger(counter); } catch (error5) { ifAbruptCloseAsyncIterator(error5); } } Promise.resolve(anObject(functionCall(next, iterator))).then(function (step) { try { if (anObject(step).done) { if (IS_TO_ARRAY) { - target.length = index; + target.length = counter; resolve(target); } else { resolve(IS_SOME ? false : IS_EVERY || undefined); } } else { var value = step.value; try { if (MAPPING) { - Promise.resolve(IS_TO_ARRAY ? fn(value, index) : fn(value)).then(function (result) { + var result = fn(value, counter); + + var handler = function ($result) { if (IS_FOR_EACH) { loop(); } else if (IS_EVERY) { - result ? loop() : asyncIteratorClose(iterator, resolve, false, reject); + $result ? loop() : asyncIteratorClose(iterator, resolve, false, reject); } else if (IS_TO_ARRAY) { try { - target[index++] = result; + target[counter++] = $result; loop(); } catch (error4) { ifAbruptCloseAsyncIterator(error4); } } else { - result ? asyncIteratorClose(iterator, resolve, IS_SOME || value, reject) : loop(); + $result ? asyncIteratorClose(iterator, resolve, IS_SOME || value, reject) : loop(); } - }, ifAbruptCloseAsyncIterator); + }; + + if (isObject(result)) { Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); } + else { handler(result); } } else { - target[index++] = value; + target[counter++] = value; loop(); } } catch (error3) { ifAbruptCloseAsyncIterator(error3); } @@ -9895,7 +10005,20 @@ var doric = (function (exports) { var toArray = asyncIteratorIteration.toArray; var ASYNC_ITERATOR$1 = wellKnownSymbol('asyncIterator'); - var arrayIterator = entryVirtual('Array').values; + var arrayIterator = functionUncurryThis(entryVirtual('Array').values); + var arrayIteratorNext = functionUncurryThis(arrayIterator([]).next); + + var safeArrayIterator = function () { + return new SafeArrayIterator(this); + }; + + var SafeArrayIterator = function (O) { + this.iterator = arrayIterator(O); + }; + + SafeArrayIterator.prototype.next = function () { + return arrayIteratorNext(this.iterator); + }; // `Array.fromAsync` method implementation // https://github.com/tc39/proposal-array-from-async @@ -9908,18 +10031,18 @@ var doric = (function (exports) { var O = toObject(asyncItems); if (mapfn !== undefined) { mapfn = functionBindContext(mapfn, thisArg); } var usingAsyncIterator = getMethod(O, ASYNC_ITERATOR$1); - var usingSyncIterator = usingAsyncIterator ? undefined : getIteratorMethod(O) || arrayIterator; + var usingSyncIterator = usingAsyncIterator ? undefined : getIteratorMethod(O) || safeArrayIterator; var A = isConstructor(C) ? new C() : []; var iterator = usingAsyncIterator ? getAsyncIterator(O, usingAsyncIterator) - : new asyncFromSyncIterator(getIterator(O, usingSyncIterator)); + : new asyncFromSyncIterator(getIteratorDirect(getIterator(O, usingSyncIterator))); resolve(toArray(iterator, mapfn, A)); }); }; // `Array.fromAsync` method // https://github.com/tc39/proposal-array-from-async - _export({ target: 'Array', stat: true, forced: true }, { + _export({ target: 'Array', stat: true }, { fromAsync: arrayFromAsync }); @@ -9951,7 +10074,7 @@ var doric = (function (exports) { addToUnscopables('filterReject'); - var $Array$4 = Array; + var $Array$5 = Array; var push$c = functionUncurryThis([].push); var arrayGroup = function ($this, callbackfn, that, specificConstructor) { @@ -9973,7 +10096,7 @@ var doric = (function (exports) { // TODO: Remove this block from `core-js@4` if (specificConstructor) { Constructor = specificConstructor(O); - if (Constructor !== $Array$4) { + if (Constructor !== $Array$5) { for (key in target) { target[key] = arrayFromConstructorAndList(Constructor, target[key]); } } } return target; @@ -10039,6 +10162,7 @@ var doric = (function (exports) { + // `Array.prototype.groupByToMap` method // https://github.com/tc39/proposal-array-grouping // https://bugs.webkit.org/show_bug.cgi?id=236541 @@ -10050,13 +10174,13 @@ var doric = (function (exports) { // `Array.prototype.groupToMap` method // https://github.com/tc39/proposal-array-grouping - _export({ target: 'Array', proto: true }, { + _export({ target: 'Array', proto: true, forced: isPure }, { groupToMap: arrayGroupToMap }); addToUnscopables('groupToMap'); - // eslint-disable-next-line es-x/no-object-isfrozen -- safe + // eslint-disable-next-line es/no-object-isfrozen -- safe var isFrozen = Object.isFrozen; var isFrozenStringArray = function (array, allowUndefined) { @@ -10066,7 +10190,7 @@ var doric = (function (exports) { var element; while (index < length) { element = array[index++]; - if (!(typeof element == 'string' || (allowUndefined && typeof element == 'undefined'))) { + if (!(typeof element == 'string' || (allowUndefined && element === undefined))) { return false; } } return length !== 0; @@ -10141,19 +10265,19 @@ var doric = (function (exports) { return A; }; - var $Array$3 = Array; + var $Array$4 = Array; // `Array.prototype.toReversed` method // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed _export({ target: 'Array', proto: true }, { toReversed: function toReversed() { - return arrayToReversed(toIndexedObject(this), $Array$3); + return arrayToReversed(toIndexedObject(this), $Array$4); } }); addToUnscopables('toReversed'); - var $Array$2 = Array; + var $Array$3 = Array; var sort$1 = functionUncurryThis(entryVirtual('Array').sort); // `Array.prototype.toSorted` method @@ -10162,14 +10286,14 @@ var doric = (function (exports) { toSorted: function toSorted(compareFn) { if (compareFn !== undefined) { aCallable(compareFn); } var O = toIndexedObject(this); - var A = arrayFromConstructorAndList($Array$2, O); + var A = arrayFromConstructorAndList($Array$3, O); return sort$1(A, compareFn); } }); addToUnscopables('toSorted'); - var $Array$1 = Array; + var $Array$2 = Array; var max$2 = Math.max; var min$2 = Math.min; @@ -10195,7 +10319,7 @@ var doric = (function (exports) { actualDeleteCount = min$2(max$2(toIntegerOrInfinity(deleteCount), 0), len - actualStart); } newLen = doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); - A = $Array$1(newLen); + A = $Array$2(newLen); for (; k < actualStart; k++) { A[k] = O[k]; } for (; k < actualStart + insertCount; k++) { A[k] = arguments$1[k - actualStart + 2]; } @@ -10221,7 +10345,7 @@ var doric = (function (exports) { var length = lengthOfArrayLike(that); var result = arraySpeciesCreate(that, 0); var map = new Map$4(); - var resolverFunction = resolver != null ? aCallable(resolver) : function (value) { + var resolverFunction = !isNullOrUndefined(resolver) ? aCallable(resolver) : function (value) { return value; }; var index, item, key; @@ -10259,13 +10383,13 @@ var doric = (function (exports) { return A; }; - var $Array = Array; + var $Array$1 = Array; // `Array.prototype.with` method // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with _export({ target: 'Array', proto: true }, { 'with': function (index, value) { - return arrayWith(toIndexedObject(this), $Array, index, value); + return arrayWith(toIndexedObject(this), $Array$1, index, value); } }); @@ -10321,7 +10445,7 @@ var doric = (function (exports) { var state = stateCompletion.value; if (stateError || (IS_GENERATOR && state.done)) { - return { exit: true, value: stateError ? Promise$2.reject(state) : Promise$2.resolve({ done: true, value: undefined }) }; + return { exit: true, value: stateError ? Promise$2.reject(state) : Promise$2.resolve(createIterResultObject(undefined, true)) }; } return { exit: false, value: state }; }; @@ -10362,21 +10486,28 @@ var doric = (function (exports) { var state = stateCompletion.value; return exit ? state : enqueue(state, function () { - return new Promise$2(function (resolve, reject) { - var iterator = state.iterator; - var innerIterator = state.innerIterator; - state.done = true; - if (innerIterator) { try { - iteratorClose(innerIterator, 'return'); + state.done = true; + var iterator = state.iterator; + var returnMethod, result; + var completion = perform(function () { + if (state.inner) { try { + iteratorClose(state.inner.iterator, 'return'); } catch (error) { return iteratorClose(iterator, 'throw', error); } } - var $$return = getMethod(iterator, 'return'); - if ($$return === undefined) { return resolve({ done: true, value: undefined }); } - Promise$2.resolve(functionCall($$return, iterator)).then(function (result) { - anObject(result); - resolve({ done: true, value: undefined }); - }, reject); + return getMethod(iterator, 'return'); + }); + returnMethod = result = completion.value; + if (completion.error) { return Promise$2.reject(result); } + if (returnMethod === undefined) { return Promise$2.resolve(createIterResultObject(undefined, true)); } + completion = perform(function () { + return functionCall(returnMethod, iterator); + }); + result = completion.value; + if (completion.error) { return Promise$2.reject(result); } + return IS_ITERATOR ? Promise$2.resolve(result) : Promise$2.resolve(result).then(function (resolved) { + anObject(resolved); + return createIterResultObject(undefined, true); }); }); } @@ -10402,6 +10533,7 @@ var doric = (function (exports) { } else { state = record; } state.type = ASYNC_ITERATOR_PROXY; state.nextHandler = nextHandler; + state.counter = 0; state.done = false; state.awaiting = null; setInternalState$9(this, state); @@ -10418,6 +10550,7 @@ var doric = (function (exports) { + var AsyncIteratorProxy$5 = asyncIteratorCreateProxy(function (Promise) { var state = this; var iterator = state.iterator; @@ -10425,9 +10558,9 @@ var doric = (function (exports) { return Promise.resolve(anObject(functionCall(state.next, iterator))).then(function (step) { if (anObject(step).done) { state.done = true; - return { done: true, value: undefined }; + return createIterResultObject(undefined, true); } - return { done: false, value: [state.index++, step.value] }; + return createIterResultObject([state.index++, step.value], false); }).then(null, function (error) { state.done = true; throw error; @@ -10466,6 +10599,7 @@ var doric = (function (exports) { + var AsyncIteratorProxy$4 = asyncIteratorCreateProxy(function (Promise) { var state = this; @@ -10481,11 +10615,11 @@ var doric = (function (exports) { try { if (anObject(step).done) { state.done = true; - resolve({ done: true, value: undefined }); + resolve(createIterResultObject(undefined, true)); } else if (state.remaining) { state.remaining--; loop(); - } else { resolve({ done: false, value: step.value }); } + } else { resolve(createIterResultObject(step.value, false)); } } catch (err) { doneAndReject(err); } }, doneAndReject); } catch (error) { doneAndReject(error); } @@ -10522,6 +10656,8 @@ var doric = (function (exports) { + + var AsyncIteratorProxy$3 = asyncIteratorCreateProxy(function (Promise) { var state = this; var iterator = state.iterator; @@ -10543,13 +10679,18 @@ var doric = (function (exports) { try { if (anObject(step).done) { state.done = true; - resolve({ done: true, value: undefined }); + resolve(createIterResultObject(undefined, true)); } else { var value = step.value; try { - Promise.resolve(filterer(value)).then(function (selected) { - selected ? resolve({ done: false, value: value }) : loop(); - }, ifAbruptCloseAsyncIterator); + var result = filterer(value, state.counter++); + + var handler = function (selected) { + selected ? resolve(createIterResultObject(value, false)) : loop(); + }; + + if (isObject(result)) { Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); } + else { handler(result); } } catch (error3) { ifAbruptCloseAsyncIterator(error3); } } } catch (error2) { doneAndReject(error2); } @@ -10579,6 +10720,26 @@ var doric = (function (exports) { } }); + var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator'); + + var getAsyncIteratorFlattenable = function from(obj) { + var object = toObject(obj); + var alreadyAsync = true; + var method = getMethod(object, ASYNC_ITERATOR); + var iterator; + if (!isCallable(method)) { + method = getIteratorMethod(object); + alreadyAsync = false; + } + if (isCallable(method)) { + iterator = functionCall(method, object); + } else { + iterator = object; + alreadyAsync = true; + } + return getIteratorDirect(alreadyAsync ? iterator : new asyncFromSyncIterator(getIteratorDirect(iterator))); + }; + // https://github.com/tc39/proposal-iterator-helpers @@ -10589,11 +10750,12 @@ var doric = (function (exports) { + + var AsyncIteratorProxy$2 = asyncIteratorCreateProxy(function (Promise) { var state = this; var iterator = state.iterator; var mapper = state.mapper; - var innerIterator; return new Promise(function (resolve, reject) { var doneAndReject = function (error) { @@ -10611,17 +10773,21 @@ var doric = (function (exports) { try { if (anObject(step).done) { state.done = true; - resolve({ done: true, value: undefined }); + resolve(createIterResultObject(undefined, true)); } else { var value = step.value; try { - Promise.resolve(mapper(value)).then(function (mapped) { + var result = mapper(value, state.counter++); + + var handler = function (mapped) { try { - state.innerIterator = innerIterator = getAsyncIterator(mapped); - state.innerNext = aCallable(innerIterator.next); + state.inner = getAsyncIteratorFlattenable(mapped); innerLoop(); } catch (error4) { ifAbruptCloseAsyncIterator(error4); } - }, ifAbruptCloseAsyncIterator); + }; + + if (isObject(result)) { Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); } + else { handler(result); } } catch (error3) { ifAbruptCloseAsyncIterator(error3); } } } catch (error2) { doneAndReject(error2); } @@ -10630,14 +10796,15 @@ var doric = (function (exports) { }; var innerLoop = function () { - if (innerIterator = state.innerIterator) { + var inner = state.inner; + if (inner) { try { - Promise.resolve(anObject(functionCall(state.innerNext, innerIterator))).then(function (result) { + Promise.resolve(anObject(functionCall(inner.next, inner.iterator))).then(function (result) { try { if (anObject(result).done) { - state.innerIterator = state.innerNext = null; + state.inner = null; outerLoop(); - } else { resolve({ done: false, value: result.value }); } + } else { resolve(createIterResultObject(result.value, false)); } } catch (error1) { ifAbruptCloseAsyncIterator(error1); } }, ifAbruptCloseAsyncIterator); } catch (error) { ifAbruptCloseAsyncIterator(error); } @@ -10652,8 +10819,7 @@ var doric = (function (exports) { flatMap: function flatMap(mapper) { return new AsyncIteratorProxy$2(getIteratorDirect(this), { mapper: aCallable(mapper), - innerIterator: null, - innerNext: null + inner: null }); } }); @@ -10679,32 +10845,16 @@ var doric = (function (exports) { - - - - - - - - var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator'); - _export({ target: 'AsyncIterator', stat: true, forced: true }, { from: function from(O) { - var object = toObject(O); - var usingIterator = getMethod(object, ASYNC_ITERATOR); - var iterator; - if (usingIterator) { - iterator = getAsyncIterator(object, usingIterator); - if (objectIsPrototypeOf(asyncIteratorPrototype, iterator)) { return iterator; } - } - if (iterator === undefined) { - usingIterator = getIteratorMethod(object); - if (usingIterator) { iterator = new asyncFromSyncIterator(getIterator(object, usingIterator)); } - } - return new asyncIteratorWrap(getIteratorDirect(iterator !== undefined ? iterator : object)); + var iteratorRecord = getAsyncIteratorFlattenable(O); + return objectIsPrototypeOf(asyncIteratorPrototype, iteratorRecord.iterator) + ? iteratorRecord.iterator + : new asyncIteratorWrap(iteratorRecord); } }); + // TODO: Remove from `core-js@4` // https://github.com/tc39/proposal-iterator-helpers @@ -10722,6 +10872,8 @@ var doric = (function (exports) { + + var AsyncIteratorProxy$1 = asyncIteratorCreateProxy(function (Promise) { var state = this; var iterator = state.iterator; @@ -10741,13 +10893,18 @@ var doric = (function (exports) { try { if (anObject(step).done) { state.done = true; - resolve({ done: true, value: undefined }); + resolve(createIterResultObject(undefined, true)); } else { var value = step.value; try { - Promise.resolve(mapper(value)).then(function (mapped) { - resolve({ done: false, value: mapped }); - }, ifAbruptCloseAsyncIterator); + var result = mapper(value, state.counter++); + + var handler = function (mapped) { + resolve(createIterResultObject(mapped, false)); + }; + + if (isObject(result)) { Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator); } + else { handler(result); } } catch (error2) { ifAbruptCloseAsyncIterator(error2); } } } catch (error) { doneAndReject(error); } @@ -10772,6 +10929,7 @@ var doric = (function (exports) { + var Promise$1 = getBuiltIn('Promise'); var $TypeError$b = TypeError; @@ -10782,6 +10940,7 @@ var doric = (function (exports) { var next = record.next; var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; + var counter = 0; aCallable(reducer); return new Promise$1(function (resolve, reject) { @@ -10802,12 +10961,18 @@ var doric = (function (exports) { accumulator = value; loop(); } else { try { - Promise$1.resolve(reducer(accumulator, value)).then(function (result) { - accumulator = result; + var result = reducer(accumulator, value, counter); + + var handler = function ($result) { + accumulator = $result; loop(); - }, ifAbruptCloseAsyncIterator); + }; + + if (isObject(result)) { Promise$1.resolve(result).then(handler, ifAbruptCloseAsyncIterator); } + else { handler(result); } } catch (error3) { ifAbruptCloseAsyncIterator(error3); } } } + counter++; } catch (error2) { reject(error2); } }, reject); } catch (error) { reject(error); } @@ -10837,13 +11002,14 @@ var doric = (function (exports) { + var AsyncIteratorProxy = asyncIteratorCreateProxy(function (Promise) { var state = this; var iterator = state.iterator; var returnMethod; if (!state.remaining--) { - var resultDone = { done: true, value: undefined }; + var resultDone = createIterResultObject(undefined, true); state.done = true; returnMethod = iterator['return']; if (returnMethod !== undefined) { @@ -10855,8 +11021,8 @@ var doric = (function (exports) { } return Promise.resolve(functionCall(state.next, iterator)).then(function (step) { if (anObject(step).done) { state.done = true; - return { done: true, value: undefined }; - } return { done: false, value: step.value }; + return createIterResultObject(undefined, true); + } return createIterResultObject(step.value, false); }).then(null, function (error) { state.done = true; throw error; @@ -10893,12 +11059,12 @@ var doric = (function (exports) { var $RangeError$2 = RangeError; var $TypeError$a = TypeError; - var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(start, end, option, type, zero, one) { + var $RangeIterator = iteratorCreateConstructor(function NumericRangeIterator(start, end, option, type, zero, one) { if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) { - throw new $TypeError$a(INCORRECT_RANGE); + throw $TypeError$a(INCORRECT_RANGE); } if (start === Infinity || start === -Infinity) { - throw new $RangeError$2(INCORRECT_RANGE); + throw $RangeError$2(INCORRECT_RANGE); } var ifIncrease = end > start; var inclusiveEnd = false; @@ -10911,16 +11077,16 @@ var doric = (function (exports) { } else if (typeof option == type) { step = option; } else { - throw new $TypeError$a(INCORRECT_RANGE); + throw $TypeError$a(INCORRECT_RANGE); } - if (step == null) { + if (isNullOrUndefined(step)) { step = ifIncrease ? one : -one; } if (typeof step != type) { - throw new $TypeError$a(INCORRECT_RANGE); + throw $TypeError$a(INCORRECT_RANGE); } if (step === Infinity || step === -Infinity || (step === zero && start !== end)) { - throw new $RangeError$2(INCORRECT_RANGE); + throw $RangeError$2(INCORRECT_RANGE); } // eslint-disable-next-line no-self-compare -- NaN check var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero); @@ -10942,7 +11108,7 @@ var doric = (function (exports) { } }, NUMERIC_RANGE_ITERATOR, function next() { var state = getInternalState$4(this); - if (state.hitsEnd) { return { value: undefined, done: true }; } + if (state.hitsEnd) { return createIterResultObject(undefined, true); } var start = state.start; var end = state.end; var step = state.step; @@ -10956,8 +11122,9 @@ var doric = (function (exports) { endCondition = inclusiveEnd ? end > currentYieldingValue : end >= currentYieldingValue; } if (endCondition) { - return { value: undefined, done: state.hitsEnd = true }; - } return { value: currentYieldingValue, done: false }; + state.hitsEnd = true; + return createIterResultObject(undefined, true); + } return createIterResultObject(currentYieldingValue, false); }); var getter = function (fn) { @@ -10983,7 +11150,7 @@ var doric = (function (exports) { var numericRangeIterator = $RangeIterator; - /* eslint-disable es-x/no-bigint -- safe */ + /* eslint-disable es/no-bigint -- safe */ @@ -11071,7 +11238,7 @@ var doric = (function (exports) { } }); - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; var classRegExp = /^\s*class\b/; var exec$4 = functionUncurryThis(classRegExp.exec); @@ -11151,6 +11318,7 @@ var doric = (function (exports) { var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; + var ITERATOR_HELPER = 'IteratorHelper'; var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator'; var setInternalState$7 = internalState.set; @@ -11171,7 +11339,7 @@ var doric = (function (exports) { if (IS_ITERATOR) { return state.nextHandler(); } try { var result = state.done ? undefined : state.nextHandler(); - return { done: state.done, value: result }; + return createIterResultObject(result, state.done); } catch (error) { state.done = true; throw error; @@ -11180,15 +11348,18 @@ var doric = (function (exports) { 'return': function () { var state = getInternalState(this); var iterator = state.iterator; - var innerIterator = state.innerIterator; state.done = true; - if (innerIterator) { try { - iteratorClose(innerIterator, 'return'); + if (IS_ITERATOR) { + var returnMethod = getMethod(iterator, 'return'); + return returnMethod ? functionCall(returnMethod, iterator) : createIterResultObject(undefined, true); + } + if (state.inner) { try { + iteratorClose(state.inner.iterator, 'return'); } catch (error) { return iteratorClose(iterator, 'throw', error); } } - var $$return = getMethod(iterator, 'return'); - return { done: true, value: $$return ? anObject(functionCall($$return, iterator)).value : undefined }; + iteratorClose(iterator, 'return'); + return createIterResultObject(undefined, true); } }); @@ -11212,6 +11383,7 @@ var doric = (function (exports) { } else { state = record; } state.type = ITERATOR_PROXY; state.nextHandler = nextHandler; + state.counter = 0; state.done = false; setInternalState$7(this, state); }; @@ -11289,9 +11461,10 @@ var doric = (function (exports) { _export({ target: 'Iterator', proto: true, real: true, forced: true }, { every: function every(fn) { var record = getIteratorDirect(this); + var counter = 0; aCallable(fn); return !iterate(record, function (value, stop) { - if (!fn(value)) { return stop(); } + if (!fn(value, counter++)) { return stop(); } }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } }); @@ -11315,7 +11488,7 @@ var doric = (function (exports) { done = this.done = !!result.done; if (done) { return; } value = result.value; - if (callWithSafeIterationClosing(iterator, filterer, value)) { return value; } + if (callWithSafeIterationClosing(iterator, filterer, [value, this.counter++], true)) { return value; } } }); @@ -11336,13 +11509,20 @@ var doric = (function (exports) { _export({ target: 'Iterator', proto: true, real: true, forced: true }, { find: function find(fn) { var record = getIteratorDirect(this); + var counter = 0; aCallable(fn); return iterate(record, function (value, stop) { - if (fn(value)) { return stop(value); } + if (fn(value, counter++)) { return stop(value); } }, { IS_RECORD: true, INTERRUPTED: true }).result; } }); + var getIteratorFlattenable = function (obj) { + var object = toObject(obj); + var method = getIteratorMethod(object); + return getIteratorDirect(isCallable(method) ? functionCall(method, object) : object); + }; + // https://github.com/tc39/proposal-iterator-helpers @@ -11353,18 +11533,16 @@ var doric = (function (exports) { - var $TypeError$8 = TypeError; - var IteratorProxy$3 = iteratorCreateProxy(function () { var iterator = this.iterator; var mapper = this.mapper; - var result, mapped, iteratorMethod, innerIterator; + var result, inner; while (true) { - if (innerIterator = this.innerIterator) { try { - result = anObject(functionCall(this.innerNext, innerIterator)); + if (inner = this.inner) { try { + result = anObject(functionCall(inner.next, inner.iterator)); if (!result.done) { return result.value; } - this.innerIterator = this.innerNext = null; + this.inner = null; } catch (error) { iteratorClose(iterator, 'throw', error); } } result = anObject(functionCall(this.next, iterator)); @@ -11372,15 +11550,7 @@ var doric = (function (exports) { if (this.done = !!result.done) { return; } try { - mapped = mapper(result.value); - iteratorMethod = getIteratorMethod(mapped); - - if (!iteratorMethod) { - throw $TypeError$8('.flatMap callback should return an iterable object'); - } - - this.innerIterator = innerIterator = anObject(functionCall(iteratorMethod, mapped)); - this.innerNext = aCallable(innerIterator.next); + this.inner = getIteratorFlattenable(mapper(result.value, this.counter++)); } catch (error$1) { iteratorClose(iterator, 'throw', error$1); } } }); @@ -11389,8 +11559,7 @@ var doric = (function (exports) { flatMap: function flatMap(mapper) { return new IteratorProxy$3(getIteratorDirect(this), { mapper: aCallable(mapper), - innerIterator: null, - innerNext: null + inner: null }); } }); @@ -11400,9 +11569,15 @@ var doric = (function (exports) { + _export({ target: 'Iterator', proto: true, real: true, forced: true }, { forEach: function forEach(fn) { - iterate(getIteratorDirect(this), fn, { IS_RECORD: true }); + var record = getIteratorDirect(this); + var counter = 0; + aCallable(fn); + iterate(record, function (value) { + fn(value, counter++); + }, { IS_RECORD: true }); } }); @@ -11410,31 +11585,24 @@ var doric = (function (exports) { - var IteratorPrototype = iteratorsCore.IteratorPrototype; - - var IteratorProxy$2 = iteratorCreateProxy(function () { return functionCall(this.next, this.iterator); }, true); _export({ target: 'Iterator', stat: true, forced: true }, { from: function from(O) { - var object = toObject(O); - var usingIterator = getIteratorMethod(object); - var iterator; - if (usingIterator) { - iterator = getIterator(object, usingIterator); - if (objectIsPrototypeOf(IteratorPrototype, iterator)) { return iterator; } - } else { - iterator = object; - } return new IteratorProxy$2(getIteratorDirect(iterator)); + var iteratorRecord = getIteratorFlattenable(O); + return objectIsPrototypeOf(IteratorPrototype, iteratorRecord.iterator) + ? iteratorRecord.iterator + : new IteratorProxy$2(iteratorRecord); } }); + // TODO: Remove from `core-js@4` // https://github.com/tc39/proposal-iterator-helpers @@ -11456,7 +11624,7 @@ var doric = (function (exports) { var iterator = this.iterator; var result = anObject(functionCall(this.next, iterator)); var done = this.done = !!result.done; - if (!done) { return callWithSafeIterationClosing(iterator, this.mapper, result.value); } + if (!done) { return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true); } }); _export({ target: 'Iterator', proto: true, real: true, forced: true }, { @@ -11473,7 +11641,7 @@ var doric = (function (exports) { - var $TypeError$7 = TypeError; + var $TypeError$8 = TypeError; _export({ target: 'Iterator', proto: true, real: true, forced: true }, { reduce: function reduce(reducer /* , initialValue */) { @@ -11481,15 +11649,17 @@ var doric = (function (exports) { aCallable(reducer); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; + var counter = 0; iterate(record, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { - accumulator = reducer(accumulator, value); + accumulator = reducer(accumulator, value, counter); } + counter++; }, { IS_RECORD: true }); - if (noInitial) { throw $TypeError$7('Reduce of empty iterator with no initial value'); } + if (noInitial) { throw $TypeError$8('Reduce of empty iterator with no initial value'); } return accumulator; } }); @@ -11503,9 +11673,10 @@ var doric = (function (exports) { _export({ target: 'Iterator', proto: true, real: true, forced: true }, { some: function some(fn) { var record = getIteratorDirect(this); + var counter = 0; aCallable(fn); return iterate(record, function (value, stop) { - if (fn(value)) { return stop(); } + if (fn(value, counter++)) { return stop(); } }, { IS_RECORD: true, INTERRUPTED: true }).stopped; } }); @@ -11562,7 +11733,7 @@ var doric = (function (exports) { _export({ target: 'Iterator', proto: true, real: true, forced: true }, { toAsync: function toAsync() { - return new asyncIteratorWrap(getIteratorDirect(new asyncFromSyncIterator(this))); + return new asyncIteratorWrap(getIteratorDirect(new asyncFromSyncIterator(getIteratorDirect(this)))); } }); @@ -11614,7 +11785,7 @@ var doric = (function (exports) { }); var getMapIterator = function (it) { - // eslint-disable-next-line es-x/no-map -- safe + // eslint-disable-next-line es/no-map -- safe return functionCall(Map.prototype.entries, it); }; @@ -11680,6 +11851,7 @@ var doric = (function (exports) { + var push$8 = [].push; var collectionFrom = function from(source /* , mapFn, thisArg */) { @@ -11689,7 +11861,7 @@ var doric = (function (exports) { aConstructor(this); mapping = mapFn !== undefined; if (mapping) { aCallable(mapFn); } - if (source == undefined) { return new this(); } + if (isNullOrUndefined(source)) { return new this(); } array = []; if (mapping) { n = 0; @@ -11832,7 +12004,7 @@ var doric = (function (exports) { of: collectionOf }); - var $TypeError$6 = TypeError; + var $TypeError$7 = TypeError; // `Map.prototype.reduce` method // https://github.com/tc39/proposal-collection-methods @@ -11851,7 +12023,7 @@ var doric = (function (exports) { accumulator = callbackfn(accumulator, value, key, map); } }, { AS_ENTRIES: true, IS_ITERATOR: true }); - if (noInitial) { throw $TypeError$6('Reduce of empty map with no initial value'); } + if (noInitial) { throw $TypeError$7('Reduce of empty map with no initial value'); } return accumulator; } }); @@ -11869,7 +12041,7 @@ var doric = (function (exports) { } }); - var $TypeError$5 = TypeError; + var $TypeError$6 = TypeError; // `Set.prototype.update` method // https://github.com/tc39/proposal-collection-methods @@ -11883,7 +12055,7 @@ var doric = (function (exports) { aCallable(callback); var isPresentInMap = functionCall(has, map, key); if (!isPresentInMap && length < 3) { - throw $TypeError$5('Updating absent value'); + throw $TypeError$6('Updating absent value'); } var value = isPresentInMap ? functionCall(get, map, key) : aCallable(length > 2 ? arguments[2] : undefined)(key, map); functionCall(set, map, key, callback(value, key, map)); @@ -11891,7 +12063,7 @@ var doric = (function (exports) { } }); - var $TypeError$4 = TypeError; + var $TypeError$5 = TypeError; // `Map.prototype.upsert` method // https://github.com/thumbsupep/proposal-upsert @@ -11903,7 +12075,7 @@ var doric = (function (exports) { var insertFn = arguments.length > 2 ? arguments[2] : undefined; var value; if (!isCallable(updateFn) && !isCallable(insertFn)) { - throw $TypeError$4('At least one callback required'); + throw $TypeError$5('At least one callback required'); } if (functionCall(has, map, key)) { value = functionCall(get, map, key); @@ -12054,9 +12226,9 @@ var doric = (function (exports) { var SEED_TYPE_ERROR = 'Math.seededPRNG() argument should have a "seed" field with a finite value.'; var setInternalState$6 = internalState.set; var getInternalState$3 = internalState.getterFor(SEEDED_RANDOM_GENERATOR); - var $TypeError$3 = TypeError; + var $TypeError$4 = TypeError; - var $SeededRandomGenerator = createIteratorConstructor(function SeededRandomGenerator(seed) { + var $SeededRandomGenerator = iteratorCreateConstructor(function SeededRandomGenerator(seed) { setInternalState$6(this, { type: SEEDED_RANDOM_GENERATOR, seed: seed % 2147483647 @@ -12064,7 +12236,7 @@ var doric = (function (exports) { }, SEEDED_RANDOM, function next() { var state = getInternalState$3(this); var seed = state.seed = (state.seed * 1103515245 + 12345) % 2147483647; - return { value: (seed & 1073741823) / 1073741823, done: false }; + return createIterResultObject((seed & 1073741823) / 1073741823, false); }); // `Math.seededPRNG` method @@ -12073,7 +12245,7 @@ var doric = (function (exports) { _export({ target: 'Math', stat: true, forced: true }, { seededPRNG: function seededPRNG(it) { var seed = anObject(it).seed; - if (!numberIsFinite(seed)) { throw $TypeError$3(SEED_TYPE_ERROR); } + if (!numberIsFinite(seed)) { throw $TypeError$4(SEED_TYPE_ERROR); } return new $SeededRandomGenerator(seed); } }); @@ -12109,9 +12281,9 @@ var doric = (function (exports) { var INVALID_RADIX = 'Invalid radix'; var $RangeError$1 = RangeError; var $SyntaxError = SyntaxError; - var $TypeError$2 = TypeError; + var $TypeError$3 = TypeError; var valid = /^[\da-z]+$/; - var charAt$6 = functionUncurryThis(''.charAt); + var charAt$7 = functionUncurryThis(''.charAt); var exec$3 = functionUncurryThis(valid.exec); var numberToString$1 = functionUncurryThis(1.0.toString); var stringSlice$2 = functionUncurryThis(''.slice); @@ -12122,9 +12294,9 @@ var doric = (function (exports) { fromString: function fromString(string, radix) { var sign = 1; var R, mathNum; - if (typeof string != 'string') { throw $TypeError$2(INVALID_NUMBER_REPRESENTATION); } + if (typeof string != 'string') { throw $TypeError$3(INVALID_NUMBER_REPRESENTATION); } if (!string.length) { throw $SyntaxError(INVALID_NUMBER_REPRESENTATION); } - if (charAt$6(string, 0) == '-') { + if (charAt$7(string, 0) == '-') { sign = -1; string = stringSlice$2(string, 1); if (!string.length) { throw $SyntaxError(INVALID_NUMBER_REPRESENTATION); } @@ -12150,7 +12322,7 @@ var doric = (function (exports) { var setInternalState$5 = internalState.set; var getInternalState$2 = internalState.getterFor(OBJECT_ITERATOR); - var objectIterator = createIteratorConstructor(function ObjectIterator(source, mode) { + var objectIterator = iteratorCreateConstructor(function ObjectIterator(source, mode) { var object = toObject(source); setInternalState$5(this, { type: OBJECT_ITERATOR, @@ -12165,15 +12337,15 @@ var doric = (function (exports) { while (true) { if (keys === null || state.index >= keys.length) { state.object = state.keys = null; - return { value: undefined, done: true }; + return createIterResultObject(undefined, true); } var key = keys[state.index++]; var object = state.object; if (!hasOwnProperty_1(object, key)) { continue; } switch (state.mode) { - case 'keys': return { value: key, done: false }; - case 'values': return { value: object[key], done: false }; - } /* entries */ return { value: [key, object[key]], done: false }; + case 'keys': return createIterResultObject(key, false); + case 'values': return createIterResultObject(object[key], false); + } /* entries */ return createIterResultObject([key, object[key]], false); } }); @@ -12242,6 +12414,7 @@ var doric = (function (exports) { + var $$OBSERVABLE$1 = wellKnownSymbol('observable'); var OBSERVABLE = 'Observable'; var SUBSCRIPTION = 'Subscription'; @@ -12298,7 +12471,7 @@ var doric = (function (exports) { try { var cleanup = subscriber(subscriptionObserver); var subscription = cleanup; - if (cleanup != null) { subscriptionState.cleanup = isCallable(cleanup.unsubscribe) + if (!isNullOrUndefined(cleanup)) { subscriptionState.cleanup = isCallable(cleanup.unsubscribe) ? function () { subscription.unsubscribe(); } : aCallable(cleanup); } } catch (error$1) { @@ -12754,7 +12927,7 @@ var doric = (function (exports) { }); var getSetIterator = function (it) { - // eslint-disable-next-line es-x/no-set -- safe + // eslint-disable-next-line es/no-set -- safe return functionCall(Set.prototype.values, it); }; @@ -12900,7 +13073,7 @@ var doric = (function (exports) { of: collectionOf }); - var $TypeError$1 = TypeError; + var $TypeError$2 = TypeError; // `Set.prototype.reduce` method // https://github.com/tc39/proposal-collection-methods @@ -12919,7 +13092,7 @@ var doric = (function (exports) { accumulator = callbackfn(accumulator, value, value, set); } }, { IS_ITERATOR: true }); - if (noInitial) { throw $TypeError$1('Reduce of empty set with no initial value'); } + if (noInitial) { throw $TypeError$2('Reduce of empty set with no initial value'); } return accumulator; } }); @@ -12965,7 +13138,7 @@ var doric = (function (exports) { // TODO: Remove from `core-js@4` - var charAt$5 = stringMultibyte.charAt; + var charAt$6 = stringMultibyte.charAt; @@ -12978,14 +13151,14 @@ var doric = (function (exports) { var len = S.length; var relativeIndex = toIntegerOrInfinity(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; - return (k < 0 || k >= len) ? undefined : charAt$5(S, k); + return (k < 0 || k >= len) ? undefined : charAt$6(S, k); } }); - var $TypeError = TypeError; + var $TypeError$1 = TypeError; var ArrayPrototype = Array.prototype; var push$4 = functionUncurryThis(ArrayPrototype.push); - var join$3 = functionUncurryThis(ArrayPrototype.join); + var join$4 = functionUncurryThis(ArrayPrototype.join); // `String.cooked` method // https://github.com/tc39/proposal-string-cooked @@ -13000,22 +13173,22 @@ var doric = (function (exports) { var i = 0; while (literalSegments > i) { var nextVal = cookedTemplate[i++]; - if (nextVal === undefined) { throw $TypeError('Incorrect template'); } + if (nextVal === undefined) { throw $TypeError$1('Incorrect template'); } push$4(elements, toString_1(nextVal)); - if (i === literalSegments) { return join$3(elements, ''); } + if (i === literalSegments) { return join$4(elements, ''); } if (i < argumentsLength) { push$4(elements, toString_1(arguments$1[i])); } } } }); var codeAt$1 = stringMultibyte.codeAt; - var charAt$4 = stringMultibyte.charAt; + var charAt$5 = stringMultibyte.charAt; var STRING_ITERATOR = 'String Iterator'; var setInternalState$3 = internalState.set; var getInternalState$1 = internalState.getterFor(STRING_ITERATOR); // TODO: unify with String#@@iterator - var $StringIterator = createIteratorConstructor(function StringIterator(string) { + var $StringIterator = iteratorCreateConstructor(function StringIterator(string) { setInternalState$3(this, { type: STRING_ITERATOR, string: string, @@ -13026,10 +13199,10 @@ var doric = (function (exports) { var string = state.string; var index = state.index; var point; - if (index >= string.length) { return { value: undefined, done: true }; } - point = charAt$4(string, index); + if (index >= string.length) { return createIterResultObject(undefined, true); } + point = charAt$5(string, index); state.index += point.length; - return { value: { codePoint: codeAt$1(point, 0), position: index }, done: false }; + return createIterResultObject({ codePoint: codeAt$1(point, 0), position: index }, false); }); // `String.prototype.codePoints` method @@ -13040,44 +13213,90 @@ var doric = (function (exports) { } }); + var charCodeAt$3 = functionUncurryThis(''.charCodeAt); + + // `String.prototype.isWellFormed` method + // https://github.com/tc39/proposal-is-usv-string + _export({ target: 'String', proto: true, forced: true }, { + isWellFormed: function isWellFormed() { + var S = toString_1(requireObjectCoercible(this)); + var length = S.length; + for (var i = 0; i < length; i++) { + var charCode = charCodeAt$3(S, i); + // single UTF-16 code unit + if ((charCode & 0xF800) != 0xD800) { continue; } + // unpaired surrogate + if (charCode >= 0xDC00 || ++i >= length || (charCodeAt$3(S, i) & 0xFC00) != 0xDC00) { return false; } + } return true; + } + }); + + var $Array = Array; + var charAt$4 = functionUncurryThis(''.charAt); + var charCodeAt$2 = functionUncurryThis(''.charCodeAt); + var join$3 = functionUncurryThis([].join); + var REPLACEMENT_CHARACTER = '\uFFFD'; + + // `String.prototype.toWellFormed` method + // https://github.com/tc39/proposal-is-usv-string + _export({ target: 'String', proto: true, forced: true }, { + toWellFormed: function toWellFormed() { + var S = toString_1(requireObjectCoercible(this)); + var length = S.length; + var result = $Array(length); + for (var i = 0; i < length; i++) { + var charCode = charCodeAt$2(S, i); + // single UTF-16 code unit + if ((charCode & 0xF800) != 0xD800) { result[i] = charAt$4(S, i); } + // unpaired surrogate + else if (charCode >= 0xDC00 || i + 1 >= length || (charCodeAt$2(S, i + 1) & 0xFC00) != 0xDC00) { result[i] = REPLACEMENT_CHARACTER; } + // surrogate pair + else { + result[i] = charAt$4(S, i); + result[++i] = charAt$4(S, i); + } + } return join$3(result, ''); + } + }); + // `Symbol.asyncDispose` well-known symbol // https://github.com/tc39/proposal-using-statement - defineWellKnownSymbol('asyncDispose'); + wellKnownSymbolDefine('asyncDispose'); // `Symbol.dispose` well-known symbol // https://github.com/tc39/proposal-using-statement - defineWellKnownSymbol('dispose'); + wellKnownSymbolDefine('dispose'); // `Symbol.matcher` well-known symbol // https://github.com/tc39/proposal-pattern-matching - defineWellKnownSymbol('matcher'); + wellKnownSymbolDefine('matcher'); // TODO: Remove from `core-js@4` // `Symbol.metadata` well-known symbol // https://github.com/tc39/proposal-decorators - defineWellKnownSymbol('metadata'); + wellKnownSymbolDefine('metadata'); // `Symbol.metadataKey` well-known symbol // https://github.com/tc39/proposal-decorator-metadata - defineWellKnownSymbol('metadataKey'); + wellKnownSymbolDefine('metadataKey'); // `Symbol.observable` well-known symbol // https://github.com/tc39/proposal-observable - defineWellKnownSymbol('observable'); + wellKnownSymbolDefine('observable'); // TODO: remove from `core-js@4` // `Symbol.patternMatch` well-known symbol // https://github.com/tc39/proposal-pattern-matching - defineWellKnownSymbol('patternMatch'); + wellKnownSymbolDefine('patternMatch'); // TODO: remove from `core-js@4` - defineWellKnownSymbol('replaceAll'); + wellKnownSymbolDefine('replaceAll'); // TODO: Remove from `core-js@4` @@ -13178,6 +13397,8 @@ var doric = (function (exports) { + + var aTypedArray$2 = arrayBufferViewCore.aTypedArray; var getTypedArrayConstructor$1 = arrayBufferViewCore.getTypedArrayConstructor; var exportTypedArrayMethod$2 = arrayBufferViewCore.exportTypedArrayMethod; @@ -13186,7 +13407,7 @@ var doric = (function (exports) { // some early implementations, like WebKit, does not follow the final semantic var PROPER_ORDER$1 = !fails(function () { - // eslint-disable-next-line es-x/no-typed-arrays -- required for testing + // eslint-disable-next-line es/no-typed-arrays -- required for testing var array = new Int8Array([1]); var spliced = array.toSpliced(1, 0, { @@ -13210,7 +13431,7 @@ var doric = (function (exports) { var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; var k = 0; - var insertCount, actualDeleteCount, convertedItems, newLen, A; + var insertCount, actualDeleteCount, thisIsBigIntArray, convertedItems, value, newLen, A; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { @@ -13221,8 +13442,11 @@ var doric = (function (exports) { insertCount = argumentsLength - 2; if (insertCount) { convertedItems = new C(insertCount); + thisIsBigIntArray = isBigIntArray(convertedItems); for (var i = 2; i < argumentsLength; i++) { - convertedItems[i - 2] = arguments$1[i]; + value = arguments$1[i]; + // FF30- typed arrays doesn't properly convert objects to typed array values + convertedItems[i - 2] = thisIsBigIntArray ? toBigInt(value) : +value; } } } @@ -13246,19 +13470,13 @@ var doric = (function (exports) { return typedArrayFromSpeciesAndList(this, arrayUniqueBy(aTypedArray$1(this), resolver)); }, true); - var slice = functionUncurryThis(''.slice); - - var isBigIntArray = function (it) { - return slice(classof(it), 0, 3) === 'Big'; - }; - var aTypedArray = arrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = arrayBufferViewCore.getTypedArrayConstructor; var exportTypedArrayMethod = arrayBufferViewCore.exportTypedArrayMethod; var PROPER_ORDER = !!function () { try { - // eslint-disable-next-line no-throw-literal, es-x/no-typed-arrays -- required for testing + // eslint-disable-next-line no-throw-literal, es/no-typed-arrays -- required for testing new Int8Array(1)['with'](2, { valueOf: function () { throw 8; } }); } catch (error) { // some early implementations, like WebKit, does not follow the final semantic @@ -13562,7 +13780,7 @@ var doric = (function (exports) { DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 } }; - var defineProperty$1 = objectDefineProperty.f; + var defineProperty$2 = objectDefineProperty.f; @@ -13584,7 +13802,7 @@ var doric = (function (exports) { try { // NodeJS < 15.0 does not expose `MessageChannel` to global var MessageChannel = getBuiltIn('MessageChannel') || tryNodeRequire('worker_threads').MessageChannel; - // eslint-disable-next-line es-x/no-weak-map, unicorn/require-post-message-target-origin -- safe + // eslint-disable-next-line es/no-weak-map, unicorn/require-post-message-target-origin -- safe new MessageChannel().port1.postMessage(new WeakMap()); } catch (error) { if (error.name == DATA_CLONE_ERR && error.code == 25) { return error.constructor; } @@ -13620,7 +13838,7 @@ var doric = (function (exports) { if (HAS_STACK) { var error = Error$3(message); error.name = DOM_EXCEPTION$2; - defineProperty$1(this, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1))); + defineProperty$2(this, 'stack', createPropertyDescriptor(1, errorStackClear(error.stack, 1))); } }; @@ -13642,7 +13860,7 @@ var doric = (function (exports) { defineBuiltInAccessor(DOMExceptionPrototype$1, 'name', getterFor('name')); } - defineProperty$1(DOMExceptionPrototype$1, 'constructor', createPropertyDescriptor(1, $DOMException$1)); + defineProperty$2(DOMExceptionPrototype$1, 'constructor', createPropertyDescriptor(1, $DOMException$1)); // FF36- DOMException is a function, but can't be constructed var INCORRECT_CONSTRUCTOR = fails(function () { @@ -13688,16 +13906,16 @@ var doric = (function (exports) { for (var key$1 in domExceptionConstants) { if (hasOwnProperty_1(domExceptionConstants, key$1)) { var constant$1 = domExceptionConstants[key$1]; var constantName$1 = constant$1.s; - var descriptor$1 = createPropertyDescriptor(6, constant$1.c); + var descriptor$2 = createPropertyDescriptor(6, constant$1.c); if (!hasOwnProperty_1(PolyfilledDOMException$1, constantName$1)) { - defineProperty$1(PolyfilledDOMException$1, constantName$1, descriptor$1); + defineProperty$2(PolyfilledDOMException$1, constantName$1, descriptor$2); } if (!hasOwnProperty_1(PolyfilledDOMExceptionPrototype$1, constantName$1)) { - defineProperty$1(PolyfilledDOMExceptionPrototype$1, constantName$1, descriptor$1); + defineProperty$2(PolyfilledDOMExceptionPrototype$1, constantName$1, descriptor$2); } } } - var defineProperty = objectDefineProperty.f; + var defineProperty$1 = objectDefineProperty.f; @@ -13719,7 +13937,7 @@ var doric = (function (exports) { var that = new NativeDOMException(message, name); var error = Error$2(message); error.name = DOM_EXCEPTION$1; - defineProperty(that, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1))); + defineProperty$1(that, 'stack', createPropertyDescriptor(1, errorStackClear(error.stack, 1))); inheritIfRequired(that, this, $DOMException); return that; }; @@ -13729,12 +13947,12 @@ var doric = (function (exports) { var ERROR_HAS_STACK = 'stack' in Error$2(DOM_EXCEPTION$1); var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2); - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe - var descriptor = NativeDOMException && descriptors && Object.getOwnPropertyDescriptor(global_1, DOM_EXCEPTION$1); + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + var descriptor$1 = NativeDOMException && descriptors && Object.getOwnPropertyDescriptor(global_1, DOM_EXCEPTION$1); // Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it // https://github.com/Jarred-Sumner/bun/issues/399 - var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable); + var BUGGY_DESCRIPTOR = !!descriptor$1 && !(descriptor$1.writable && descriptor$1.configurable); var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK; @@ -13749,14 +13967,14 @@ var doric = (function (exports) { if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { { - defineProperty(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException)); + defineProperty$1(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException)); } for (var key in domExceptionConstants) { if (hasOwnProperty_1(domExceptionConstants, key)) { var constant = domExceptionConstants[key]; var constantName = constant.s; if (!hasOwnProperty_1(PolyfilledDOMException, constantName)) { - defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c)); + defineProperty$1(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c)); } } } } @@ -13794,6 +14012,42 @@ var doric = (function (exports) { } }); + var $TypeError = TypeError; + // eslint-disable-next-line es/no-object-defineproperty -- safe + var defineProperty = Object.defineProperty; + var INCORRECT_VALUE = global_1.self !== global_1; + + // `self` getter + // https://html.spec.whatwg.org/multipage/window-object.html#dom-self + try { + if (descriptors) { + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe + var descriptor = Object.getOwnPropertyDescriptor(global_1, 'self'); + // some engines have `self`, but with incorrect descriptor + // https://github.com/denoland/deno/issues/15765 + if (INCORRECT_VALUE || !descriptor || !descriptor.get || !descriptor.enumerable) { + defineBuiltInAccessor(global_1, 'self', { + get: function self() { + return global_1; + }, + set: function self(value) { + if (this !== global_1) { throw $TypeError('Illegal invocation'); } + defineProperty(global_1, 'self', { + value: value, + writable: true, + configurable: true, + enumerable: true + }); + }, + configurable: true, + enumerable: true + }); + } + } else { _export({ global: true, simple: true, forced: INCORRECT_VALUE }, { + self: global_1 + }); } + } catch (error) { /* empty */ } + var Object$1 = global_1.Object; var Date$1 = global_1.Date; var Error$1 = global_1.Error; @@ -13818,10 +14072,10 @@ var doric = (function (exports) { var setAdd = functionUncurryThis(Set$1.prototype.add); var objectKeys = getBuiltIn('Object', 'keys'); var push$3 = functionUncurryThis([].push); - var booleanValueOf = functionUncurryThis(true.valueOf); - var numberValueOf = functionUncurryThis(1.0.valueOf); - var stringValueOf = functionUncurryThis(''.valueOf); - var getTime = functionUncurryThis(Date$1.prototype.getTime); + var thisBooleanValue = functionUncurryThis(true.valueOf); + var thisNumberValue = functionUncurryThis(1.0.valueOf); + var thisStringValue = functionUncurryThis(''.valueOf); + var thisTimeValue = functionUncurryThis(Date$1.prototype.getTime); var PERFORMANCE_MARK = uid('structuredClone'); var DATA_CLONE_ERROR = 'DataCloneError'; var TRANSFERRING = 'Transferring'; @@ -13890,8 +14144,20 @@ var doric = (function (exports) { throw new DOMException('Uncloneable type: ' + type, DATA_CLONE_ERROR); }; - var throwUnpolyfillable = function (type, kind) { - throw new DOMException((kind || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR); + var throwUnpolyfillable = function (type, action) { + throw new DOMException((action || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR); + }; + + var createDataTransfer = function () { + var dataTransfer; + try { + dataTransfer = new global_1.DataTransfer(); + } catch (error) { + try { + dataTransfer = new global_1.ClipboardEvent('').clipboardData; + } catch (error2) { /* empty */ } + } + return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null; }; var structuredCloneInternal = function (value, map) { @@ -14008,9 +14274,8 @@ var doric = (function (exports) { } break; case 'FileList': - C = global_1.DataTransfer; - if (isConstructor(C)) { - dataTransfer = new C(); + dataTransfer = createDataTransfer(); + if (dataTransfer) { for (i = 0, length = lengthOfArrayLike(value); i < length; i++) { dataTransfer.items.add(structuredCloneInternal(value[i], map)); } @@ -14042,16 +14307,16 @@ var doric = (function (exports) { cloned = Object$1(value.valueOf()); break; case 'Boolean': - cloned = Object$1(booleanValueOf(value)); + cloned = Object$1(thisBooleanValue(value)); break; case 'Number': - cloned = Object$1(numberValueOf(value)); + cloned = Object$1(thisNumberValue(value)); break; case 'String': - cloned = Object$1(stringValueOf(value)); + cloned = Object$1(thisStringValue(value)); break; case 'Date': - cloned = new Date$1(getTime(value)); + cloned = new Date$1(thisTimeValue(value)); break; case 'ArrayBuffer': C = global_1.DataView; @@ -14128,9 +14393,13 @@ var doric = (function (exports) { } catch (error$8) { throwUnpolyfillable(type); } break; + case 'CropTarget': case 'CryptoKey': - case 'GPUCompilationMessage': + case 'FileSystemDirectoryHandle': + case 'FileSystemFileHandle': + case 'FileSystemHandle': case 'GPUCompilationInfo': + case 'GPUCompilationMessage': case 'ImageBitmap': case 'RTCCertificate': case 'WebAssembly.Module': @@ -14229,6 +14498,7 @@ var doric = (function (exports) { } catch (error$1) { /* empty */ } break; case 'ArrayBuffer': + case 'MediaSourceHandle': case 'MessagePort': case 'OffscreenCanvas': case 'ReadableStream': @@ -14242,9 +14512,11 @@ var doric = (function (exports) { } } }; + // `structuredClone` method + // https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone _export({ global: true, enumerable: true, sham: !PROPER_TRANSFER, forced: FORCED_REPLACEMENT }, { structuredClone: function structuredClone(value /* , { transfer } */) { - var options = validateArgumentsLength(arguments.length, 1) > 1 && arguments[1] != null ? anObject(arguments[1]) : undefined; + var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : undefined; var transfer = options ? options.transfer : undefined; var map; @@ -14300,7 +14572,7 @@ var doric = (function (exports) { var ITERATOR$1 = wellKnownSymbol('iterator'); - var nativeUrl = !fails(function () { + var urlConstructorDetection = !fails(function () { // eslint-disable-next-line unicorn/relative-url-style -- required for testing var url = new URL('b?a=1&b=2&c=3', 'http://a'); var searchParams = url.searchParams; @@ -14545,7 +14817,7 @@ var doric = (function (exports) { var setInternalState$1 = internalState.set; var getInternalParamsState = internalState.getterFor(URL_SEARCH_PARAMS); var getInternalIteratorState = internalState.getterFor(URL_SEARCH_PARAMS_ITERATOR); - // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe + // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Avoid NodeJS experimental warning @@ -14620,7 +14892,7 @@ var doric = (function (exports) { return replace$1(encodeURIComponent$1(it), find, replacer); }; - var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { + var URLSearchParamsIterator = iteratorCreateConstructor(function Iterator(params, kind) { setInternalState$1(this, { type: URL_SEARCH_PARAMS_ITERATOR, iterator: getIterator(getInternalParamsState(params).entries), @@ -14848,12 +15120,12 @@ var doric = (function (exports) { setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); - _export({ global: true, constructor: true, forced: !nativeUrl }, { + _export({ global: true, constructor: true, forced: !urlConstructorDetection }, { URLSearchParams: URLSearchParamsConstructor }); // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams` - if (!nativeUrl && isCallable(Headers)) { + if (!urlConstructorDetection && isCallable(Headers)) { var headersHas = functionUncurryThis(HeadersPrototype.has); var headersSet = functionUncurryThis(HeadersPrototype.set); @@ -15940,7 +16212,7 @@ var doric = (function (exports) { setToStringTag(URLConstructor, 'URL'); - _export({ global: true, constructor: true, forced: !nativeUrl, sham: !descriptors }, { + _export({ global: true, constructor: true, forced: !urlConstructorDetection, sham: !descriptors }, { URL: URLConstructor }); diff --git a/doric-js/bundle/doric-sandbox.js b/doric-js/bundle/doric-sandbox.js index 031f229f..c91931f6 100644 --- a/doric-js/bundle/doric-sandbox.js +++ b/doric-js/bundle/doric-sandbox.js @@ -1273,6 +1273,16 @@ var doric = (function (exports) { } } class Context { + hookBeforeNativeCall() { + if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) { + Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []); + } + } + hookAfterNativeCall() { + if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) { + Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []); + } + } constructor(id) { this.callbacks = new Map; this.classes = new Map; @@ -1307,16 +1317,6 @@ var doric = (function (exports) { } }); } - hookBeforeNativeCall() { - if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) { - Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []); - } - } - hookAfterNativeCall() { - if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) { - Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []); - } - } callNative(namespace, method, args) { const callbackId = uniqueId('callback'); return new Promise((resolve, reject) => { diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index 0a396838..4e5283bf 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -1284,6 +1284,16 @@ function jsCallReject(contextId, callbackId, args) { } } class Context { + hookBeforeNativeCall() { + if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) { + Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []); + } + } + hookAfterNativeCall() { + if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) { + Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []); + } + } constructor(id) { this.callbacks = new Map; this.classes = new Map; @@ -1318,16 +1328,6 @@ class Context { } }); } - hookBeforeNativeCall() { - if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) { - Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []); - } - } - hookAfterNativeCall() { - if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) { - Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []); - } - } callNative(namespace, method, args) { const callbackId = uniqueId('callback'); return new Promise((resolve, reject) => { @@ -1701,6 +1701,24 @@ function createRef() { return new Ref; } class View { + callback2Id(f) { + const id = uniqueId('Function'); + this.callbacks.set(id, f); + return id; + } + id2Callback(id) { + let f = this.callbacks.get(id); + if (f === undefined) { + f = Reflect.get(this, id); + } + return f; + } + findViewByTag(tag) { + if (tag === this.tag) { + return this; + } + return undefined; + } constructor() { this.width = 0; this.height = 0; @@ -1732,24 +1750,6 @@ class View { } }); } - callback2Id(f) { - const id = uniqueId('Function'); - this.callbacks.set(id, f); - return id; - } - id2Callback(id) { - let f = this.callbacks.get(id); - if (f === undefined) { - f = Reflect.get(this, id); - } - return f; - } - findViewByTag(tag) { - if (tag === this.tag) { - return this; - } - return undefined; - } /** Anchor start*/ get left() { return this.x; @@ -4168,6 +4168,10 @@ __decorate$6([ Property, __metadata$6("design:type", Gravity) ], Input.prototype, "textAlignment", void 0); +__decorate$6([ + Property, + __metadata$6("design:type", String) +], Input.prototype, "fontStyle", void 0); __decorate$6([ Property, __metadata$6("design:type", Function) diff --git a/doric-js/index.d.ts b/doric-js/index.d.ts index ad8a3ee6..285eb76f 100644 --- a/doric-js/index.d.ts +++ b/doric-js/index.d.ts @@ -1,5 +1,5 @@ declare module "doric" { - // Generated by dts-bundle-generator v6.12.0 + // Generated by dts-bundle-generator v6.13.0 export interface Modeling { toModel(): Model; @@ -1255,6 +1255,7 @@ declare module "doric" { hintTextColor?: Color; multiline?: boolean; textAlignment?: Gravity; + fontStyle?: "normal" | "bold" | "italic" | "bold_italic"; onTextChange?: (text?: string) => void; onFocusChange?: (focused: boolean) => void; maxLength?: number; diff --git a/doric-js/lib/index.web.d.ts b/doric-js/lib/index.web.d.ts index eb11d5b1..7e8d60d6 100644 --- a/doric-js/lib/index.web.d.ts +++ b/doric-js/lib/index.web.d.ts @@ -4,8 +4,8 @@ declare module NativeClient { function callNative(name: string, args: string): string; function fetchArrayBuffer(id: string): string; } -declare type RawValue = number | string | boolean | object | undefined | ArrayBuffer; -declare type WrappedValue = { +type RawValue = number | string | boolean | object | undefined | ArrayBuffer; +type WrappedValue = { type: "number" | "string" | "boolean" | "object" | "array" | "null" | "arrayBuffer"; value: RawValue; }; diff --git a/doric-js/lib/src/pattern/mvvm.d.ts b/doric-js/lib/src/pattern/mvvm.d.ts index bc0be37f..4255fb33 100644 --- a/doric-js/lib/src/pattern/mvvm.d.ts +++ b/doric-js/lib/src/pattern/mvvm.d.ts @@ -5,7 +5,7 @@ import { ClassType } from "../util/types"; export declare abstract class ViewHolder { abstract build(root: Group): void; } -export declare type Setter = (state: M) => void; +export type Setter = (state: M) => void; export declare abstract class ViewModel { context: BridgeContext; private state; diff --git a/doric-js/lib/src/pattern/provider.d.ts b/doric-js/lib/src/pattern/provider.d.ts index 008573d9..10cf0299 100644 --- a/doric-js/lib/src/pattern/provider.d.ts +++ b/doric-js/lib/src/pattern/provider.d.ts @@ -1,5 +1,5 @@ -export declare type Observer = (v: T) => void; -export declare type Updater = (v: T) => T; +export type Observer = (v: T) => void; +export type Updater = (v: T) => T; export interface IObservable { addObserver(observer: Observer): void; removeObserver(observer: Observer): void; diff --git a/doric-js/lib/src/runtime/global.d.ts b/doric-js/lib/src/runtime/global.d.ts index d401ded8..e0e1ef9f 100644 --- a/doric-js/lib/src/runtime/global.d.ts +++ b/doric-js/lib/src/runtime/global.d.ts @@ -1,6 +1,6 @@ import { Panel } from "../ui/panel"; import { ClassType } from "../util/types"; -export declare type BridgeContext = { +export type BridgeContext = { /** * The identify of current context */ diff --git a/doric-js/lib/src/runtime/sandbox.d.ts b/doric-js/lib/src/runtime/sandbox.d.ts index 24ef9440..1b182286 100644 --- a/doric-js/lib/src/runtime/sandbox.d.ts +++ b/doric-js/lib/src/runtime/sandbox.d.ts @@ -23,9 +23,9 @@ export declare function jsObtainContext(id: string): Context | undefined; export declare function jsReleaseContext(id: string): void; export declare function __require__(name: string): any; export declare function jsRegisterModule(name: string, moduleObject: any): void; -export declare function jsCallEntityMethod(contextId: string, methodName: string, args?: any): any; -export declare function pureCallEntityMethod(contextId: string, methodName: string, args?: any): any; -declare type ClassType = new (...args: any) => T; +export declare function jsCallEntityMethod(contextId: string, methodName: string, args?: any): unknown; +export declare function pureCallEntityMethod(contextId: string, methodName: string, args?: any): unknown; +type ClassType = new (...args: any) => T; export declare function jsObtainEntry(contextId: string): () => ClassType | ((constructor: ClassType) => ClassType); export declare function jsCallbackTimer(timerId: number): void; export declare function jsHookAfterNativeCall(): void; diff --git a/doric-js/lib/src/runtime/sandbox.js b/doric-js/lib/src/runtime/sandbox.js index f6210344..a08e6e57 100644 --- a/doric-js/lib/src/runtime/sandbox.js +++ b/doric-js/lib/src/runtime/sandbox.js @@ -71,6 +71,16 @@ export function jsCallReject(contextId, callbackId, args) { } } export class Context { + hookBeforeNativeCall() { + if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) { + Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []); + } + } + hookAfterNativeCall() { + if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) { + Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []); + } + } constructor(id) { this.callbacks = new Map; this.classes = new Map; @@ -105,16 +115,6 @@ export class Context { } }); } - hookBeforeNativeCall() { - if (this.entity && Reflect.has(this.entity, 'hookBeforeNativeCall')) { - Reflect.apply(Reflect.get(this.entity, 'hookBeforeNativeCall'), this.entity, []); - } - } - hookAfterNativeCall() { - if (this.entity && Reflect.has(this.entity, 'hookAfterNativeCall')) { - Reflect.apply(Reflect.get(this.entity, 'hookAfterNativeCall'), this.entity, []); - } - } callNative(namespace, method, args) { const callbackId = uniqueId('callback'); return new Promise((resolve, reject) => { diff --git a/doric-js/lib/src/ui/animation.d.ts b/doric-js/lib/src/ui/animation.d.ts index 3645978c..61400a48 100644 --- a/doric-js/lib/src/ui/animation.d.ts +++ b/doric-js/lib/src/ui/animation.d.ts @@ -1,6 +1,6 @@ import { Color } from "../util/color"; import { Modeling, Model } from "../util/types"; -export declare type AnimatedKey = "translationX" | "translationY" | "scaleX" | "scaleY" | "rotation" | "pivotX" | "pivotY" | "rotationX" | "rotationY" | "backgroundColor" | "alpha"; +export type AnimatedKey = "translationX" | "translationY" | "scaleX" | "scaleY" | "rotation" | "pivotX" | "pivotY" | "rotationX" | "rotationY" | "backgroundColor" | "alpha"; export declare enum RepeatMode { RESTART = 1, REVERSE = 2 diff --git a/doric-js/lib/src/ui/view.d.ts b/doric-js/lib/src/ui/view.d.ts index 4ca31021..0d1f7735 100644 --- a/doric-js/lib/src/ui/view.d.ts +++ b/doric-js/lib/src/ui/view.d.ts @@ -7,14 +7,14 @@ import { FlexConfig } from "../util/flexbox"; export declare function Property(target: Object, propKey: string): void; export declare function InconsistProperty(target: Object, propKey: string): void; export declare function ViewComponent(constructor: ClassType): void; -export declare type NativeViewModel = { +export type NativeViewModel = { id: string; type: string; props: { [index: string]: Model; }; }; -declare type RefType = T extends Ref ? R : never; +type RefType = T extends Ref ? R : never; export declare class Ref { private view?; set current(v: T); @@ -151,8 +151,8 @@ export declare abstract class Superview extends View { clean(): void; toModel(): NativeViewModel; } -export declare type ViewArray = View[]; -export declare type ViewFragment = View | ViewArray | undefined | null; +export type ViewArray = View[]; +export type ViewFragment = View | ViewArray | undefined | null; export declare abstract class Group extends Superview implements JSX.ElementChildrenAttribute { padding?: { left?: number; diff --git a/doric-js/lib/src/ui/view.js b/doric-js/lib/src/ui/view.js index a4218db8..e60c0007 100644 --- a/doric-js/lib/src/ui/view.js +++ b/doric-js/lib/src/ui/view.js @@ -43,6 +43,24 @@ export function createRef() { return new Ref; } export class View { + callback2Id(f) { + const id = uniqueId('Function'); + this.callbacks.set(id, f); + return id; + } + id2Callback(id) { + let f = this.callbacks.get(id); + if (f === undefined) { + f = Reflect.get(this, id); + } + return f; + } + findViewByTag(tag) { + if (tag === this.tag) { + return this; + } + return undefined; + } constructor() { this.width = 0; this.height = 0; @@ -74,24 +92,6 @@ export class View { } }); } - callback2Id(f) { - const id = uniqueId('Function'); - this.callbacks.set(id, f); - return id; - } - id2Callback(id) { - let f = this.callbacks.get(id); - if (f === undefined) { - f = Reflect.get(this, id); - } - return f; - } - findViewByTag(tag) { - if (tag === this.tag) { - return this; - } - return undefined; - } /** Anchor start*/ get left() { return this.x; diff --git a/doric-js/lib/src/util/flexbox.d.ts b/doric-js/lib/src/util/flexbox.d.ts index e59e2de0..b781d2d0 100644 --- a/doric-js/lib/src/util/flexbox.d.ts +++ b/doric-js/lib/src/util/flexbox.d.ts @@ -64,7 +64,7 @@ export declare enum Display { FLEX = 0, NONE = 1 } -export declare type FlexValue = FlexTypedValue | number; +export type FlexValue = FlexTypedValue | number; export interface FlexConfig { direction?: Direction; flexDirection?: FlexDirection; diff --git a/doric-js/lib/src/util/types.d.ts b/doric-js/lib/src/util/types.d.ts index 7c7fbc7e..d6a7551b 100644 --- a/doric-js/lib/src/util/types.d.ts +++ b/doric-js/lib/src/util/types.d.ts @@ -2,11 +2,11 @@ export interface Modeling { toModel(): Model; } export declare function obj2Model(obj: Model, convertor: (v: Function) => string): Model; -declare type _M = string | number | boolean | Modeling | { +type _M = string | number | boolean | Modeling | { [index: string]: Model; } | undefined; -export declare type Model = _M | Array<_M>; -export declare type Binder = (v: T) => void; +export type Model = _M | Array<_M>; +export type Binder = (v: T) => void; export declare class Mutable { private val; private binders; @@ -16,5 +16,5 @@ export declare class Mutable { bind(binder: Binder): void; static of(v: E): Mutable; } -export declare type ClassType = new (...args: any) => T; +export type ClassType = new (...args: any) => T; export {}; diff --git a/doric-js/lib/src/widget/input.d.ts b/doric-js/lib/src/widget/input.d.ts index 1bbaf84a..860b0ed5 100644 --- a/doric-js/lib/src/widget/input.d.ts +++ b/doric-js/lib/src/widget/input.d.ts @@ -21,6 +21,7 @@ export declare class Input extends View { hintTextColor?: Color; multiline?: boolean; textAlignment?: Gravity; + fontStyle?: "normal" | "bold" | "italic" | "bold_italic"; onTextChange?: (text?: string) => void; onFocusChange?: (focused: boolean) => void; maxLength?: number; diff --git a/doric-js/lib/src/widget/input.js b/doric-js/lib/src/widget/input.js index 747b9701..af0695f4 100644 --- a/doric-js/lib/src/widget/input.js +++ b/doric-js/lib/src/widget/input.js @@ -95,6 +95,10 @@ __decorate([ Property, __metadata("design:type", Gravity) ], Input.prototype, "textAlignment", void 0); +__decorate([ + Property, + __metadata("design:type", String) +], Input.prototype, "fontStyle", void 0); __decorate([ Property, __metadata("design:type", Function) diff --git a/doric-js/src/widget/input.ts b/doric-js/src/widget/input.ts index 55815758..b3e1c426 100644 --- a/doric-js/src/widget/input.ts +++ b/doric-js/src/widget/input.ts @@ -60,6 +60,9 @@ export class Input extends View { @Property textAlignment?: Gravity + @Property + fontStyle?: "normal" | "bold" | "italic" | "bold_italic" + @Property onTextChange?: (text?: string) => void