jscrewit 2.32.0 → 2.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Features.md +4 -4
- package/api-doc/README.md +1 -1
- package/api-doc/interfaces/FeatureAll.md +16 -50
- package/api-doc/interfaces/FeatureConstructor.md +20 -62
- package/lib/feature-all.d.ts +11 -38
- package/lib/jscrewit.js +358 -299
- package/lib/jscrewit.min.js +2 -2
- package/package.json +3 -5
- package/readme.md +1 -1
- package/ui/ui.js +1 -1
package/lib/jscrewit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// JScrewIt 2.
|
|
1
|
+
// JScrewIt 2.34.0 – https://jscrew.it
|
|
2
2
|
|
|
3
3
|
(function () {
|
|
4
4
|
'use strict';
|
|
@@ -310,18 +310,12 @@
|
|
|
310
310
|
return unionMask;
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
var keyFor = function (mask) { return "_"
|
|
313
|
+
var keyFor = function (mask) { return "_".concat(mask); };
|
|
314
314
|
var MaskIndex = /** @class */ (function () {
|
|
315
315
|
function MaskIndex() {
|
|
316
316
|
this._index = Object.create(null);
|
|
317
317
|
this._size = 0;
|
|
318
318
|
}
|
|
319
|
-
/** Determines whether the current collection contains an entry for a specified mask. */
|
|
320
|
-
MaskIndex.prototype.has = function (mask) {
|
|
321
|
-
var key = keyFor(mask);
|
|
322
|
-
var returnValue = key in this._index;
|
|
323
|
-
return returnValue;
|
|
324
|
-
};
|
|
325
319
|
Object.defineProperty(MaskIndex.prototype, "size", {
|
|
326
320
|
/* The number of entries in the current collection. */
|
|
327
321
|
get: function () {
|
|
@@ -330,6 +324,12 @@
|
|
|
330
324
|
enumerable: false,
|
|
331
325
|
configurable: true
|
|
332
326
|
});
|
|
327
|
+
/** Determines whether the current collection contains an entry for a specified mask. */
|
|
328
|
+
MaskIndex.prototype.has = function (mask) {
|
|
329
|
+
var key = keyFor(mask);
|
|
330
|
+
var returnValue = key in this._index;
|
|
331
|
+
return returnValue;
|
|
332
|
+
};
|
|
333
333
|
MaskIndex.prototype._setEntry = function (mask, value) {
|
|
334
334
|
var key = keyFor(mask);
|
|
335
335
|
var _index = this._index;
|
|
@@ -394,10 +394,12 @@
|
|
|
394
394
|
_Object_defineProperty(target, name_1, descriptor);
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
function createFeatureClass(featureInfos) {
|
|
397
|
+
function createFeatureClass(featureInfos, formatEngineDescription) {
|
|
398
398
|
var ALL = createMap();
|
|
399
399
|
var DESCRIPTION_MAP = createMap();
|
|
400
400
|
var ELEMENTARY = [];
|
|
401
|
+
var ENGINE = [];
|
|
402
|
+
var FAMILIES = createMap();
|
|
401
403
|
var FEATURE_PROTOTYPE = Feature.prototype;
|
|
402
404
|
var INCOMPATIBLE_MASK_LIST = [];
|
|
403
405
|
var PRISTINE_ELEMENTARY;
|
|
@@ -487,14 +489,9 @@
|
|
|
487
489
|
featureObj = null;
|
|
488
490
|
return featureObj;
|
|
489
491
|
}
|
|
490
|
-
function createFeature(name, mask, check,
|
|
492
|
+
function createFeature(name, mask, check, attributes, elementary) {
|
|
491
493
|
_Object_freeze(attributes);
|
|
492
|
-
var descriptors = {
|
|
493
|
-
attributes: { value: attributes },
|
|
494
|
-
check: { value: check },
|
|
495
|
-
engine: { value: engine },
|
|
496
|
-
name: { value: name },
|
|
497
|
-
};
|
|
494
|
+
var descriptors = { attributes: { value: attributes }, check: { value: check }, name: { value: name } };
|
|
498
495
|
if (elementary)
|
|
499
496
|
descriptors.elementary = { value: true };
|
|
500
497
|
var featureObj = _Object_create(FEATURE_PROTOTYPE, descriptors);
|
|
@@ -546,14 +543,9 @@
|
|
|
546
543
|
if (this.check)
|
|
547
544
|
parts.push('(check)');
|
|
548
545
|
{
|
|
549
|
-
var
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
container.engine = engine;
|
|
553
|
-
if (attributes !== undefined)
|
|
554
|
-
container.attributes = __assign({}, attributes);
|
|
555
|
-
if (_Object_keys(container).length) {
|
|
556
|
-
var str_1 = utilInspect(container, opts);
|
|
546
|
+
var attributes = this.attributes;
|
|
547
|
+
if (typeof attributes === 'object') {
|
|
548
|
+
var str_1 = utilInspect(__assign({}, attributes), opts);
|
|
557
549
|
parts.push(str_1);
|
|
558
550
|
}
|
|
559
551
|
}
|
|
@@ -642,8 +634,8 @@
|
|
|
642
634
|
name: undefined,
|
|
643
635
|
toString: function () {
|
|
644
636
|
var _a;
|
|
645
|
-
var name = (_a = this.name) !== null && _a !== void 0 ? _a : "<"
|
|
646
|
-
var str = "[Feature "
|
|
637
|
+
var name = (_a = this.name) !== null && _a !== void 0 ? _a : "<".concat(this.canonicalNames.join(', '), ">");
|
|
638
|
+
var str = "[Feature ".concat(name, "]");
|
|
647
639
|
return str;
|
|
648
640
|
},
|
|
649
641
|
};
|
|
@@ -652,6 +644,9 @@
|
|
|
652
644
|
assignNoEnum(FEATURE_PROTOTYPE, protoSource);
|
|
653
645
|
}
|
|
654
646
|
(function () {
|
|
647
|
+
var compareFeatureNames = function (feature1, feature2) {
|
|
648
|
+
return feature1.name < feature2.name ? -1 : 1;
|
|
649
|
+
};
|
|
655
650
|
function completeExclusions() {
|
|
656
651
|
var incompatibleMaskSet = new MaskSet();
|
|
657
652
|
for (var _i = 0, featureNames_1 = featureNames; _i < featureNames_1.length; _i++) {
|
|
@@ -695,6 +690,7 @@
|
|
|
695
690
|
if (inherits != null)
|
|
696
691
|
completeFeature(inherits);
|
|
697
692
|
var wrappedCheck = void 0;
|
|
693
|
+
var compatibilities = void 0;
|
|
698
694
|
var check = info_1.check;
|
|
699
695
|
if (check !== undefined) {
|
|
700
696
|
mask = maskNext(unionMask);
|
|
@@ -736,7 +732,37 @@
|
|
|
736
732
|
mask = maskUnion(mask, includeMask);
|
|
737
733
|
}
|
|
738
734
|
}
|
|
739
|
-
|
|
735
|
+
if ('versions' in info_1) {
|
|
736
|
+
var families = info_1.families;
|
|
737
|
+
var versions_1 = info_1.versions;
|
|
738
|
+
if (inherits != null)
|
|
739
|
+
families !== null && families !== void 0 ? families : (families = familiesMap[inherits]);
|
|
740
|
+
familiesMap[name] = families;
|
|
741
|
+
var tag_1 = getInfoStringField('compatibilityTag');
|
|
742
|
+
var shortTag_1 = getInfoStringField('compatibilityShortTag');
|
|
743
|
+
compatibilities =
|
|
744
|
+
families.map(function (family, index) {
|
|
745
|
+
var _a;
|
|
746
|
+
family = esToString(family);
|
|
747
|
+
var versionInfo = versions_1[index];
|
|
748
|
+
var version;
|
|
749
|
+
if (_Array_isArray(versionInfo)) {
|
|
750
|
+
var length_1 = versionInfo.length;
|
|
751
|
+
var from = esToString(versionInfo[0]);
|
|
752
|
+
var to = length_1 < 2 ? undefined : esToString(versionInfo[length_1 - 1]);
|
|
753
|
+
var dense = versionInfo.length === 2;
|
|
754
|
+
version = _Object_freeze({ from: from, to: to, dense: dense });
|
|
755
|
+
}
|
|
756
|
+
else
|
|
757
|
+
version = esToString(versionInfo);
|
|
758
|
+
var compatibility = _Object_freeze({ family: family, featureName: name, version: version, tag: tag_1, shortTag: shortTag_1 });
|
|
759
|
+
var familyCompatibilities = (_a = FAMILIES[family]) !== null && _a !== void 0 ? _a : (FAMILIES[family] = []);
|
|
760
|
+
familyCompatibilities.push(compatibility);
|
|
761
|
+
return compatibility;
|
|
762
|
+
});
|
|
763
|
+
if (description == null)
|
|
764
|
+
description = formatEngineDescription === null || formatEngineDescription === void 0 ? void 0 : formatEngineDescription(compatibilities);
|
|
765
|
+
}
|
|
740
766
|
var attributes = createMap();
|
|
741
767
|
if (inherits != null) {
|
|
742
768
|
var inheritedAttributes = ALL[inherits].attributes;
|
|
@@ -760,10 +786,11 @@
|
|
|
760
786
|
}
|
|
761
787
|
}
|
|
762
788
|
var elementary = wrappedCheck !== null && wrappedCheck !== void 0 ? wrappedCheck : info_1.excludes;
|
|
763
|
-
featureObj =
|
|
764
|
-
createFeature(name, mask, wrappedCheck, engine, attributes, elementary);
|
|
789
|
+
featureObj = createFeature(name, mask, wrappedCheck, attributes, elementary);
|
|
765
790
|
if (elementary)
|
|
766
791
|
ELEMENTARY.push(featureObj);
|
|
792
|
+
if (compatibilities)
|
|
793
|
+
ENGINE.push(featureObj);
|
|
767
794
|
}
|
|
768
795
|
ALL[name] = featureObj;
|
|
769
796
|
DESCRIPTION_MAP[name] = description;
|
|
@@ -774,6 +801,8 @@
|
|
|
774
801
|
var constructorSource = {
|
|
775
802
|
ALL: ALL,
|
|
776
803
|
ELEMENTARY: ELEMENTARY,
|
|
804
|
+
ENGINE: ENGINE,
|
|
805
|
+
FAMILIES: FAMILIES,
|
|
777
806
|
_fromMask: _fromMask,
|
|
778
807
|
_getMask: _getMask,
|
|
779
808
|
areCompatible: areCompatible,
|
|
@@ -791,13 +820,19 @@
|
|
|
791
820
|
}
|
|
792
821
|
var featureNames = _Object_keys(featureInfos);
|
|
793
822
|
var includeSetMap = createMap();
|
|
823
|
+
var familiesMap = createMap();
|
|
794
824
|
var unionMask = maskNew();
|
|
795
825
|
featureNames.forEach(completeFeature);
|
|
796
826
|
completeExclusions();
|
|
797
827
|
PRISTINE_ELEMENTARY = ELEMENTARY.slice();
|
|
798
|
-
ELEMENTARY.sort(
|
|
828
|
+
ELEMENTARY.sort(compareFeatureNames);
|
|
799
829
|
_Object_freeze(ELEMENTARY);
|
|
830
|
+
ENGINE.sort(compareFeatureNames);
|
|
831
|
+
_Object_freeze(ENGINE);
|
|
800
832
|
_Object_freeze(ALL);
|
|
833
|
+
_Object_freeze(FAMILIES);
|
|
834
|
+
for (var family in FAMILIES)
|
|
835
|
+
_Object_freeze(FAMILIES[family]);
|
|
801
836
|
})();
|
|
802
837
|
return Feature;
|
|
803
838
|
}
|
|
@@ -836,12 +871,12 @@
|
|
|
836
871
|
return false;
|
|
837
872
|
}
|
|
838
873
|
var str = parts.length && (!compact || isMultiline()) ?
|
|
839
|
-
intro
|
|
840
|
-
""
|
|
874
|
+
"".concat(intro, "\n").concat(indent(parts.join("".concat(partSeparator, "\n"))), "\n").concat(outro) :
|
|
875
|
+
"".concat(intro).concat(preSeparator).concat(parts.join("".concat(partSeparator, " "))).concat(outro);
|
|
841
876
|
return str;
|
|
842
877
|
}
|
|
843
878
|
function throwUnknownFeatureError(name) {
|
|
844
|
-
throw new _Error("Unknown feature "
|
|
879
|
+
throw new _Error("Unknown feature ".concat(_JSON_stringify(name)));
|
|
845
880
|
}
|
|
846
881
|
function wrapCheck(check) {
|
|
847
882
|
var wrappedCheck = function () { return !!check(); };
|
|
@@ -875,6 +910,12 @@
|
|
|
875
910
|
return available;
|
|
876
911
|
}
|
|
877
912
|
|
|
913
|
+
function describeEngine(engine)
|
|
914
|
+
{
|
|
915
|
+
var description = 'Features available in ' + engine + '.';
|
|
916
|
+
return description;
|
|
917
|
+
}
|
|
918
|
+
|
|
878
919
|
function isExcludingAttribute(restrictionCache, restrictionName, featureObjs)
|
|
879
920
|
{
|
|
880
921
|
var returnValue = restrictionCache[restrictionName];
|
|
@@ -1681,6 +1722,7 @@
|
|
|
1681
1722
|
includes:
|
|
1682
1723
|
[
|
|
1683
1724
|
'ARROW',
|
|
1725
|
+
'AT',
|
|
1684
1726
|
'ATOB',
|
|
1685
1727
|
'BARPROP',
|
|
1686
1728
|
'ESC_HTML_QUOT_ONLY',
|
|
@@ -1710,7 +1752,8 @@
|
|
|
1710
1752
|
},
|
|
1711
1753
|
ANDRO_4_0:
|
|
1712
1754
|
{
|
|
1713
|
-
|
|
1755
|
+
families: ['Android Browser'],
|
|
1756
|
+
versions: ['4.0'],
|
|
1714
1757
|
includes:
|
|
1715
1758
|
[
|
|
1716
1759
|
'ATOB',
|
|
@@ -1730,14 +1773,14 @@
|
|
|
1730
1773
|
},
|
|
1731
1774
|
ANDRO_4_1:
|
|
1732
1775
|
{
|
|
1733
|
-
engine: 'Android Browser 4.1 to 4.3',
|
|
1734
1776
|
inherits: 'ANDRO_4_0',
|
|
1777
|
+
versions: [['4.1',, '4.3']],
|
|
1735
1778
|
includes: { GENERIC_ARRAY_TO_STRING: true, OBJECT_UNDEFINED: true },
|
|
1736
1779
|
},
|
|
1737
1780
|
ANDRO_4_4:
|
|
1738
1781
|
{
|
|
1739
|
-
engine: 'Android Browser 4.4',
|
|
1740
1782
|
inherits: 'ANDRO_4_1',
|
|
1783
|
+
versions: ['4.4'],
|
|
1741
1784
|
includes:
|
|
1742
1785
|
{
|
|
1743
1786
|
BARPROP: true,
|
|
@@ -1753,17 +1796,18 @@
|
|
|
1753
1796
|
},
|
|
1754
1797
|
CHROME_PREV:
|
|
1755
1798
|
{
|
|
1756
|
-
|
|
1799
|
+
description: describeEngine('the previous to current versions of Chrome and Edge'),
|
|
1757
1800
|
aliasFor: 'CHROME_92',
|
|
1758
1801
|
},
|
|
1759
1802
|
CHROME:
|
|
1760
1803
|
{
|
|
1761
|
-
|
|
1804
|
+
description: describeEngine('the current stable versions of Chrome, Edge and Opera'),
|
|
1762
1805
|
aliasFor: 'CHROME_92',
|
|
1763
1806
|
},
|
|
1764
1807
|
CHROME_92:
|
|
1765
1808
|
{
|
|
1766
|
-
|
|
1809
|
+
families: ['Chrome', 'Edge', 'Opera'],
|
|
1810
|
+
versions: [['92'], ['92'], ['78']],
|
|
1767
1811
|
includes:
|
|
1768
1812
|
[
|
|
1769
1813
|
'ARROW',
|
|
@@ -1799,15 +1843,27 @@
|
|
|
1799
1843
|
},
|
|
1800
1844
|
FF_ESR:
|
|
1801
1845
|
{
|
|
1802
|
-
|
|
1803
|
-
aliasFor: '
|
|
1846
|
+
description: describeEngine('the current version of Firefox ESR'),
|
|
1847
|
+
aliasFor: 'FF_90',
|
|
1804
1848
|
},
|
|
1805
|
-
|
|
1849
|
+
FF_PREV:
|
|
1806
1850
|
{
|
|
1807
|
-
|
|
1851
|
+
description: describeEngine('the previous to current version of Firefox'),
|
|
1852
|
+
aliasFor: 'FF_90',
|
|
1853
|
+
},
|
|
1854
|
+
FF:
|
|
1855
|
+
{
|
|
1856
|
+
description: describeEngine('the current stable version of Firefox'),
|
|
1857
|
+
aliasFor: 'FF_90',
|
|
1858
|
+
},
|
|
1859
|
+
FF_90:
|
|
1860
|
+
{
|
|
1861
|
+
families: ['Firefox'],
|
|
1862
|
+
versions: [['90']],
|
|
1808
1863
|
includes:
|
|
1809
1864
|
[
|
|
1810
1865
|
'ARROW',
|
|
1866
|
+
'AT',
|
|
1811
1867
|
'ATOB',
|
|
1812
1868
|
'BARPROP',
|
|
1813
1869
|
'ESC_HTML_QUOT_ONLY',
|
|
@@ -1824,12 +1880,12 @@
|
|
|
1824
1880
|
'HISTORY',
|
|
1825
1881
|
'HTMLDOCUMENT',
|
|
1826
1882
|
'INCR_CHAR',
|
|
1883
|
+
'INTL',
|
|
1827
1884
|
'LOCALE_INFINITY',
|
|
1828
1885
|
'LOCALE_NUMERALS_EXT',
|
|
1829
1886
|
'LOCATION',
|
|
1830
1887
|
'NAME',
|
|
1831
1888
|
'NO_OLD_SAFARI_ARRAY_ITERATOR',
|
|
1832
|
-
'PLAIN_INTL',
|
|
1833
1889
|
'REGEXP_STRING_ITERATOR',
|
|
1834
1890
|
'SHORT_LOCALES',
|
|
1835
1891
|
'STATUS',
|
|
@@ -1838,31 +1894,10 @@
|
|
|
1838
1894
|
attributes:
|
|
1839
1895
|
{ 'char-increment-restriction': null, 'unstable': null, 'web-worker-restriction': null },
|
|
1840
1896
|
},
|
|
1841
|
-
FF_PREV:
|
|
1842
|
-
{
|
|
1843
|
-
engine: 'the previous to current version of Firefox',
|
|
1844
|
-
aliasFor: 'FF_83',
|
|
1845
|
-
},
|
|
1846
|
-
FF_83:
|
|
1847
|
-
{
|
|
1848
|
-
engine: 'Firefox 83 to 89',
|
|
1849
|
-
inherits: 'FF_78',
|
|
1850
|
-
includes: { INTL: true, PLAIN_INTL: false },
|
|
1851
|
-
},
|
|
1852
|
-
FF:
|
|
1853
|
-
{
|
|
1854
|
-
engine: 'the current stable version of Firefox',
|
|
1855
|
-
aliasFor: 'FF_90',
|
|
1856
|
-
},
|
|
1857
|
-
FF_90:
|
|
1858
|
-
{
|
|
1859
|
-
engine: 'Firefox 90 or later',
|
|
1860
|
-
inherits: 'FF_83',
|
|
1861
|
-
includes: { AT: true },
|
|
1862
|
-
},
|
|
1863
1897
|
IE_9:
|
|
1864
1898
|
{
|
|
1865
|
-
|
|
1899
|
+
families: ['Internet Explorer'],
|
|
1900
|
+
versions: ['9'],
|
|
1866
1901
|
includes:
|
|
1867
1902
|
[
|
|
1868
1903
|
'CAPITAL_HTML',
|
|
@@ -1883,15 +1918,15 @@
|
|
|
1883
1918
|
},
|
|
1884
1919
|
IE_10:
|
|
1885
1920
|
{
|
|
1886
|
-
engine: 'Internet Explorer 10',
|
|
1887
1921
|
inherits: 'IE_9',
|
|
1922
|
+
versions: ['10'],
|
|
1888
1923
|
includes: { ATOB: true, CONSOLE: true, OBJECT_UNDEFINED: true, UNDEFINED: false },
|
|
1889
1924
|
attributes: { 'char-increment-restriction': null, 'web-worker-restriction': null },
|
|
1890
1925
|
},
|
|
1891
1926
|
IE_11:
|
|
1892
1927
|
{
|
|
1893
|
-
engine: 'Internet Explorer 11',
|
|
1894
1928
|
inherits: 'IE_10',
|
|
1929
|
+
versions: ['11'],
|
|
1895
1930
|
includes:
|
|
1896
1931
|
{
|
|
1897
1932
|
DOCUMENT: false,
|
|
@@ -1904,13 +1939,16 @@
|
|
|
1904
1939
|
},
|
|
1905
1940
|
IE_11_WIN_10:
|
|
1906
1941
|
{
|
|
1907
|
-
engine: 'Internet Explorer 11 on Windows 10',
|
|
1908
1942
|
inherits: 'IE_11',
|
|
1943
|
+
versions: ['11'],
|
|
1944
|
+
compatibilityTag: 'on Windows 10',
|
|
1945
|
+
compatibilityShortTag: 'W10',
|
|
1909
1946
|
includes: { LOCALE_INFINITY: true, LOCALE_NUMERALS: false, LOCALE_NUMERALS_EXT: true },
|
|
1910
1947
|
},
|
|
1911
1948
|
NODE_0_10:
|
|
1912
1949
|
{
|
|
1913
|
-
|
|
1950
|
+
families: ['Node.js'],
|
|
1951
|
+
versions: ['0.10'],
|
|
1914
1952
|
includes:
|
|
1915
1953
|
[
|
|
1916
1954
|
'ESC_HTML_ALL',
|
|
@@ -1925,8 +1963,8 @@
|
|
|
1925
1963
|
},
|
|
1926
1964
|
NODE_0_12:
|
|
1927
1965
|
{
|
|
1928
|
-
engine: 'Node.js 0.12',
|
|
1929
1966
|
inherits: 'NODE_0_10',
|
|
1967
|
+
versions: ['0.12'],
|
|
1930
1968
|
includes:
|
|
1931
1969
|
{
|
|
1932
1970
|
ESC_HTML_ALL: false,
|
|
@@ -1938,61 +1976,62 @@
|
|
|
1938
1976
|
},
|
|
1939
1977
|
NODE_4:
|
|
1940
1978
|
{
|
|
1941
|
-
engine: 'Node.js 4',
|
|
1942
1979
|
inherits: 'NODE_0_12',
|
|
1980
|
+
versions: ['4'],
|
|
1943
1981
|
includes: { ARROW: true, ESC_REGEXP_SLASH: true, FILL: true, FROM_CODE_POINT: true },
|
|
1944
1982
|
},
|
|
1945
1983
|
NODE_5:
|
|
1946
1984
|
{
|
|
1947
|
-
engine: 'Node.js 5 to 9',
|
|
1948
1985
|
inherits: 'NODE_4',
|
|
1986
|
+
versions: [['5',, '9']],
|
|
1949
1987
|
attributes: { 'char-increment-restriction': null },
|
|
1950
1988
|
},
|
|
1951
1989
|
NODE_10:
|
|
1952
1990
|
{
|
|
1953
|
-
engine: 'Node.js 10',
|
|
1954
1991
|
inherits: 'NODE_5',
|
|
1992
|
+
versions: ['10'],
|
|
1955
1993
|
includes: { FUNCTION_19_LF: true, FUNCTION_22_LF: false },
|
|
1956
1994
|
},
|
|
1957
1995
|
NODE_11:
|
|
1958
1996
|
{
|
|
1959
|
-
engine: 'Node.js 11',
|
|
1960
1997
|
inherits: 'NODE_10',
|
|
1998
|
+
versions: ['11'],
|
|
1961
1999
|
includes: { FLAT: true },
|
|
1962
2000
|
},
|
|
1963
2001
|
NODE_12:
|
|
1964
2002
|
{
|
|
1965
|
-
engine: 'Node.js 12',
|
|
1966
2003
|
inherits: 'NODE_11',
|
|
2004
|
+
versions: ['12'],
|
|
1967
2005
|
includes: { ESC_REGEXP_LF: true, REGEXP_STRING_ITERATOR: true },
|
|
1968
2006
|
},
|
|
1969
2007
|
NODE_13:
|
|
1970
2008
|
{
|
|
1971
|
-
engine: 'Node.js 13 and Node.js 14',
|
|
1972
2009
|
inherits: 'NODE_12',
|
|
2010
|
+
versions: [['13', '14']],
|
|
1973
2011
|
includes: { LOCALE_NUMERALS_EXT: true, SHORT_LOCALES: true },
|
|
1974
2012
|
},
|
|
1975
2013
|
NODE_15:
|
|
1976
2014
|
{
|
|
1977
|
-
engine: 'Node.js 15',
|
|
1978
2015
|
inherits: 'NODE_13',
|
|
2016
|
+
versions: ['15'],
|
|
1979
2017
|
includes: { INTL: true, PLAIN_INTL: false },
|
|
1980
2018
|
},
|
|
1981
2019
|
NODE_16_0:
|
|
1982
2020
|
{
|
|
1983
|
-
engine: 'Node.js 16.0 to 16.5',
|
|
1984
2021
|
inherits: 'NODE_15',
|
|
2022
|
+
versions: [['16.0',, '16.5']],
|
|
1985
2023
|
includes: { ATOB: true },
|
|
1986
2024
|
},
|
|
1987
2025
|
NODE_16_6:
|
|
1988
2026
|
{
|
|
1989
|
-
engine: 'Node.js 16.6 or later',
|
|
1990
2027
|
inherits: 'NODE_16_0',
|
|
2028
|
+
versions: [['16.6']],
|
|
1991
2029
|
includes: { AT: true },
|
|
1992
2030
|
},
|
|
1993
2031
|
SAFARI_7_0:
|
|
1994
2032
|
{
|
|
1995
|
-
|
|
2033
|
+
families: ['Safari'],
|
|
2034
|
+
versions: ['7.0'],
|
|
1996
2035
|
includes:
|
|
1997
2036
|
[
|
|
1998
2037
|
'ATOB',
|
|
@@ -2027,16 +2066,15 @@
|
|
|
2027
2066
|
},
|
|
2028
2067
|
SAFARI_7_1:
|
|
2029
2068
|
{
|
|
2030
|
-
engine: 'Safari 7.1 and Safari 8',
|
|
2031
2069
|
inherits: 'SAFARI_7_0',
|
|
2070
|
+
versions: [['7.1', '8']],
|
|
2032
2071
|
includes: { ARRAY_ITERATOR: true, FILL: true },
|
|
2033
2072
|
attributes: { 'no-console-in-web-worker': undefined, 'safari-bug-21820506': null },
|
|
2034
2073
|
},
|
|
2035
|
-
SAFARI_8: { aliasFor: 'SAFARI_7_1' },
|
|
2036
2074
|
SAFARI_9:
|
|
2037
2075
|
{
|
|
2038
|
-
engine: 'Safari 9',
|
|
2039
2076
|
inherits: 'SAFARI_7_1',
|
|
2077
|
+
versions: ['9'],
|
|
2040
2078
|
includes:
|
|
2041
2079
|
{
|
|
2042
2080
|
ARRAY_ITERATOR: false,
|
|
@@ -2047,8 +2085,8 @@
|
|
|
2047
2085
|
},
|
|
2048
2086
|
SAFARI_10:
|
|
2049
2087
|
{
|
|
2050
|
-
engine: 'Safari 10 and Safari 11',
|
|
2051
2088
|
inherits: 'SAFARI_9',
|
|
2089
|
+
versions: [['10', '11']],
|
|
2052
2090
|
includes:
|
|
2053
2091
|
{
|
|
2054
2092
|
ARROW: true,
|
|
@@ -2065,36 +2103,76 @@
|
|
|
2065
2103
|
},
|
|
2066
2104
|
SAFARI_12:
|
|
2067
2105
|
{
|
|
2068
|
-
engine: 'Safari 12',
|
|
2069
2106
|
inherits: 'SAFARI_10',
|
|
2107
|
+
versions: ['12'],
|
|
2070
2108
|
includes: { FLAT: true },
|
|
2071
2109
|
},
|
|
2072
2110
|
SAFARI_13:
|
|
2073
2111
|
{
|
|
2074
|
-
engine: 'Safari 13 and Safari 14.0.0',
|
|
2075
2112
|
inherits: 'SAFARI_12',
|
|
2113
|
+
versions: [['13', '14.0.0']],
|
|
2076
2114
|
includes: { REGEXP_STRING_ITERATOR: true },
|
|
2077
2115
|
},
|
|
2078
2116
|
SAFARI_14_0_1:
|
|
2079
2117
|
{
|
|
2080
|
-
engine: 'Safari 14.0.1 to 14.0.3',
|
|
2081
2118
|
inherits: 'SAFARI_13',
|
|
2119
|
+
versions: [['14.0.1',, '14.0.3']],
|
|
2082
2120
|
includes: { INTL: true, PLAIN_INTL: false },
|
|
2083
2121
|
},
|
|
2084
|
-
SAFARI:
|
|
2085
|
-
{
|
|
2086
|
-
engine: 'the current stable version of Safari',
|
|
2087
|
-
aliasFor: 'SAFARI_14_1',
|
|
2088
|
-
},
|
|
2089
2122
|
SAFARI_14_1:
|
|
2090
2123
|
{
|
|
2091
|
-
engine: 'Safari 14.1 or later',
|
|
2092
2124
|
inherits: 'SAFARI_14_0_1',
|
|
2125
|
+
versions: [['14.1',, '15.3']],
|
|
2093
2126
|
includes: { CONSOLE: false },
|
|
2094
2127
|
},
|
|
2128
|
+
SAFARI:
|
|
2129
|
+
{
|
|
2130
|
+
description: describeEngine('the current stable version of Safari'),
|
|
2131
|
+
aliasFor: 'SAFARI_15_4',
|
|
2132
|
+
},
|
|
2133
|
+
SAFARI_15_4:
|
|
2134
|
+
{
|
|
2135
|
+
inherits: 'SAFARI_14_1',
|
|
2136
|
+
versions: [['15.4']],
|
|
2137
|
+
includes: { AT: true },
|
|
2138
|
+
},
|
|
2095
2139
|
};
|
|
2096
2140
|
(function ()
|
|
2097
2141
|
{
|
|
2142
|
+
function formatEngineDescription(compatibilities)
|
|
2143
|
+
{
|
|
2144
|
+
var appendix = '';
|
|
2145
|
+
var parts =
|
|
2146
|
+
compatibilities.map
|
|
2147
|
+
(
|
|
2148
|
+
function (compatibility)
|
|
2149
|
+
{
|
|
2150
|
+
var family = compatibility.family;
|
|
2151
|
+
var version = compatibility.version;
|
|
2152
|
+
var part = family;
|
|
2153
|
+
if (typeof version === 'string')
|
|
2154
|
+
part += ' ' + version;
|
|
2155
|
+
else
|
|
2156
|
+
{
|
|
2157
|
+
part += ' ' + version.from;
|
|
2158
|
+
var to = version.to;
|
|
2159
|
+
if (to != null)
|
|
2160
|
+
part += (version.dense ? ' and ' + family + ' ' : ' to ') + to;
|
|
2161
|
+
else
|
|
2162
|
+
appendix = ' or later';
|
|
2163
|
+
}
|
|
2164
|
+
var tag = compatibility.tag;
|
|
2165
|
+
if (tag != null)
|
|
2166
|
+
part += ' ' + tag;
|
|
2167
|
+
return part;
|
|
2168
|
+
}
|
|
2169
|
+
);
|
|
2170
|
+
var lastPart = parts.pop();
|
|
2171
|
+
var engine = (parts.length ? parts.join(', ') + ' and ' + lastPart : lastPart) + appendix;
|
|
2172
|
+
var description = describeEngine(engine);
|
|
2173
|
+
return description;
|
|
2174
|
+
}
|
|
2175
|
+
|
|
2098
2176
|
var autoIncludes =
|
|
2099
2177
|
_Object_keys$1(featureInfos).filter
|
|
2100
2178
|
(
|
|
@@ -2108,23 +2186,10 @@
|
|
|
2108
2186
|
);
|
|
2109
2187
|
featureInfos.AUTO =
|
|
2110
2188
|
{
|
|
2111
|
-
|
|
2189
|
+
description: describeEngine('the current environment'),
|
|
2112
2190
|
includes: autoIncludes,
|
|
2113
2191
|
};
|
|
2114
|
-
|
|
2115
|
-
(
|
|
2116
|
-
function (featureName)
|
|
2117
|
-
{
|
|
2118
|
-
var featureInfo = featureInfos[featureName];
|
|
2119
|
-
var engine = featureInfo.engine;
|
|
2120
|
-
if (engine != null)
|
|
2121
|
-
{
|
|
2122
|
-
var description = 'Features available in ' + engine + '.';
|
|
2123
|
-
featureInfo.description = description;
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
);
|
|
2127
|
-
Feature = createFeatureClass(featureInfos);
|
|
2192
|
+
Feature = createFeatureClass(featureInfos, formatEngineDescription);
|
|
2128
2193
|
ELEMENTARY = Feature.ELEMENTARY;
|
|
2129
2194
|
featureInfos = null;
|
|
2130
2195
|
assignNoEnum$1(Feature.prototype, { restrict: restrict });
|
|
@@ -2255,13 +2320,13 @@
|
|
|
2255
2320
|
function evalExpr$1(expr) {
|
|
2256
2321
|
var value = tryEvalExpr(expr);
|
|
2257
2322
|
if (value === INVALID_EXPR)
|
|
2258
|
-
throw SyntaxError("Invalid expression "
|
|
2323
|
+
throw SyntaxError("Invalid expression ".concat(expr));
|
|
2259
2324
|
return value;
|
|
2260
2325
|
}
|
|
2261
2326
|
function tryEvalExpr(expr) {
|
|
2262
2327
|
var fn;
|
|
2263
2328
|
try {
|
|
2264
|
-
fn = Function("return("
|
|
2329
|
+
fn = Function("return(".concat(expr, ");"));
|
|
2265
2330
|
}
|
|
2266
2331
|
catch (_a) {
|
|
2267
2332
|
return INVALID_EXPR;
|
|
@@ -2310,9 +2375,9 @@
|
|
|
2310
2375
|
}
|
|
2311
2376
|
}
|
|
2312
2377
|
};
|
|
2313
|
-
var isCombined = function (replacement, value) { return !value !== tryEvalExpr("!"
|
|
2314
|
-
var isPrefixed = function (replacement, value) { return "0"
|
|
2315
|
-
var isWeak$1 = function (replacement, value) { return ""
|
|
2378
|
+
var isCombined = function (replacement, value) { return !value !== tryEvalExpr("!".concat(replacement)); };
|
|
2379
|
+
var isPrefixed = function (replacement, value) { return "0".concat(value) !== tryEvalExpr("0+".concat(replacement)); };
|
|
2380
|
+
var isWeak$1 = function (replacement, value) { return "".concat(value) !== tryEvalExpr("\"\"+".concat(replacement)); };
|
|
2316
2381
|
|
|
2317
2382
|
function createTypeSet() {
|
|
2318
2383
|
var types = [];
|
|
@@ -2348,7 +2413,7 @@
|
|
|
2348
2413
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2349
2414
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2350
2415
|
],
|
|
2351
|
-
replace: function (r1, r2, r3) { return r1
|
|
2416
|
+
replace: function (r1, r2, r3) { return "".concat(r1, "+(").concat(r2, "+[").concat(r3, "])"); },
|
|
2352
2417
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2353
2418
|
},
|
|
2354
2419
|
{
|
|
@@ -2357,7 +2422,7 @@
|
|
|
2357
2422
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2358
2423
|
createTypeSet(SolutionType.WEAK_PREFIXED_STRING),
|
|
2359
2424
|
],
|
|
2360
|
-
replace: function (r1, r2, r3) { return r1
|
|
2425
|
+
replace: function (r1, r2, r3) { return "".concat(r1, "+(").concat(r2, "+(").concat(r3, "))"); },
|
|
2361
2426
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2362
2427
|
},
|
|
2363
2428
|
{
|
|
@@ -2366,7 +2431,7 @@
|
|
|
2366
2431
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2367
2432
|
createTypeSet(SolutionType.OBJECT, SolutionType.STRING, SolutionType.COMBINED_STRING),
|
|
2368
2433
|
],
|
|
2369
|
-
replace: function (r1, r2, r3) { return r1
|
|
2434
|
+
replace: function (r1, r2, r3) { return "".concat(r1, "+(").concat(r2, "+").concat(r3, ")"); },
|
|
2370
2435
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2371
2436
|
},
|
|
2372
2437
|
{
|
|
@@ -2374,7 +2439,7 @@
|
|
|
2374
2439
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2375
2440
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2376
2441
|
],
|
|
2377
|
-
replace: function (r1, r2) { return "[]+"
|
|
2442
|
+
replace: function (r1, r2) { return "[]+".concat(r1, "+").concat(r2); },
|
|
2378
2443
|
solutionType: SolutionType.COMBINED_STRING,
|
|
2379
2444
|
},
|
|
2380
2445
|
{
|
|
@@ -2382,7 +2447,7 @@
|
|
|
2382
2447
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2383
2448
|
createTypeSet(SolutionType.ALGEBRAIC, SolutionType.WEAK_ALGEBRAIC),
|
|
2384
2449
|
],
|
|
2385
|
-
replace: function (r1, r2) { return r1
|
|
2450
|
+
replace: function (r1, r2) { return "".concat(r1, "+[").concat(r2, "]"); },
|
|
2386
2451
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2387
2452
|
},
|
|
2388
2453
|
{
|
|
@@ -2390,7 +2455,7 @@
|
|
|
2390
2455
|
createTypeSet(SolutionType.UNDEFINED),
|
|
2391
2456
|
createTypeSet(SolutionType.PREFIXED_STRING),
|
|
2392
2457
|
],
|
|
2393
|
-
replace: function (r1, r2) { return r1
|
|
2458
|
+
replace: function (r1, r2) { return "".concat(r1, "+(").concat(r2, ")"); },
|
|
2394
2459
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2395
2460
|
},
|
|
2396
2461
|
{
|
|
@@ -2404,7 +2469,7 @@
|
|
|
2404
2469
|
createTypeSet(SolutionType.ALGEBRAIC),
|
|
2405
2470
|
createTypeSet(SolutionType.UNDEFINED, SolutionType.ALGEBRAIC, SolutionType.PREFIXED_STRING),
|
|
2406
2471
|
],
|
|
2407
|
-
replace: function (r1, r2) { return "["
|
|
2472
|
+
replace: function (r1, r2) { return "[".concat(r1, "]+").concat(r2); },
|
|
2408
2473
|
solutionType: SolutionType.COMBINED_STRING,
|
|
2409
2474
|
},
|
|
2410
2475
|
{
|
|
@@ -2412,7 +2477,7 @@
|
|
|
2412
2477
|
createTypeSet(SolutionType.ALGEBRAIC),
|
|
2413
2478
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2414
2479
|
],
|
|
2415
|
-
replace: function (r1, r2) { return r1
|
|
2480
|
+
replace: function (r1, r2) { return "".concat(r1, "+[").concat(r2, "]"); },
|
|
2416
2481
|
solutionType: SolutionType.PREFIXED_STRING,
|
|
2417
2482
|
},
|
|
2418
2483
|
{
|
|
@@ -2426,7 +2491,7 @@
|
|
|
2426
2491
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2427
2492
|
createTypeSet(SolutionType.UNDEFINED, SolutionType.ALGEBRAIC, SolutionType.PREFIXED_STRING),
|
|
2428
2493
|
],
|
|
2429
|
-
replace: function (r1, r2) { return "["
|
|
2494
|
+
replace: function (r1, r2) { return "[".concat(r1, "]+").concat(r2); },
|
|
2430
2495
|
solutionType: SolutionType.COMBINED_STRING,
|
|
2431
2496
|
},
|
|
2432
2497
|
{
|
|
@@ -2434,7 +2499,7 @@
|
|
|
2434
2499
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2435
2500
|
createTypeSet(SolutionType.WEAK_ALGEBRAIC),
|
|
2436
2501
|
],
|
|
2437
|
-
replace: function (r1, r2) { return r1
|
|
2502
|
+
replace: function (r1, r2) { return "".concat(r1, "+[").concat(r2, "]"); },
|
|
2438
2503
|
solutionType: SolutionType.WEAK_PREFIXED_STRING,
|
|
2439
2504
|
},
|
|
2440
2505
|
{
|
|
@@ -2507,14 +2572,6 @@
|
|
|
2507
2572
|
_this._solutions = [];
|
|
2508
2573
|
return _this;
|
|
2509
2574
|
}
|
|
2510
|
-
DynamicSolution.prototype.append = function (solution) {
|
|
2511
|
-
this._replacement = undefined;
|
|
2512
|
-
this._solutions.push(solution);
|
|
2513
|
-
};
|
|
2514
|
-
DynamicSolution.prototype.prepend = function (solution) {
|
|
2515
|
-
this._replacement = undefined;
|
|
2516
|
-
this._solutions.unshift(solution);
|
|
2517
|
-
};
|
|
2518
2575
|
Object.defineProperty(DynamicSolution.prototype, "replacement", {
|
|
2519
2576
|
get: function () {
|
|
2520
2577
|
var _a;
|
|
@@ -2557,6 +2614,14 @@
|
|
|
2557
2614
|
enumerable: false,
|
|
2558
2615
|
configurable: true
|
|
2559
2616
|
});
|
|
2617
|
+
DynamicSolution.prototype.append = function (solution) {
|
|
2618
|
+
this._replacement = undefined;
|
|
2619
|
+
this._solutions.push(solution);
|
|
2620
|
+
};
|
|
2621
|
+
DynamicSolution.prototype.prepend = function (solution) {
|
|
2622
|
+
this._replacement = undefined;
|
|
2623
|
+
this._solutions.unshift(solution);
|
|
2624
|
+
};
|
|
2560
2625
|
return DynamicSolution;
|
|
2561
2626
|
}(AbstractSolution));
|
|
2562
2627
|
var LazySolution = /** @class */ (function (_super) {
|
|
@@ -2578,7 +2643,7 @@
|
|
|
2578
2643
|
attributes.enumerable = true;
|
|
2579
2644
|
Object.defineProperty(this, 'replacement', attributes);
|
|
2580
2645
|
};
|
|
2581
|
-
return LazySolution;
|
|
2646
|
+
return (LazySolution);
|
|
2582
2647
|
}(AbstractSolution));
|
|
2583
2648
|
var SimpleSolution = /** @class */ (function (_super) {
|
|
2584
2649
|
__extends(SimpleSolution, _super);
|
|
@@ -2613,7 +2678,7 @@
|
|
|
2613
2678
|
}
|
|
2614
2679
|
var getAppendableReplacement = function (_a) {
|
|
2615
2680
|
var replacement = _a.replacement, type = _a.type;
|
|
2616
|
-
return isWeak(type) ? "+("
|
|
2681
|
+
return isWeak(type) ? "+(".concat(replacement, ")") : "+".concat(replacement);
|
|
2617
2682
|
};
|
|
2618
2683
|
var getReplacement = function (_a) {
|
|
2619
2684
|
var replacement = _a.replacement;
|
|
@@ -4609,16 +4674,6 @@
|
|
|
4609
4674
|
}
|
|
4610
4675
|
)();
|
|
4611
4676
|
|
|
4612
|
-
var APPEND_LENGTH_OF_DIGIT_0 = 6;
|
|
4613
|
-
var APPEND_LENGTH_OF_DOT = 73;
|
|
4614
|
-
var APPEND_LENGTH_OF_FALSE = 4;
|
|
4615
|
-
var APPEND_LENGTH_OF_EMPTY = 3; // Append length of the empty array.
|
|
4616
|
-
var APPEND_LENGTH_OF_MINUS = 136;
|
|
4617
|
-
var APPEND_LENGTH_OF_PLUS_SIGN = 71;
|
|
4618
|
-
var APPEND_LENGTH_OF_SMALL_E = 26;
|
|
4619
|
-
|
|
4620
|
-
var APPEND_LENGTH_OF_DIGITS = [APPEND_LENGTH_OF_DIGIT_0, 8, 12, 17, 22, 27, 32, 37, 42, 47];
|
|
4621
|
-
|
|
4622
4677
|
// Recognized syntax elements include:
|
|
4623
4678
|
//
|
|
4624
4679
|
// • The boolean literals "true" and "false"
|
|
@@ -5209,29 +5264,15 @@
|
|
|
5209
5264
|
|
|
5210
5265
|
var expressParseCached$1 = expressParseCached;
|
|
5211
5266
|
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
return definitionCache[cacheKey];
|
|
5220
|
-
var definition;
|
|
5221
|
-
for (var entryIndex = entries.length; entryIndex--;)
|
|
5222
|
-
{
|
|
5223
|
-
var entry = entries[entryIndex];
|
|
5224
|
-
if (this.hasFeatures(entry.mask))
|
|
5225
|
-
{
|
|
5226
|
-
definition = entry.definition;
|
|
5227
|
-
break;
|
|
5228
|
-
}
|
|
5229
|
-
}
|
|
5230
|
-
definitionCache[cacheKey] = definition;
|
|
5231
|
-
return definition;
|
|
5232
|
-
}
|
|
5267
|
+
var APPEND_LENGTH_OF_DIGIT_0 = 6;
|
|
5268
|
+
var APPEND_LENGTH_OF_DOT = 73;
|
|
5269
|
+
var APPEND_LENGTH_OF_FALSE = 4;
|
|
5270
|
+
var APPEND_LENGTH_OF_EMPTY = 3; // Append length of the empty array.
|
|
5271
|
+
var APPEND_LENGTH_OF_MINUS = 136;
|
|
5272
|
+
var APPEND_LENGTH_OF_PLUS_SIGN = 71;
|
|
5273
|
+
var APPEND_LENGTH_OF_SMALL_E = 26;
|
|
5233
5274
|
|
|
5234
|
-
var
|
|
5275
|
+
var APPEND_LENGTH_OF_DIGITS = [APPEND_LENGTH_OF_DIGIT_0, 8, 12, 17, 22, 27, 32, 37, 42, 47];
|
|
5235
5276
|
|
|
5236
5277
|
var SCREW_NORMAL = 0;
|
|
5237
5278
|
var SCREW_AS_STRING = 1;
|
|
@@ -5391,6 +5432,129 @@
|
|
|
5391
5432
|
);
|
|
5392
5433
|
}
|
|
5393
5434
|
|
|
5435
|
+
function findDefinition(entries)
|
|
5436
|
+
{
|
|
5437
|
+
var cacheKey = entries.cacheKey;
|
|
5438
|
+
if (cacheKey === undefined)
|
|
5439
|
+
entries.cacheKey = cacheKey = ++lastCacheKey;
|
|
5440
|
+
var definitionCache = this._definitionCache;
|
|
5441
|
+
if (cacheKey in definitionCache)
|
|
5442
|
+
return definitionCache[cacheKey];
|
|
5443
|
+
var definition;
|
|
5444
|
+
for (var entryIndex = entries.length; entryIndex--;)
|
|
5445
|
+
{
|
|
5446
|
+
var entry = entries[entryIndex];
|
|
5447
|
+
if (this.hasFeatures(entry.mask))
|
|
5448
|
+
{
|
|
5449
|
+
definition = entry.definition;
|
|
5450
|
+
break;
|
|
5451
|
+
}
|
|
5452
|
+
}
|
|
5453
|
+
definitionCache[cacheKey] = definition;
|
|
5454
|
+
return definition;
|
|
5455
|
+
}
|
|
5456
|
+
|
|
5457
|
+
var lastCacheKey = 0;
|
|
5458
|
+
|
|
5459
|
+
function evalNumber(preMantissa, lastDigit, exp)
|
|
5460
|
+
{
|
|
5461
|
+
var value = +(preMantissa + lastDigit + 'e' + exp);
|
|
5462
|
+
return value;
|
|
5463
|
+
}
|
|
5464
|
+
|
|
5465
|
+
function formatPositiveNumber(number)
|
|
5466
|
+
{
|
|
5467
|
+
function getMantissa()
|
|
5468
|
+
{
|
|
5469
|
+
var lastDigitIndex = usefulDigits - 1;
|
|
5470
|
+
var preMantissa = digits.slice(0, lastDigitIndex);
|
|
5471
|
+
var lastDigit = +digits[lastDigitIndex];
|
|
5472
|
+
var value = evalNumber(preMantissa, lastDigit, exp);
|
|
5473
|
+
for (;;)
|
|
5474
|
+
{
|
|
5475
|
+
var decreasedLastDigit = lastDigit - 1;
|
|
5476
|
+
var newValue = evalNumber(preMantissa, decreasedLastDigit, exp);
|
|
5477
|
+
if (newValue !== value)
|
|
5478
|
+
break;
|
|
5479
|
+
lastDigit = decreasedLastDigit;
|
|
5480
|
+
}
|
|
5481
|
+
var mantissa = preMantissa + lastDigit;
|
|
5482
|
+
return mantissa;
|
|
5483
|
+
}
|
|
5484
|
+
|
|
5485
|
+
var str;
|
|
5486
|
+
var match = /^(\d+)(?:\.(\d+))?(?:e(.+))?$/.exec(number);
|
|
5487
|
+
var digitsAfterDot = match[2] || '';
|
|
5488
|
+
var digits = (match[1] + digitsAfterDot).replace(/^0+/, '');
|
|
5489
|
+
var usefulDigits = digits.search(/0*$/);
|
|
5490
|
+
var exp = (match[3] | 0) - digitsAfterDot.length + digits.length - usefulDigits;
|
|
5491
|
+
var mantissa = getMantissa();
|
|
5492
|
+
if (exp >= 0)
|
|
5493
|
+
{
|
|
5494
|
+
if (exp < 10)
|
|
5495
|
+
str = mantissa + extraZeros(exp);
|
|
5496
|
+
else if (exp % 100 === 99 && (exp > 99 || mantissa[1]))
|
|
5497
|
+
str = mantissa.replace(/.$/, '.$&e') + (exp + 1);
|
|
5498
|
+
else
|
|
5499
|
+
str = mantissa + 'e' + exp;
|
|
5500
|
+
}
|
|
5501
|
+
else
|
|
5502
|
+
{
|
|
5503
|
+
if (exp >= -mantissa.length)
|
|
5504
|
+
str = mantissa.slice(0, exp) + '.' + mantissa.slice(exp);
|
|
5505
|
+
else
|
|
5506
|
+
{
|
|
5507
|
+
var extraZeroCount = -mantissa.length - exp;
|
|
5508
|
+
var extraLength = APPEND_LENGTH_OF_DOT + APPEND_LENGTH_OF_DIGIT_0 * extraZeroCount;
|
|
5509
|
+
str =
|
|
5510
|
+
replaceNegativeExponential(mantissa, exp, extraLength) ||
|
|
5511
|
+
'.' + extraZeros(extraZeroCount) + mantissa;
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5514
|
+
return str;
|
|
5515
|
+
}
|
|
5516
|
+
|
|
5517
|
+
function getMultiDigitLength(str)
|
|
5518
|
+
{
|
|
5519
|
+
var appendLength = 0;
|
|
5520
|
+
_Array_prototype_forEach_call
|
|
5521
|
+
(
|
|
5522
|
+
str,
|
|
5523
|
+
function (digit)
|
|
5524
|
+
{
|
|
5525
|
+
var digitAppendLength = APPEND_LENGTH_OF_DIGITS[digit];
|
|
5526
|
+
appendLength += digitAppendLength;
|
|
5527
|
+
}
|
|
5528
|
+
);
|
|
5529
|
+
return appendLength;
|
|
5530
|
+
}
|
|
5531
|
+
|
|
5532
|
+
function replaceNegativeExponential(mantissa, exp, rivalExtraLength)
|
|
5533
|
+
{
|
|
5534
|
+
var extraZeroCount;
|
|
5535
|
+
if (exp % 100 > 7 - 100)
|
|
5536
|
+
{
|
|
5537
|
+
if (exp % 10 > -7)
|
|
5538
|
+
extraZeroCount = 0;
|
|
5539
|
+
else
|
|
5540
|
+
extraZeroCount = 10 + exp % 10;
|
|
5541
|
+
}
|
|
5542
|
+
else
|
|
5543
|
+
extraZeroCount = 100 + exp % 100;
|
|
5544
|
+
mantissa += extraZeros(extraZeroCount);
|
|
5545
|
+
exp -= extraZeroCount;
|
|
5546
|
+
var extraLength =
|
|
5547
|
+
APPEND_LENGTH_OF_DIGIT_0 * extraZeroCount +
|
|
5548
|
+
APPEND_LENGTH_OF_SMALL_E +
|
|
5549
|
+
APPEND_LENGTH_OF_MINUS +
|
|
5550
|
+
getMultiDigitLength(_String$1(-exp));
|
|
5551
|
+
if (extraLength < rivalExtraLength)
|
|
5552
|
+
{
|
|
5553
|
+
var str = mantissa + 'e' + exp;
|
|
5554
|
+
return str;
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
|
|
5394
5558
|
function findBase64AlphabetDefinition(encoder, element)
|
|
5395
5559
|
{
|
|
5396
5560
|
var definition;
|
|
@@ -5608,12 +5772,6 @@
|
|
|
5608
5772
|
return solution;
|
|
5609
5773
|
}
|
|
5610
5774
|
|
|
5611
|
-
function evalNumber(preMantissa, lastDigit, exp)
|
|
5612
|
-
{
|
|
5613
|
-
var value = +(preMantissa + lastDigit + 'e' + exp);
|
|
5614
|
-
return value;
|
|
5615
|
-
}
|
|
5616
|
-
|
|
5617
5775
|
function findOptimalSolution(encoder, source, entries, defaultSolutionType)
|
|
5618
5776
|
{
|
|
5619
5777
|
var optimalSolution;
|
|
@@ -5637,73 +5795,6 @@
|
|
|
5637
5795
|
return optimalSolution;
|
|
5638
5796
|
}
|
|
5639
5797
|
|
|
5640
|
-
function formatPositiveNumber(number)
|
|
5641
|
-
{
|
|
5642
|
-
function getMantissa()
|
|
5643
|
-
{
|
|
5644
|
-
var lastDigitIndex = usefulDigits - 1;
|
|
5645
|
-
var preMantissa = digits.slice(0, lastDigitIndex);
|
|
5646
|
-
var lastDigit = +digits[lastDigitIndex];
|
|
5647
|
-
var value = evalNumber(preMantissa, lastDigit, exp);
|
|
5648
|
-
for (;;)
|
|
5649
|
-
{
|
|
5650
|
-
var decreasedLastDigit = lastDigit - 1;
|
|
5651
|
-
var newValue = evalNumber(preMantissa, decreasedLastDigit, exp);
|
|
5652
|
-
if (newValue !== value)
|
|
5653
|
-
break;
|
|
5654
|
-
lastDigit = decreasedLastDigit;
|
|
5655
|
-
}
|
|
5656
|
-
var mantissa = preMantissa + lastDigit;
|
|
5657
|
-
return mantissa;
|
|
5658
|
-
}
|
|
5659
|
-
|
|
5660
|
-
var str;
|
|
5661
|
-
var match = /^(\d+)(?:\.(\d+))?(?:e(.+))?$/.exec(number);
|
|
5662
|
-
var digitsAfterDot = match[2] || '';
|
|
5663
|
-
var digits = (match[1] + digitsAfterDot).replace(/^0+/, '');
|
|
5664
|
-
var usefulDigits = digits.search(/0*$/);
|
|
5665
|
-
var exp = (match[3] | 0) - digitsAfterDot.length + digits.length - usefulDigits;
|
|
5666
|
-
var mantissa = getMantissa();
|
|
5667
|
-
if (exp >= 0)
|
|
5668
|
-
{
|
|
5669
|
-
if (exp < 10)
|
|
5670
|
-
str = mantissa + extraZeros(exp);
|
|
5671
|
-
else if (exp % 100 === 99 && (exp > 99 || mantissa[1]))
|
|
5672
|
-
str = mantissa.replace(/.$/, '.$&e') + (exp + 1);
|
|
5673
|
-
else
|
|
5674
|
-
str = mantissa + 'e' + exp;
|
|
5675
|
-
}
|
|
5676
|
-
else
|
|
5677
|
-
{
|
|
5678
|
-
if (exp >= -mantissa.length)
|
|
5679
|
-
str = mantissa.slice(0, exp) + '.' + mantissa.slice(exp);
|
|
5680
|
-
else
|
|
5681
|
-
{
|
|
5682
|
-
var extraZeroCount = -mantissa.length - exp;
|
|
5683
|
-
var extraLength = APPEND_LENGTH_OF_DOT + APPEND_LENGTH_OF_DIGIT_0 * extraZeroCount;
|
|
5684
|
-
str =
|
|
5685
|
-
replaceNegativeExponential(mantissa, exp, extraLength) ||
|
|
5686
|
-
'.' + extraZeros(extraZeroCount) + mantissa;
|
|
5687
|
-
}
|
|
5688
|
-
}
|
|
5689
|
-
return str;
|
|
5690
|
-
}
|
|
5691
|
-
|
|
5692
|
-
function getMultiDigitLength(str)
|
|
5693
|
-
{
|
|
5694
|
-
var appendLength = 0;
|
|
5695
|
-
_Array_prototype_forEach_call
|
|
5696
|
-
(
|
|
5697
|
-
str,
|
|
5698
|
-
function (digit)
|
|
5699
|
-
{
|
|
5700
|
-
var digitAppendLength = APPEND_LENGTH_OF_DIGITS[digit];
|
|
5701
|
-
appendLength += digitAppendLength;
|
|
5702
|
-
}
|
|
5703
|
-
);
|
|
5704
|
-
return appendLength;
|
|
5705
|
-
}
|
|
5706
|
-
|
|
5707
5798
|
function getReplacers(optimize)
|
|
5708
5799
|
{
|
|
5709
5800
|
var replaceString =
|
|
@@ -5758,39 +5849,6 @@
|
|
|
5758
5849
|
return replacement;
|
|
5759
5850
|
}
|
|
5760
5851
|
|
|
5761
|
-
function replaceMultiDigitNumber(number)
|
|
5762
|
-
{
|
|
5763
|
-
var str = formatPositiveNumber(number);
|
|
5764
|
-
var replacement = replaceStaticString(str);
|
|
5765
|
-
return replacement;
|
|
5766
|
-
}
|
|
5767
|
-
|
|
5768
|
-
function replaceNegativeExponential(mantissa, exp, rivalExtraLength)
|
|
5769
|
-
{
|
|
5770
|
-
var extraZeroCount;
|
|
5771
|
-
if (exp % 100 > 7 - 100)
|
|
5772
|
-
{
|
|
5773
|
-
if (exp % 10 > -7)
|
|
5774
|
-
extraZeroCount = 0;
|
|
5775
|
-
else
|
|
5776
|
-
extraZeroCount = 10 + exp % 10;
|
|
5777
|
-
}
|
|
5778
|
-
else
|
|
5779
|
-
extraZeroCount = 100 + exp % 100;
|
|
5780
|
-
mantissa += extraZeros(extraZeroCount);
|
|
5781
|
-
exp -= extraZeroCount;
|
|
5782
|
-
var extraLength =
|
|
5783
|
-
APPEND_LENGTH_OF_DIGIT_0 * extraZeroCount +
|
|
5784
|
-
APPEND_LENGTH_OF_SMALL_E +
|
|
5785
|
-
APPEND_LENGTH_OF_MINUS +
|
|
5786
|
-
getMultiDigitLength(_String$1(-exp));
|
|
5787
|
-
if (extraLength < rivalExtraLength)
|
|
5788
|
-
{
|
|
5789
|
-
var str = mantissa + 'e' + exp;
|
|
5790
|
-
return str;
|
|
5791
|
-
}
|
|
5792
|
-
}
|
|
5793
|
-
|
|
5794
5852
|
function replacePrimaryExpr(encoder, unit, bondStrength, unitIndices, maxLength, replacers)
|
|
5795
5853
|
{
|
|
5796
5854
|
var MIN_APPEND_LENGTH = 3;
|
|
@@ -8170,6 +8228,29 @@
|
|
|
8170
8228
|
var MIN_SOLUTION_SPAN = 2;
|
|
8171
8229
|
var RADIX_REPLACEMENTS = [];
|
|
8172
8230
|
|
|
8231
|
+
// DECIMAL_MIN_LENGTHS is indexed by decimalDigitMaxCount (the number of digits used to write
|
|
8232
|
+
// MAX_SAFE_INTEGER in base radix).
|
|
8233
|
+
// decimalDigitMaxCount may only range from 11 (for radix 36) to 15 (for radix 12).
|
|
8234
|
+
var DECIMAL_MIN_LENGTHS =
|
|
8235
|
+
[
|
|
8236
|
+
,
|
|
8237
|
+
,
|
|
8238
|
+
,
|
|
8239
|
+
,
|
|
8240
|
+
,
|
|
8241
|
+
,
|
|
8242
|
+
,
|
|
8243
|
+
,
|
|
8244
|
+
,
|
|
8245
|
+
,
|
|
8246
|
+
,
|
|
8247
|
+
48, // 1e10
|
|
8248
|
+
50, // 1e11
|
|
8249
|
+
54, // 1e12
|
|
8250
|
+
,
|
|
8251
|
+
64, // 1e14
|
|
8252
|
+
];
|
|
8253
|
+
|
|
8173
8254
|
function createOptimizer$1(toStringReplacement)
|
|
8174
8255
|
{
|
|
8175
8256
|
function appendLengthOf(solution)
|
|
@@ -8219,7 +8300,8 @@
|
|
|
8219
8300
|
var decimal = _parseInt(chars, radix);
|
|
8220
8301
|
if (decimal > MAX_SAFE_INTEGER)
|
|
8221
8302
|
return clusterAppendLength == null;
|
|
8222
|
-
var
|
|
8303
|
+
var decimalStr = formatPositiveNumber(decimal);
|
|
8304
|
+
var decimalReplacement = replaceStaticString(decimalStr);
|
|
8223
8305
|
// Adding 3 for leading "+(" and trailing ")".
|
|
8224
8306
|
var decimalLength = decimalReplacement.length + 3;
|
|
8225
8307
|
var radixReplacement = RADIX_REPLACEMENTS[radix];
|
|
@@ -8336,33 +8418,10 @@
|
|
|
8336
8418
|
var initialize =
|
|
8337
8419
|
function ()
|
|
8338
8420
|
{
|
|
8339
|
-
// DECIMAL_MIN_LENGTHS is indexed by decimalDigitMaxCount (the number of digits used to write
|
|
8340
|
-
// MAX_SAFE_INTEGER in base radix).
|
|
8341
|
-
// decimalDigitMaxCount may only range from 11 (for radix 36) to 15 (for radix 12).
|
|
8342
|
-
var DECIMAL_MIN_LENGTHS =
|
|
8343
|
-
[
|
|
8344
|
-
,
|
|
8345
|
-
,
|
|
8346
|
-
,
|
|
8347
|
-
,
|
|
8348
|
-
,
|
|
8349
|
-
,
|
|
8350
|
-
,
|
|
8351
|
-
,
|
|
8352
|
-
,
|
|
8353
|
-
,
|
|
8354
|
-
,
|
|
8355
|
-
48, // 1e10
|
|
8356
|
-
50, // 1e11
|
|
8357
|
-
54, // 1e12
|
|
8358
|
-
,
|
|
8359
|
-
64, // 1e14
|
|
8360
|
-
];
|
|
8361
|
-
|
|
8362
8421
|
var minLength = Infinity;
|
|
8363
8422
|
for (var radix = MAX_RADIX; radix >= 12; --radix)
|
|
8364
8423
|
{
|
|
8365
|
-
var replacement =
|
|
8424
|
+
var replacement = replaceStaticString(_String$1(radix));
|
|
8366
8425
|
var length = replacement.length;
|
|
8367
8426
|
if (length < minLength)
|
|
8368
8427
|
minLength = length;
|
|
@@ -8817,4 +8876,4 @@
|
|
|
8817
8876
|
)();
|
|
8818
8877
|
}
|
|
8819
8878
|
|
|
8820
|
-
}()
|
|
8879
|
+
})();
|