genesys-spark-chart-components 4.264.2 → 4.265.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/dist/cjs/{color-palette-PGbg4uD5.js → color-palette-CTtHBtMr.js} +1 -1
- package/dist/cjs/genesys-chart-webcomponents.cjs.js +2 -2
- package/dist/cjs/gux-chart-column-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-chart-donut-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-chart-line-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-chart-pie-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-chart-scatter-plot-beta.cjs.entry.js +2 -2
- package/dist/cjs/gux-visualization-beta.cjs.entry.js +935 -2542
- package/dist/cjs/{index-BU_h9-dW.js → index-Bm_ReyJN.js} +19 -15
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/{color-palette-DS-oKQVC.js → color-palette-BmX9NvSy.js} +1 -1
- package/dist/esm/genesys-chart-webcomponents.js +3 -3
- package/dist/esm/gux-chart-column-beta.entry.js +2 -2
- package/dist/esm/gux-chart-donut-beta.entry.js +2 -2
- package/dist/esm/gux-chart-line-beta.entry.js +2 -2
- package/dist/esm/gux-chart-pie-beta.entry.js +2 -2
- package/dist/esm/gux-chart-scatter-plot-beta.entry.js +2 -2
- package/dist/esm/gux-visualization-beta.entry.js +930 -2537
- package/dist/esm/{index-B5vpMGHk.js → index-C2FEcqL3.js} +19 -15
- package/dist/esm/loader.js +2 -2
- package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.esm.js +1 -1
- package/dist/genesys-chart-webcomponents/{p-a66a5664.entry.js → p-1239752b.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-7e16199f.entry.js → p-1fd6f23b.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-dcae8ac6.entry.js → p-59b1d8b6.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-6fdead5a.entry.js → p-784ea768.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/p-93dcd833.entry.js +11 -0
- package/dist/genesys-chart-webcomponents/{p-DS-oKQVC.js → p-BmX9NvSy.js} +1 -1
- package/dist/genesys-chart-webcomponents/p-C2FEcqL3.js +3 -0
- package/dist/genesys-chart-webcomponents/{p-496971d8.entry.js → p-c3b0b09b.entry.js} +1 -1
- package/dist/loader/index.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +62 -55
- package/package.json +16 -16
- package/dist/genesys-chart-webcomponents/p-56119d47.entry.js +0 -11
- package/dist/genesys-chart-webcomponents/p-B5vpMGHk.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h as h$1, g as getElement } from './index-
|
|
2
|
-
import { a as DEFAULT_DOMAIN_COLOR, D as DEFAULT_LABEL_COLOR, t as trackComponent } from './color-palette-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h as h$1, g as getElement } from './index-C2FEcqL3.js';
|
|
2
|
+
import { a as DEFAULT_DOMAIN_COLOR, D as DEFAULT_LABEL_COLOR, t as trackComponent } from './color-palette-BmX9NvSy.js';
|
|
3
3
|
|
|
4
4
|
// Note: This regex matches even invalid JSON strings, but since we’re
|
|
5
5
|
// working on the output of `JSON.stringify` we know that only valid strings
|
|
@@ -346,7 +346,7 @@ function mergeNamed(a, b) {
|
|
|
346
346
|
return out;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
function peek$
|
|
349
|
+
function peek$2(array) {
|
|
350
350
|
return array[array.length - 1];
|
|
351
351
|
}
|
|
352
352
|
|
|
@@ -372,7 +372,7 @@ const identity$6 = x => x;
|
|
|
372
372
|
function pan(domain, delta, lift, ground) {
|
|
373
373
|
if (!isNonEmpty(domain))
|
|
374
374
|
error$1('Domain array must not be empty');
|
|
375
|
-
const d0 = lift(domain[0]), d1 = lift(peek$
|
|
375
|
+
const d0 = lift(domain[0]), d1 = lift(peek$2(domain)), dd = (d1 - d0) * delta;
|
|
376
376
|
return [
|
|
377
377
|
ground(d0 - dd),
|
|
378
378
|
ground(d1 - dd)
|
|
@@ -394,7 +394,7 @@ function panSymlog(domain, delta, constant) {
|
|
|
394
394
|
function zoom$2(domain, anchor, scale, lift, ground) {
|
|
395
395
|
if (!isNonEmpty(domain))
|
|
396
396
|
error$1('Domain array must not be empty');
|
|
397
|
-
const d0 = lift(domain[0]), d1 = lift(peek$
|
|
397
|
+
const d0 = lift(domain[0]), d1 = lift(peek$2(domain)), da = anchor != null ? lift(anchor) : (d0 + d1) / 2;
|
|
398
398
|
return [
|
|
399
399
|
ground(da + (d0 - da) * scale),
|
|
400
400
|
ground(da + (d1 - da) * scale)
|
|
@@ -719,7 +719,7 @@ function flush (range, value, threshold, left, right, center) {
|
|
|
719
719
|
if (!threshold && threshold !== 0)
|
|
720
720
|
return center;
|
|
721
721
|
const t = +threshold;
|
|
722
|
-
let a = range[0], b = peek$
|
|
722
|
+
let a = range[0], b = peek$2(range), l;
|
|
723
723
|
if (b === undefined)
|
|
724
724
|
return center;
|
|
725
725
|
// swap endpoints if range is reversed
|
|
@@ -831,7 +831,7 @@ function key(fields, flat, opt) {
|
|
|
831
831
|
}
|
|
832
832
|
|
|
833
833
|
function lerp (array, frac) {
|
|
834
|
-
const lo = array[0], hi = peek$
|
|
834
|
+
const lo = array[0], hi = peek$2(array), f = +frac;
|
|
835
835
|
if (hi === undefined)
|
|
836
836
|
return lo;
|
|
837
837
|
return !f ? lo : f === 1 ? hi : lo + f * (hi - lo);
|
|
@@ -928,7 +928,7 @@ function pad$2(str, length, padchar, align) {
|
|
|
928
928
|
* the last and first values.
|
|
929
929
|
*/
|
|
930
930
|
function span (array) {
|
|
931
|
-
return array && (peek$
|
|
931
|
+
return array && (peek$2(array) - array[0]) || 0;
|
|
932
932
|
}
|
|
933
933
|
|
|
934
934
|
/**
|
|
@@ -2738,7 +2738,7 @@ const REFERENCE_YEAR = 2012;
|
|
|
2738
2738
|
const ISOWEEK_REFERENCE_YEAR = 2015;
|
|
2739
2739
|
function floor(units, step, get, inv, newDate) {
|
|
2740
2740
|
const s = step || 1,
|
|
2741
|
-
b = peek$
|
|
2741
|
+
b = peek$2(units),
|
|
2742
2742
|
_ = (unit, p, key) => {
|
|
2743
2743
|
key = key || unit;
|
|
2744
2744
|
return getUnit(get[key], inv[key], unit === b && s, p);
|
|
@@ -8773,7 +8773,7 @@ inherits(Density, Transform, {
|
|
|
8773
8773
|
transform(_, pulse) {
|
|
8774
8774
|
const out = pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS);
|
|
8775
8775
|
if (!this.value || pulse.changed() || _.modified()) {
|
|
8776
|
-
const dist = parse$4(_.distribution, source$
|
|
8776
|
+
const dist = parse$4(_.distribution, source$2(pulse)),
|
|
8777
8777
|
minsteps = _.steps || _.minsteps || 25,
|
|
8778
8778
|
maxsteps = _.steps || _.maxsteps || 200;
|
|
8779
8779
|
let method = _.method || 'pdf';
|
|
@@ -8798,7 +8798,7 @@ inherits(Density, Transform, {
|
|
|
8798
8798
|
return out;
|
|
8799
8799
|
}
|
|
8800
8800
|
});
|
|
8801
|
-
function source$
|
|
8801
|
+
function source$2(pulse) {
|
|
8802
8802
|
return () => pulse.materialize(pulse.SOURCE).source;
|
|
8803
8803
|
}
|
|
8804
8804
|
|
|
@@ -10710,7 +10710,7 @@ inherits(TimeUnit, Transform, {
|
|
|
10710
10710
|
const tunits = timeUnits(units),
|
|
10711
10711
|
prev = this.value || {},
|
|
10712
10712
|
floor = (utc ? utcFloor : timeFloor)(tunits, step);
|
|
10713
|
-
floor.unit = peek$
|
|
10713
|
+
floor.unit = peek$2(tunits);
|
|
10714
10714
|
floor.units = tunits;
|
|
10715
10715
|
floor.step = step;
|
|
10716
10716
|
floor.start = prev.start;
|
|
@@ -15216,7 +15216,7 @@ function scaleBinOrdinal() {
|
|
|
15216
15216
|
}
|
|
15217
15217
|
};
|
|
15218
15218
|
scale.tickFormat = function (count, specifier) {
|
|
15219
|
-
return tickFormat$1(domain[0], peek$
|
|
15219
|
+
return tickFormat$1(domain[0], peek$2(domain), count == null ? 10 : count, specifier);
|
|
15220
15220
|
};
|
|
15221
15221
|
scale.copy = function () {
|
|
15222
15222
|
return scaleBinOrdinal().domain(scale.domain()).range(scale.range());
|
|
@@ -15349,7 +15349,7 @@ function isQuantile$1(key) {
|
|
|
15349
15349
|
const scaleProps = ['clamp', 'base', 'constant', 'exponent'];
|
|
15350
15350
|
function interpolateRange$1(interpolator, range) {
|
|
15351
15351
|
const start = range[0],
|
|
15352
|
-
span = peek$
|
|
15352
|
+
span = peek$2(range) - start;
|
|
15353
15353
|
return function (i) {
|
|
15354
15354
|
return interpolator(start + i * span);
|
|
15355
15355
|
};
|
|
@@ -15505,8 +15505,8 @@ function tickCount(scale, count, minStep) {
|
|
|
15505
15505
|
}
|
|
15506
15506
|
if (minStep != null) {
|
|
15507
15507
|
const domain = scale.domain(),
|
|
15508
|
-
lo = Math.min(domain[0], peek$
|
|
15509
|
-
hi = Math.max(domain[0], peek$
|
|
15508
|
+
lo = Math.min(domain[0], peek$2(domain)),
|
|
15509
|
+
hi = Math.max(domain[0], peek$2(domain));
|
|
15510
15510
|
count = Math.min(count, Math.floor((hi - lo) / minStep || 1) + 1);
|
|
15511
15511
|
if (!scale.bins && !isLogarithmic(scale.type) && !isTemporal(scale.type) && lo < hi) {
|
|
15512
15512
|
// d3 tick steps grow monotonically as the count shrinks
|
|
@@ -15536,7 +15536,7 @@ function tickCount(scale, count, minStep) {
|
|
|
15536
15536
|
function validTicks(scale, ticks, count) {
|
|
15537
15537
|
let range = scale.range(),
|
|
15538
15538
|
lo = range[0],
|
|
15539
|
-
hi = peek$
|
|
15539
|
+
hi = peek$2(range),
|
|
15540
15540
|
cmp = ascending;
|
|
15541
15541
|
if (lo > hi) {
|
|
15542
15542
|
range = hi;
|
|
@@ -15551,7 +15551,7 @@ function validTicks(scale, ticks, count) {
|
|
|
15551
15551
|
// additionally sort ticks in range order (#2579)
|
|
15552
15552
|
ticks = ticks.map(v => [v, scale(v)]).filter(_ => lo <= _[1] && _[1] <= hi).sort(cmp).map(_ => _[0]);
|
|
15553
15553
|
if (count > 0 && ticks.length > 1) {
|
|
15554
|
-
const endpoints = [ticks[0], peek$
|
|
15554
|
+
const endpoints = [ticks[0], peek$2(ticks)];
|
|
15555
15555
|
while (ticks.length > count && ticks.length >= 3) {
|
|
15556
15556
|
ticks = ticks.filter((_, i) => !(i % 2));
|
|
15557
15557
|
}
|
|
@@ -15660,7 +15660,7 @@ function thresholdValues(thresholds) {
|
|
|
15660
15660
|
}
|
|
15661
15661
|
function binValues(bins) {
|
|
15662
15662
|
const values = bins.slice(0, -1);
|
|
15663
|
-
values.max = peek$
|
|
15663
|
+
values.max = peek$2(bins);
|
|
15664
15664
|
return values;
|
|
15665
15665
|
}
|
|
15666
15666
|
const isDiscreteRange = scale => symbols$2[scale.type] || scale.bins;
|
|
@@ -15682,7 +15682,7 @@ function labelFraction(scale) {
|
|
|
15682
15682
|
const domain = scale.domain(),
|
|
15683
15683
|
count = domain.length - 1;
|
|
15684
15684
|
let lo = +domain[0],
|
|
15685
|
-
hi = +peek$
|
|
15685
|
+
hi = +peek$2(domain),
|
|
15686
15686
|
span = hi - lo;
|
|
15687
15687
|
if (scale.type === Threshold) {
|
|
15688
15688
|
const adjust = count ? span / count : 0.1;
|
|
@@ -15725,7 +15725,7 @@ function domainCaption(locale, scale, opt) {
|
|
|
15725
15725
|
// if scale domain is continuous, describe value range
|
|
15726
15726
|
else {
|
|
15727
15727
|
const d = scale.domain();
|
|
15728
|
-
return `values from ${fmt(d[0])} to ${fmt(peek$
|
|
15728
|
+
return `values from ${fmt(d[0])} to ${fmt(peek$2(d))}`;
|
|
15729
15729
|
}
|
|
15730
15730
|
}
|
|
15731
15731
|
|
|
@@ -19383,14 +19383,14 @@ function legendCaption(item) {
|
|
|
19383
19383
|
}
|
|
19384
19384
|
function extractTitle(item) {
|
|
19385
19385
|
try {
|
|
19386
|
-
return array$5(peek$
|
|
19386
|
+
return array$5(peek$2(item.items).items[0].text).join(' ');
|
|
19387
19387
|
} catch (err) {
|
|
19388
19388
|
return null;
|
|
19389
19389
|
}
|
|
19390
19390
|
}
|
|
19391
19391
|
function channelCaption(props) {
|
|
19392
19392
|
props = props.map(p => p + (p === 'fill' || p === 'stroke' ? ' color' : ''));
|
|
19393
|
-
return props.length < 2 ? props[0] : props.slice(0, -1).join(', ') + ' and ' + peek$
|
|
19393
|
+
return props.length < 2 ? props[0] : props.slice(0, -1).join(', ') + ' and ' + peek$2(props);
|
|
19394
19394
|
}
|
|
19395
19395
|
function capitalize(s) {
|
|
19396
19396
|
return s.length ? s[0].toUpperCase() + s.slice(1) : s;
|
|
@@ -20837,10 +20837,10 @@ const COUNTER_NAME = ':vega_identifier:';
|
|
|
20837
20837
|
* @param {object} params - The parameters for this operator.
|
|
20838
20838
|
* @param {string} params.as - The field name for the generated identifier.
|
|
20839
20839
|
*/
|
|
20840
|
-
function Identifier$
|
|
20840
|
+
function Identifier$2(params) {
|
|
20841
20841
|
Transform.call(this, 0, params);
|
|
20842
20842
|
}
|
|
20843
|
-
Identifier$
|
|
20843
|
+
Identifier$2.Definition = {
|
|
20844
20844
|
'type': 'Identifier',
|
|
20845
20845
|
'metadata': {
|
|
20846
20846
|
'modifies': true
|
|
@@ -20851,7 +20851,7 @@ Identifier$3.Definition = {
|
|
|
20851
20851
|
'required': true
|
|
20852
20852
|
}]
|
|
20853
20853
|
};
|
|
20854
|
-
inherits(Identifier$
|
|
20854
|
+
inherits(Identifier$2, Transform, {
|
|
20855
20855
|
transform(_, pulse) {
|
|
20856
20856
|
const counter = getCounter(pulse.dataflow),
|
|
20857
20857
|
as = _.as;
|
|
@@ -21012,9 +21012,9 @@ inherits(Overlap$1, Transform, {
|
|
|
21012
21012
|
do {
|
|
21013
21013
|
items = reduce(items, sep);
|
|
21014
21014
|
} while (items.length >= 3 && hasOverlap(items, sep));
|
|
21015
|
-
if (items.length < 3 && !peek$
|
|
21016
|
-
if (items.length > 1) peek$
|
|
21017
|
-
peek$
|
|
21015
|
+
if (items.length < 3 && !peek$2(source).opacity) {
|
|
21016
|
+
if (items.length > 1) peek$2(items).opacity = 0;
|
|
21017
|
+
peek$2(source).opacity = 1;
|
|
21018
21018
|
}
|
|
21019
21019
|
}
|
|
21020
21020
|
if (_.boundScale && _.boundTolerance >= 0) {
|
|
@@ -22035,7 +22035,7 @@ function viewSizeLayout(view, group, viewBounds, _) {
|
|
|
22035
22035
|
var vtx = /*#__PURE__*/Object.freeze({
|
|
22036
22036
|
__proto__: null,
|
|
22037
22037
|
bound: Bound$1,
|
|
22038
|
-
identifier: Identifier$
|
|
22038
|
+
identifier: Identifier$2,
|
|
22039
22039
|
mark: Mark$2,
|
|
22040
22040
|
overlap: Overlap$1,
|
|
22041
22041
|
render: Render$1,
|
|
@@ -22338,12 +22338,12 @@ inherits(LegendEntries$1, Transform, {
|
|
|
22338
22338
|
}));
|
|
22339
22339
|
}
|
|
22340
22340
|
} else if (type === GradientLegend) {
|
|
22341
|
-
domain = scale.domain(), fraction = scaleFraction(scale, domain[0], peek$
|
|
22341
|
+
domain = scale.domain(), fraction = scaleFraction(scale, domain[0], peek$2(domain));
|
|
22342
22342
|
|
|
22343
22343
|
// if automatic label generation produces 2 or fewer values,
|
|
22344
22344
|
// use the domain end points instead (fixes vega/vega#1364)
|
|
22345
|
-
if (values.length < 3 && !_.values && domain[0] !== peek$
|
|
22346
|
-
values = [domain[0], peek$
|
|
22345
|
+
if (values.length < 3 && !_.values && domain[0] !== peek$2(domain)) {
|
|
22346
|
+
values = [domain[0], peek$2(domain)];
|
|
22347
22347
|
}
|
|
22348
22348
|
items = values.map((value, index) => ingest$1({
|
|
22349
22349
|
index: index,
|
|
@@ -22654,7 +22654,7 @@ function configureDomain(scale, _, df) {
|
|
|
22654
22654
|
}
|
|
22655
22655
|
|
|
22656
22656
|
// adjust continuous domain for minimum pixel padding
|
|
22657
|
-
if (includePad(type) && _.padding && domain[0] !== peek$
|
|
22657
|
+
if (includePad(type) && _.padding && domain[0] !== peek$2(domain)) {
|
|
22658
22658
|
domain = padDomain(type, domain, _.range, _.padding, _.exponent, _.constant);
|
|
22659
22659
|
}
|
|
22660
22660
|
|
|
@@ -22684,7 +22684,7 @@ function rawDomain(scale, raw, df) {
|
|
|
22684
22684
|
}
|
|
22685
22685
|
}
|
|
22686
22686
|
function padDomain(type, domain, range, pad, exponent, constant) {
|
|
22687
|
-
var span = Math.abs(peek$
|
|
22687
|
+
var span = Math.abs(peek$2(range) - range[0]),
|
|
22688
22688
|
frac = span / (span - 2 * pad),
|
|
22689
22689
|
d = type === Log ? zoomLog(domain, null, frac) : type === Sqrt ? zoomPow(domain, null, frac, 0.5) : type === Pow ? zoomPow(domain, null, frac, exponent || 1) : type === Symlog ? zoomSymlog(domain, null, frac, constant || 1) : zoomLinear(domain, null, frac);
|
|
22690
22690
|
domain = domain.slice();
|
|
@@ -22709,7 +22709,7 @@ function configureBins(scale, _, count) {
|
|
|
22709
22709
|
// generate bin boundary array
|
|
22710
22710
|
const domain = scale.domain(),
|
|
22711
22711
|
lo = domain[0],
|
|
22712
|
-
hi = peek$
|
|
22712
|
+
hi = peek$2(domain),
|
|
22713
22713
|
step = bins.step;
|
|
22714
22714
|
let start = bins.start == null ? lo : bins.start,
|
|
22715
22715
|
stop = bins.stop == null ? hi : bins.stop;
|
|
@@ -27829,7 +27829,7 @@ function forceCollide(radius) {
|
|
|
27829
27829
|
return force;
|
|
27830
27830
|
}
|
|
27831
27831
|
|
|
27832
|
-
function index$
|
|
27832
|
+
function index$2(d) {
|
|
27833
27833
|
return d.index;
|
|
27834
27834
|
}
|
|
27835
27835
|
|
|
@@ -27840,7 +27840,7 @@ function find$1(nodeById, nodeId) {
|
|
|
27840
27840
|
}
|
|
27841
27841
|
|
|
27842
27842
|
function forceLink(links) {
|
|
27843
|
-
var id = index$
|
|
27843
|
+
var id = index$2,
|
|
27844
27844
|
strength = defaultStrength,
|
|
27845
27845
|
strengths,
|
|
27846
27846
|
distance = constant$1(30),
|
|
@@ -30209,7 +30209,7 @@ Nest.Definition = {
|
|
|
30209
30209
|
'type': 'boolean'
|
|
30210
30210
|
}]
|
|
30211
30211
|
};
|
|
30212
|
-
const children$
|
|
30212
|
+
const children$2 = n => n.values;
|
|
30213
30213
|
inherits(Nest, Transform, {
|
|
30214
30214
|
transform(_, pulse) {
|
|
30215
30215
|
if (!pulse.source) {
|
|
@@ -30235,7 +30235,7 @@ inherits(Nest, Transform, {
|
|
|
30235
30235
|
n.key(k);
|
|
30236
30236
|
return n;
|
|
30237
30237
|
}, nest()).entries(out.source)
|
|
30238
|
-
}, children$
|
|
30238
|
+
}, children$2);
|
|
30239
30239
|
|
|
30240
30240
|
// collect nodes to add
|
|
30241
30241
|
if (gen) {
|
|
@@ -34845,50 +34845,50 @@ var elasticInOut = (function custom(a, p) {
|
|
|
34845
34845
|
return elasticInOut;
|
|
34846
34846
|
})(amplitude, period);
|
|
34847
34847
|
|
|
34848
|
-
const RawCode$
|
|
34849
|
-
const Literal$
|
|
34850
|
-
const Property$
|
|
34851
|
-
const Identifier$
|
|
34852
|
-
const ArrayExpression$
|
|
34853
|
-
const BinaryExpression$
|
|
34854
|
-
const CallExpression$
|
|
34855
|
-
const ConditionalExpression$
|
|
34856
|
-
const LogicalExpression$
|
|
34857
|
-
const MemberExpression$
|
|
34858
|
-
const ObjectExpression$
|
|
34859
|
-
const UnaryExpression$
|
|
34860
|
-
function ASTNode$
|
|
34848
|
+
const RawCode$1 = 'RawCode';
|
|
34849
|
+
const Literal$1 = 'Literal';
|
|
34850
|
+
const Property$1 = 'Property';
|
|
34851
|
+
const Identifier$1 = 'Identifier';
|
|
34852
|
+
const ArrayExpression$1 = 'ArrayExpression';
|
|
34853
|
+
const BinaryExpression$1 = 'BinaryExpression';
|
|
34854
|
+
const CallExpression$1 = 'CallExpression';
|
|
34855
|
+
const ConditionalExpression$1 = 'ConditionalExpression';
|
|
34856
|
+
const LogicalExpression$1 = 'LogicalExpression';
|
|
34857
|
+
const MemberExpression$1 = 'MemberExpression';
|
|
34858
|
+
const ObjectExpression$1 = 'ObjectExpression';
|
|
34859
|
+
const UnaryExpression$1 = 'UnaryExpression';
|
|
34860
|
+
function ASTNode$1(type) {
|
|
34861
34861
|
this.type = type;
|
|
34862
34862
|
}
|
|
34863
|
-
ASTNode$
|
|
34863
|
+
ASTNode$1.prototype.visit = function (visitor) {
|
|
34864
34864
|
let c, i, n;
|
|
34865
34865
|
if (visitor(this)) return 1;
|
|
34866
|
-
for (c = children$
|
|
34866
|
+
for (c = children$1(this), i = 0, n = c.length; i < n; ++i) {
|
|
34867
34867
|
if (c[i].visit(visitor)) return 1;
|
|
34868
34868
|
}
|
|
34869
34869
|
};
|
|
34870
|
-
function children$
|
|
34870
|
+
function children$1(node) {
|
|
34871
34871
|
switch (node.type) {
|
|
34872
|
-
case ArrayExpression$
|
|
34872
|
+
case ArrayExpression$1:
|
|
34873
34873
|
return node.elements;
|
|
34874
|
-
case BinaryExpression$
|
|
34875
|
-
case LogicalExpression$
|
|
34874
|
+
case BinaryExpression$1:
|
|
34875
|
+
case LogicalExpression$1:
|
|
34876
34876
|
return [node.left, node.right];
|
|
34877
|
-
case CallExpression$
|
|
34877
|
+
case CallExpression$1:
|
|
34878
34878
|
return [node.callee].concat(node.arguments);
|
|
34879
|
-
case ConditionalExpression$
|
|
34879
|
+
case ConditionalExpression$1:
|
|
34880
34880
|
return [node.test, node.consequent, node.alternate];
|
|
34881
|
-
case MemberExpression$
|
|
34881
|
+
case MemberExpression$1:
|
|
34882
34882
|
return [node.object, node.property];
|
|
34883
|
-
case ObjectExpression$
|
|
34883
|
+
case ObjectExpression$1:
|
|
34884
34884
|
return node.properties;
|
|
34885
|
-
case Property$
|
|
34885
|
+
case Property$1:
|
|
34886
34886
|
return [node.key, node.value];
|
|
34887
|
-
case UnaryExpression$
|
|
34887
|
+
case UnaryExpression$1:
|
|
34888
34888
|
return [node.argument];
|
|
34889
|
-
case Identifier$
|
|
34890
|
-
case Literal$
|
|
34891
|
-
case RawCode$
|
|
34889
|
+
case Identifier$1:
|
|
34890
|
+
case Literal$1:
|
|
34891
|
+
case RawCode$1:
|
|
34892
34892
|
default:
|
|
34893
34893
|
return [];
|
|
34894
34894
|
}
|
|
@@ -34929,93 +34929,93 @@ function children$2(node) {
|
|
|
34929
34929
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
34930
34930
|
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
34931
34931
|
*/
|
|
34932
|
-
var TokenName$
|
|
34933
|
-
var TokenBooleanLiteral$
|
|
34934
|
-
TokenEOF$
|
|
34935
|
-
TokenIdentifier$
|
|
34936
|
-
TokenKeyword$
|
|
34937
|
-
TokenNullLiteral$
|
|
34938
|
-
TokenNumericLiteral$
|
|
34939
|
-
TokenPunctuator$
|
|
34940
|
-
TokenStringLiteral$
|
|
34941
|
-
TokenRegularExpression$
|
|
34942
|
-
TokenName$
|
|
34943
|
-
TokenName$
|
|
34944
|
-
TokenName$
|
|
34945
|
-
TokenName$
|
|
34946
|
-
TokenName$
|
|
34947
|
-
TokenName$
|
|
34948
|
-
TokenName$
|
|
34949
|
-
TokenName$
|
|
34950
|
-
TokenName$
|
|
34951
|
-
TokenName$
|
|
34952
|
-
var SyntaxArrayExpression$
|
|
34953
|
-
SyntaxBinaryExpression$
|
|
34954
|
-
SyntaxCallExpression$
|
|
34955
|
-
SyntaxConditionalExpression$
|
|
34956
|
-
SyntaxIdentifier$
|
|
34957
|
-
SyntaxLiteral$
|
|
34958
|
-
SyntaxLogicalExpression$
|
|
34959
|
-
SyntaxMemberExpression$
|
|
34960
|
-
SyntaxObjectExpression$
|
|
34961
|
-
SyntaxProperty$
|
|
34962
|
-
SyntaxUnaryExpression$
|
|
34932
|
+
var TokenName$1, source$1, index$1, length$1, lookahead$1;
|
|
34933
|
+
var TokenBooleanLiteral$1 = 1,
|
|
34934
|
+
TokenEOF$1 = 2,
|
|
34935
|
+
TokenIdentifier$1 = 3,
|
|
34936
|
+
TokenKeyword$1 = 4,
|
|
34937
|
+
TokenNullLiteral$1 = 5,
|
|
34938
|
+
TokenNumericLiteral$1 = 6,
|
|
34939
|
+
TokenPunctuator$1 = 7,
|
|
34940
|
+
TokenStringLiteral$1 = 8,
|
|
34941
|
+
TokenRegularExpression$1 = 9;
|
|
34942
|
+
TokenName$1 = {};
|
|
34943
|
+
TokenName$1[TokenBooleanLiteral$1] = 'Boolean';
|
|
34944
|
+
TokenName$1[TokenEOF$1] = '<end>';
|
|
34945
|
+
TokenName$1[TokenIdentifier$1] = 'Identifier';
|
|
34946
|
+
TokenName$1[TokenKeyword$1] = 'Keyword';
|
|
34947
|
+
TokenName$1[TokenNullLiteral$1] = 'Null';
|
|
34948
|
+
TokenName$1[TokenNumericLiteral$1] = 'Numeric';
|
|
34949
|
+
TokenName$1[TokenPunctuator$1] = 'Punctuator';
|
|
34950
|
+
TokenName$1[TokenStringLiteral$1] = 'String';
|
|
34951
|
+
TokenName$1[TokenRegularExpression$1] = 'RegularExpression';
|
|
34952
|
+
var SyntaxArrayExpression$1 = 'ArrayExpression',
|
|
34953
|
+
SyntaxBinaryExpression$1 = 'BinaryExpression',
|
|
34954
|
+
SyntaxCallExpression$1 = 'CallExpression',
|
|
34955
|
+
SyntaxConditionalExpression$1 = 'ConditionalExpression',
|
|
34956
|
+
SyntaxIdentifier$1 = 'Identifier',
|
|
34957
|
+
SyntaxLiteral$1 = 'Literal',
|
|
34958
|
+
SyntaxLogicalExpression$1 = 'LogicalExpression',
|
|
34959
|
+
SyntaxMemberExpression$1 = 'MemberExpression',
|
|
34960
|
+
SyntaxObjectExpression$1 = 'ObjectExpression',
|
|
34961
|
+
SyntaxProperty$1 = 'Property',
|
|
34962
|
+
SyntaxUnaryExpression$1 = 'UnaryExpression';
|
|
34963
34963
|
|
|
34964
34964
|
// Error messages should be identical to V8.
|
|
34965
|
-
var MessageUnexpectedToken$
|
|
34966
|
-
MessageUnexpectedNumber$
|
|
34967
|
-
MessageUnexpectedString$
|
|
34968
|
-
MessageUnexpectedIdentifier$
|
|
34969
|
-
MessageUnexpectedReserved$
|
|
34970
|
-
MessageUnexpectedEOS$
|
|
34971
|
-
MessageInvalidRegExp$
|
|
34972
|
-
MessageUnterminatedRegExp$
|
|
34973
|
-
MessageStrictOctalLiteral$
|
|
34974
|
-
MessageStrictDuplicateProperty$
|
|
34975
|
-
var ILLEGAL$
|
|
34976
|
-
DISABLED$
|
|
34965
|
+
var MessageUnexpectedToken$1 = 'Unexpected token %0',
|
|
34966
|
+
MessageUnexpectedNumber$1 = 'Unexpected number',
|
|
34967
|
+
MessageUnexpectedString$1 = 'Unexpected string',
|
|
34968
|
+
MessageUnexpectedIdentifier$1 = 'Unexpected identifier',
|
|
34969
|
+
MessageUnexpectedReserved$1 = 'Unexpected reserved word',
|
|
34970
|
+
MessageUnexpectedEOS$1 = 'Unexpected end of input',
|
|
34971
|
+
MessageInvalidRegExp$1 = 'Invalid regular expression',
|
|
34972
|
+
MessageUnterminatedRegExp$1 = 'Invalid regular expression: missing /',
|
|
34973
|
+
MessageStrictOctalLiteral$1 = 'Octal literals are not allowed in strict mode.',
|
|
34974
|
+
MessageStrictDuplicateProperty$1 = 'Duplicate data property in object literal not allowed in strict mode';
|
|
34975
|
+
var ILLEGAL$2 = 'ILLEGAL',
|
|
34976
|
+
DISABLED$1 = 'Disabled.';
|
|
34977
34977
|
|
|
34978
34978
|
// See also tools/generate-unicode-regex.py.
|
|
34979
|
-
var RegexNonAsciiIdentifierStart$
|
|
34979
|
+
var RegexNonAsciiIdentifierStart$1 = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),
|
|
34980
34980
|
// eslint-disable-next-line no-misleading-character-class
|
|
34981
|
-
RegexNonAsciiIdentifierPart$
|
|
34981
|
+
RegexNonAsciiIdentifierPart$1 = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]');
|
|
34982
34982
|
|
|
34983
34983
|
// Ensure the condition is true, otherwise throw an error.
|
|
34984
34984
|
// This is only to have a better contract semantic, i.e. another safety net
|
|
34985
34985
|
// to catch a logic error. The condition shall be fulfilled in normal case.
|
|
34986
34986
|
// Do NOT use this to enforce a certain condition on any user input.
|
|
34987
34987
|
|
|
34988
|
-
function assert$
|
|
34988
|
+
function assert$1(condition, message) {
|
|
34989
34989
|
/* istanbul ignore next */
|
|
34990
34990
|
if (!condition) {
|
|
34991
34991
|
throw new Error('ASSERT: ' + message);
|
|
34992
34992
|
}
|
|
34993
34993
|
}
|
|
34994
|
-
function isDecimalDigit$
|
|
34994
|
+
function isDecimalDigit$1(ch) {
|
|
34995
34995
|
return ch >= 0x30 && ch <= 0x39; // 0..9
|
|
34996
34996
|
}
|
|
34997
|
-
function isHexDigit$
|
|
34997
|
+
function isHexDigit$1(ch) {
|
|
34998
34998
|
return '0123456789abcdefABCDEF'.includes(ch);
|
|
34999
34999
|
}
|
|
35000
|
-
function isOctalDigit$
|
|
35000
|
+
function isOctalDigit$1(ch) {
|
|
35001
35001
|
return '01234567'.includes(ch);
|
|
35002
35002
|
}
|
|
35003
35003
|
|
|
35004
35004
|
// 7.2 White Space
|
|
35005
35005
|
|
|
35006
|
-
function isWhiteSpace$
|
|
35006
|
+
function isWhiteSpace$1(ch) {
|
|
35007
35007
|
return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].includes(ch);
|
|
35008
35008
|
}
|
|
35009
35009
|
|
|
35010
35010
|
// 7.3 Line Terminators
|
|
35011
35011
|
|
|
35012
|
-
function isLineTerminator$
|
|
35012
|
+
function isLineTerminator$1(ch) {
|
|
35013
35013
|
return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
|
|
35014
35014
|
}
|
|
35015
35015
|
|
|
35016
35016
|
// 7.6 Identifier Names and Identifiers
|
|
35017
35017
|
|
|
35018
|
-
function isIdentifierStart$
|
|
35018
|
+
function isIdentifierStart$1(ch) {
|
|
35019
35019
|
return ch === 0x24 || ch === 0x5F ||
|
|
35020
35020
|
// $ (dollar) and _ (underscore)
|
|
35021
35021
|
ch >= 0x41 && ch <= 0x5A ||
|
|
@@ -35024,9 +35024,9 @@ function isIdentifierStart$2(ch) {
|
|
|
35024
35024
|
// a..z
|
|
35025
35025
|
ch === 0x5C ||
|
|
35026
35026
|
// \ (backslash)
|
|
35027
|
-
ch >= 0x80 && RegexNonAsciiIdentifierStart$
|
|
35027
|
+
ch >= 0x80 && RegexNonAsciiIdentifierStart$1.test(String.fromCharCode(ch));
|
|
35028
35028
|
}
|
|
35029
|
-
function isIdentifierPart$
|
|
35029
|
+
function isIdentifierPart$1(ch) {
|
|
35030
35030
|
return ch === 0x24 || ch === 0x5F ||
|
|
35031
35031
|
// $ (dollar) and _ (underscore)
|
|
35032
35032
|
ch >= 0x41 && ch <= 0x5A ||
|
|
@@ -35037,12 +35037,12 @@ function isIdentifierPart$2(ch) {
|
|
|
35037
35037
|
// 0..9
|
|
35038
35038
|
ch === 0x5C ||
|
|
35039
35039
|
// \ (backslash)
|
|
35040
|
-
ch >= 0x80 && RegexNonAsciiIdentifierPart$
|
|
35040
|
+
ch >= 0x80 && RegexNonAsciiIdentifierPart$1.test(String.fromCharCode(ch));
|
|
35041
35041
|
}
|
|
35042
35042
|
|
|
35043
35043
|
// 7.6.1.1 Keywords
|
|
35044
35044
|
|
|
35045
|
-
const keywords$
|
|
35045
|
+
const keywords$1 = {
|
|
35046
35046
|
'if': 1,
|
|
35047
35047
|
'in': 1,
|
|
35048
35048
|
'do': 1,
|
|
@@ -35086,50 +35086,50 @@ const keywords$2 = {
|
|
|
35086
35086
|
'instanceof': 1,
|
|
35087
35087
|
'implements': 1
|
|
35088
35088
|
};
|
|
35089
|
-
function skipComment$
|
|
35090
|
-
while (index$
|
|
35091
|
-
const ch = source$
|
|
35092
|
-
if (isWhiteSpace$
|
|
35093
|
-
++index$
|
|
35089
|
+
function skipComment$1() {
|
|
35090
|
+
while (index$1 < length$1) {
|
|
35091
|
+
const ch = source$1.charCodeAt(index$1);
|
|
35092
|
+
if (isWhiteSpace$1(ch) || isLineTerminator$1(ch)) {
|
|
35093
|
+
++index$1;
|
|
35094
35094
|
} else {
|
|
35095
35095
|
break;
|
|
35096
35096
|
}
|
|
35097
35097
|
}
|
|
35098
35098
|
}
|
|
35099
|
-
function scanHexEscape$
|
|
35099
|
+
function scanHexEscape$1(prefix) {
|
|
35100
35100
|
var i,
|
|
35101
35101
|
len,
|
|
35102
35102
|
ch,
|
|
35103
35103
|
code = 0;
|
|
35104
35104
|
len = prefix === 'u' ? 4 : 2;
|
|
35105
35105
|
for (i = 0; i < len; ++i) {
|
|
35106
|
-
if (index$
|
|
35107
|
-
ch = source$
|
|
35106
|
+
if (index$1 < length$1 && isHexDigit$1(source$1[index$1])) {
|
|
35107
|
+
ch = source$1[index$1++];
|
|
35108
35108
|
code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
|
|
35109
35109
|
} else {
|
|
35110
|
-
throwError$
|
|
35110
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35111
35111
|
}
|
|
35112
35112
|
}
|
|
35113
35113
|
return String.fromCharCode(code);
|
|
35114
35114
|
}
|
|
35115
|
-
function scanUnicodeCodePointEscape$
|
|
35115
|
+
function scanUnicodeCodePointEscape$1() {
|
|
35116
35116
|
var ch, code, cu1, cu2;
|
|
35117
|
-
ch = source$
|
|
35117
|
+
ch = source$1[index$1];
|
|
35118
35118
|
code = 0;
|
|
35119
35119
|
|
|
35120
35120
|
// At least, one hex digit is required.
|
|
35121
35121
|
if (ch === '}') {
|
|
35122
|
-
throwError$
|
|
35122
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35123
35123
|
}
|
|
35124
|
-
while (index$
|
|
35125
|
-
ch = source$
|
|
35126
|
-
if (!isHexDigit$
|
|
35124
|
+
while (index$1 < length$1) {
|
|
35125
|
+
ch = source$1[index$1++];
|
|
35126
|
+
if (!isHexDigit$1(ch)) {
|
|
35127
35127
|
break;
|
|
35128
35128
|
}
|
|
35129
35129
|
code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
|
|
35130
35130
|
}
|
|
35131
35131
|
if (code > 0x10FFFF || ch !== '}') {
|
|
35132
|
-
throwError$
|
|
35132
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35133
35133
|
}
|
|
35134
35134
|
|
|
35135
35135
|
// UTF-16 Encoding
|
|
@@ -35140,101 +35140,101 @@ function scanUnicodeCodePointEscape$2() {
|
|
|
35140
35140
|
cu2 = (code - 0x10000 & 1023) + 0xDC00;
|
|
35141
35141
|
return String.fromCharCode(cu1, cu2);
|
|
35142
35142
|
}
|
|
35143
|
-
function getEscapedIdentifier$
|
|
35143
|
+
function getEscapedIdentifier$1() {
|
|
35144
35144
|
var ch, id;
|
|
35145
|
-
ch = source$
|
|
35145
|
+
ch = source$1.charCodeAt(index$1++);
|
|
35146
35146
|
id = String.fromCharCode(ch);
|
|
35147
35147
|
|
|
35148
35148
|
// '\u' (U+005C, U+0075) denotes an escaped character.
|
|
35149
35149
|
if (ch === 0x5C) {
|
|
35150
|
-
if (source$
|
|
35151
|
-
throwError$
|
|
35150
|
+
if (source$1.charCodeAt(index$1) !== 0x75) {
|
|
35151
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35152
35152
|
}
|
|
35153
|
-
++index$
|
|
35154
|
-
ch = scanHexEscape$
|
|
35155
|
-
if (!ch || ch === '\\' || !isIdentifierStart$
|
|
35156
|
-
throwError$
|
|
35153
|
+
++index$1;
|
|
35154
|
+
ch = scanHexEscape$1('u');
|
|
35155
|
+
if (!ch || ch === '\\' || !isIdentifierStart$1(ch.charCodeAt(0))) {
|
|
35156
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35157
35157
|
}
|
|
35158
35158
|
id = ch;
|
|
35159
35159
|
}
|
|
35160
|
-
while (index$
|
|
35161
|
-
ch = source$
|
|
35162
|
-
if (!isIdentifierPart$
|
|
35160
|
+
while (index$1 < length$1) {
|
|
35161
|
+
ch = source$1.charCodeAt(index$1);
|
|
35162
|
+
if (!isIdentifierPart$1(ch)) {
|
|
35163
35163
|
break;
|
|
35164
35164
|
}
|
|
35165
|
-
++index$
|
|
35165
|
+
++index$1;
|
|
35166
35166
|
id += String.fromCharCode(ch);
|
|
35167
35167
|
|
|
35168
35168
|
// '\u' (U+005C, U+0075) denotes an escaped character.
|
|
35169
35169
|
if (ch === 0x5C) {
|
|
35170
35170
|
id = id.substr(0, id.length - 1);
|
|
35171
|
-
if (source$
|
|
35172
|
-
throwError$
|
|
35171
|
+
if (source$1.charCodeAt(index$1) !== 0x75) {
|
|
35172
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35173
35173
|
}
|
|
35174
|
-
++index$
|
|
35175
|
-
ch = scanHexEscape$
|
|
35176
|
-
if (!ch || ch === '\\' || !isIdentifierPart$
|
|
35177
|
-
throwError$
|
|
35174
|
+
++index$1;
|
|
35175
|
+
ch = scanHexEscape$1('u');
|
|
35176
|
+
if (!ch || ch === '\\' || !isIdentifierPart$1(ch.charCodeAt(0))) {
|
|
35177
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35178
35178
|
}
|
|
35179
35179
|
id += ch;
|
|
35180
35180
|
}
|
|
35181
35181
|
}
|
|
35182
35182
|
return id;
|
|
35183
35183
|
}
|
|
35184
|
-
function getIdentifier$
|
|
35184
|
+
function getIdentifier$1() {
|
|
35185
35185
|
var start, ch;
|
|
35186
|
-
start = index$
|
|
35187
|
-
while (index$
|
|
35188
|
-
ch = source$
|
|
35186
|
+
start = index$1++;
|
|
35187
|
+
while (index$1 < length$1) {
|
|
35188
|
+
ch = source$1.charCodeAt(index$1);
|
|
35189
35189
|
if (ch === 0x5C) {
|
|
35190
35190
|
// Blackslash (U+005C) marks Unicode escape sequence.
|
|
35191
|
-
index$
|
|
35192
|
-
return getEscapedIdentifier$
|
|
35191
|
+
index$1 = start;
|
|
35192
|
+
return getEscapedIdentifier$1();
|
|
35193
35193
|
}
|
|
35194
|
-
if (isIdentifierPart$
|
|
35195
|
-
++index$
|
|
35194
|
+
if (isIdentifierPart$1(ch)) {
|
|
35195
|
+
++index$1;
|
|
35196
35196
|
} else {
|
|
35197
35197
|
break;
|
|
35198
35198
|
}
|
|
35199
35199
|
}
|
|
35200
|
-
return source$
|
|
35200
|
+
return source$1.slice(start, index$1);
|
|
35201
35201
|
}
|
|
35202
|
-
function scanIdentifier$
|
|
35202
|
+
function scanIdentifier$1() {
|
|
35203
35203
|
var start, id, type;
|
|
35204
|
-
start = index$
|
|
35204
|
+
start = index$1;
|
|
35205
35205
|
|
|
35206
35206
|
// Backslash (U+005C) starts an escaped character.
|
|
35207
|
-
id = source$
|
|
35207
|
+
id = source$1.charCodeAt(index$1) === 0x5C ? getEscapedIdentifier$1() : getIdentifier$1();
|
|
35208
35208
|
|
|
35209
35209
|
// There is no keyword or literal with only one character.
|
|
35210
35210
|
// Thus, it must be an identifier.
|
|
35211
35211
|
if (id.length === 1) {
|
|
35212
|
-
type = TokenIdentifier$
|
|
35213
|
-
} else if (keywords$
|
|
35212
|
+
type = TokenIdentifier$1;
|
|
35213
|
+
} else if (keywords$1.hasOwnProperty(id)) {
|
|
35214
35214
|
// eslint-disable-line no-prototype-builtins
|
|
35215
|
-
type = TokenKeyword$
|
|
35215
|
+
type = TokenKeyword$1;
|
|
35216
35216
|
} else if (id === 'null') {
|
|
35217
|
-
type = TokenNullLiteral$
|
|
35217
|
+
type = TokenNullLiteral$1;
|
|
35218
35218
|
} else if (id === 'true' || id === 'false') {
|
|
35219
|
-
type = TokenBooleanLiteral$
|
|
35219
|
+
type = TokenBooleanLiteral$1;
|
|
35220
35220
|
} else {
|
|
35221
|
-
type = TokenIdentifier$
|
|
35221
|
+
type = TokenIdentifier$1;
|
|
35222
35222
|
}
|
|
35223
35223
|
return {
|
|
35224
35224
|
type: type,
|
|
35225
35225
|
value: id,
|
|
35226
35226
|
start: start,
|
|
35227
|
-
end: index$
|
|
35227
|
+
end: index$1
|
|
35228
35228
|
};
|
|
35229
35229
|
}
|
|
35230
35230
|
|
|
35231
35231
|
// 7.7 Punctuators
|
|
35232
35232
|
|
|
35233
|
-
function scanPunctuator$
|
|
35234
|
-
var start = index$
|
|
35235
|
-
code = source$
|
|
35233
|
+
function scanPunctuator$1() {
|
|
35234
|
+
var start = index$1,
|
|
35235
|
+
code = source$1.charCodeAt(index$1),
|
|
35236
35236
|
code2,
|
|
35237
|
-
ch1 = source$
|
|
35237
|
+
ch1 = source$1[index$1],
|
|
35238
35238
|
ch2,
|
|
35239
35239
|
ch3,
|
|
35240
35240
|
ch4;
|
|
@@ -35253,15 +35253,15 @@ function scanPunctuator$2() {
|
|
|
35253
35253
|
case 0x3F: // ?
|
|
35254
35254
|
case 0x7E:
|
|
35255
35255
|
// ~
|
|
35256
|
-
++index$
|
|
35256
|
+
++index$1;
|
|
35257
35257
|
return {
|
|
35258
|
-
type: TokenPunctuator$
|
|
35258
|
+
type: TokenPunctuator$1,
|
|
35259
35259
|
value: String.fromCharCode(code),
|
|
35260
35260
|
start: start,
|
|
35261
|
-
end: index$
|
|
35261
|
+
end: index$1
|
|
35262
35262
|
};
|
|
35263
35263
|
default:
|
|
35264
|
-
code2 = source$
|
|
35264
|
+
code2 = source$1.charCodeAt(index$1 + 1);
|
|
35265
35265
|
|
|
35266
35266
|
// '=' (U+003D) marks an assignment or comparison operator.
|
|
35267
35267
|
if (code2 === 0x3D) {
|
|
@@ -35277,27 +35277,27 @@ function scanPunctuator$2() {
|
|
|
35277
35277
|
case 0x26: // &
|
|
35278
35278
|
case 0x2A:
|
|
35279
35279
|
// *
|
|
35280
|
-
index$
|
|
35280
|
+
index$1 += 2;
|
|
35281
35281
|
return {
|
|
35282
|
-
type: TokenPunctuator$
|
|
35282
|
+
type: TokenPunctuator$1,
|
|
35283
35283
|
value: String.fromCharCode(code) + String.fromCharCode(code2),
|
|
35284
35284
|
start: start,
|
|
35285
|
-
end: index$
|
|
35285
|
+
end: index$1
|
|
35286
35286
|
};
|
|
35287
35287
|
case 0x21: // !
|
|
35288
35288
|
case 0x3D:
|
|
35289
35289
|
// =
|
|
35290
|
-
index$
|
|
35290
|
+
index$1 += 2;
|
|
35291
35291
|
|
|
35292
35292
|
// !== and ===
|
|
35293
|
-
if (source$
|
|
35294
|
-
++index$
|
|
35293
|
+
if (source$1.charCodeAt(index$1) === 0x3D) {
|
|
35294
|
+
++index$1;
|
|
35295
35295
|
}
|
|
35296
35296
|
return {
|
|
35297
|
-
type: TokenPunctuator$
|
|
35298
|
-
value: source$
|
|
35297
|
+
type: TokenPunctuator$1,
|
|
35298
|
+
value: source$1.slice(start, index$1),
|
|
35299
35299
|
start: start,
|
|
35300
|
-
end: index$
|
|
35300
|
+
end: index$1
|
|
35301
35301
|
};
|
|
35302
35302
|
}
|
|
35303
35303
|
}
|
|
@@ -35305,14 +35305,14 @@ function scanPunctuator$2() {
|
|
|
35305
35305
|
|
|
35306
35306
|
// 4-character punctuator: >>>=
|
|
35307
35307
|
|
|
35308
|
-
ch4 = source$
|
|
35308
|
+
ch4 = source$1.substr(index$1, 4);
|
|
35309
35309
|
if (ch4 === '>>>=') {
|
|
35310
|
-
index$
|
|
35310
|
+
index$1 += 4;
|
|
35311
35311
|
return {
|
|
35312
|
-
type: TokenPunctuator$
|
|
35312
|
+
type: TokenPunctuator$1,
|
|
35313
35313
|
value: ch4,
|
|
35314
35314
|
start: start,
|
|
35315
|
-
end: index$
|
|
35315
|
+
end: index$1
|
|
35316
35316
|
};
|
|
35317
35317
|
}
|
|
35318
35318
|
|
|
@@ -35320,178 +35320,178 @@ function scanPunctuator$2() {
|
|
|
35320
35320
|
|
|
35321
35321
|
ch3 = ch4.substr(0, 3);
|
|
35322
35322
|
if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {
|
|
35323
|
-
index$
|
|
35323
|
+
index$1 += 3;
|
|
35324
35324
|
return {
|
|
35325
|
-
type: TokenPunctuator$
|
|
35325
|
+
type: TokenPunctuator$1,
|
|
35326
35326
|
value: ch3,
|
|
35327
35327
|
start: start,
|
|
35328
|
-
end: index$
|
|
35328
|
+
end: index$1
|
|
35329
35329
|
};
|
|
35330
35330
|
}
|
|
35331
35331
|
|
|
35332
35332
|
// Other 2-character punctuators: ++ -- << >> && ||
|
|
35333
35333
|
ch2 = ch3.substr(0, 2);
|
|
35334
35334
|
if (ch1 === ch2[1] && '+-<>&|'.includes(ch1) || ch2 === '=>') {
|
|
35335
|
-
index$
|
|
35335
|
+
index$1 += 2;
|
|
35336
35336
|
return {
|
|
35337
|
-
type: TokenPunctuator$
|
|
35337
|
+
type: TokenPunctuator$1,
|
|
35338
35338
|
value: ch2,
|
|
35339
35339
|
start: start,
|
|
35340
|
-
end: index$
|
|
35340
|
+
end: index$1
|
|
35341
35341
|
};
|
|
35342
35342
|
}
|
|
35343
35343
|
if (ch2 === '//') {
|
|
35344
|
-
throwError$
|
|
35344
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35345
35345
|
}
|
|
35346
35346
|
|
|
35347
35347
|
// 1-character punctuators: < > = ! + - * % & | ^ /
|
|
35348
35348
|
|
|
35349
35349
|
if ('<>=!+-*%&|^/'.includes(ch1)) {
|
|
35350
|
-
++index$
|
|
35350
|
+
++index$1;
|
|
35351
35351
|
return {
|
|
35352
|
-
type: TokenPunctuator$
|
|
35352
|
+
type: TokenPunctuator$1,
|
|
35353
35353
|
value: ch1,
|
|
35354
35354
|
start: start,
|
|
35355
|
-
end: index$
|
|
35355
|
+
end: index$1
|
|
35356
35356
|
};
|
|
35357
35357
|
}
|
|
35358
|
-
throwError$
|
|
35358
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35359
35359
|
}
|
|
35360
35360
|
|
|
35361
35361
|
// 7.8.3 Numeric Literals
|
|
35362
35362
|
|
|
35363
|
-
function scanHexLiteral$
|
|
35363
|
+
function scanHexLiteral$1(start) {
|
|
35364
35364
|
let number = '';
|
|
35365
|
-
while (index$
|
|
35366
|
-
if (!isHexDigit$
|
|
35365
|
+
while (index$1 < length$1) {
|
|
35366
|
+
if (!isHexDigit$1(source$1[index$1])) {
|
|
35367
35367
|
break;
|
|
35368
35368
|
}
|
|
35369
|
-
number += source$
|
|
35369
|
+
number += source$1[index$1++];
|
|
35370
35370
|
}
|
|
35371
35371
|
if (number.length === 0) {
|
|
35372
|
-
throwError$
|
|
35372
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35373
35373
|
}
|
|
35374
|
-
if (isIdentifierStart$
|
|
35375
|
-
throwError$
|
|
35374
|
+
if (isIdentifierStart$1(source$1.charCodeAt(index$1))) {
|
|
35375
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35376
35376
|
}
|
|
35377
35377
|
return {
|
|
35378
|
-
type: TokenNumericLiteral$
|
|
35378
|
+
type: TokenNumericLiteral$1,
|
|
35379
35379
|
value: parseInt('0x' + number, 16),
|
|
35380
35380
|
start: start,
|
|
35381
|
-
end: index$
|
|
35381
|
+
end: index$1
|
|
35382
35382
|
};
|
|
35383
35383
|
}
|
|
35384
|
-
function scanOctalLiteral$
|
|
35385
|
-
let number = '0' + source$
|
|
35386
|
-
while (index$
|
|
35387
|
-
if (!isOctalDigit$
|
|
35384
|
+
function scanOctalLiteral$1(start) {
|
|
35385
|
+
let number = '0' + source$1[index$1++];
|
|
35386
|
+
while (index$1 < length$1) {
|
|
35387
|
+
if (!isOctalDigit$1(source$1[index$1])) {
|
|
35388
35388
|
break;
|
|
35389
35389
|
}
|
|
35390
|
-
number += source$
|
|
35390
|
+
number += source$1[index$1++];
|
|
35391
35391
|
}
|
|
35392
|
-
if (isIdentifierStart$
|
|
35393
|
-
throwError$
|
|
35392
|
+
if (isIdentifierStart$1(source$1.charCodeAt(index$1)) || isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
35393
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35394
35394
|
}
|
|
35395
35395
|
return {
|
|
35396
|
-
type: TokenNumericLiteral$
|
|
35396
|
+
type: TokenNumericLiteral$1,
|
|
35397
35397
|
value: parseInt(number, 8),
|
|
35398
35398
|
octal: true,
|
|
35399
35399
|
start: start,
|
|
35400
|
-
end: index$
|
|
35400
|
+
end: index$1
|
|
35401
35401
|
};
|
|
35402
35402
|
}
|
|
35403
|
-
function scanNumericLiteral$
|
|
35403
|
+
function scanNumericLiteral$1() {
|
|
35404
35404
|
var number, start, ch;
|
|
35405
|
-
ch = source$
|
|
35406
|
-
assert$
|
|
35407
|
-
start = index$
|
|
35405
|
+
ch = source$1[index$1];
|
|
35406
|
+
assert$1(isDecimalDigit$1(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');
|
|
35407
|
+
start = index$1;
|
|
35408
35408
|
number = '';
|
|
35409
35409
|
if (ch !== '.') {
|
|
35410
|
-
number = source$
|
|
35411
|
-
ch = source$
|
|
35410
|
+
number = source$1[index$1++];
|
|
35411
|
+
ch = source$1[index$1];
|
|
35412
35412
|
|
|
35413
35413
|
// Hex number starts with '0x'.
|
|
35414
35414
|
// Octal number starts with '0'.
|
|
35415
35415
|
if (number === '0') {
|
|
35416
35416
|
if (ch === 'x' || ch === 'X') {
|
|
35417
|
-
++index$
|
|
35418
|
-
return scanHexLiteral$
|
|
35417
|
+
++index$1;
|
|
35418
|
+
return scanHexLiteral$1(start);
|
|
35419
35419
|
}
|
|
35420
|
-
if (isOctalDigit$
|
|
35421
|
-
return scanOctalLiteral$
|
|
35420
|
+
if (isOctalDigit$1(ch)) {
|
|
35421
|
+
return scanOctalLiteral$1(start);
|
|
35422
35422
|
}
|
|
35423
35423
|
|
|
35424
35424
|
// decimal number starts with '0' such as '09' is illegal.
|
|
35425
|
-
if (ch && isDecimalDigit$
|
|
35426
|
-
throwError$
|
|
35425
|
+
if (ch && isDecimalDigit$1(ch.charCodeAt(0))) {
|
|
35426
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35427
35427
|
}
|
|
35428
35428
|
}
|
|
35429
|
-
while (isDecimalDigit$
|
|
35430
|
-
number += source$
|
|
35429
|
+
while (isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
35430
|
+
number += source$1[index$1++];
|
|
35431
35431
|
}
|
|
35432
|
-
ch = source$
|
|
35432
|
+
ch = source$1[index$1];
|
|
35433
35433
|
}
|
|
35434
35434
|
if (ch === '.') {
|
|
35435
|
-
number += source$
|
|
35436
|
-
while (isDecimalDigit$
|
|
35437
|
-
number += source$
|
|
35435
|
+
number += source$1[index$1++];
|
|
35436
|
+
while (isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
35437
|
+
number += source$1[index$1++];
|
|
35438
35438
|
}
|
|
35439
|
-
ch = source$
|
|
35439
|
+
ch = source$1[index$1];
|
|
35440
35440
|
}
|
|
35441
35441
|
if (ch === 'e' || ch === 'E') {
|
|
35442
|
-
number += source$
|
|
35443
|
-
ch = source$
|
|
35442
|
+
number += source$1[index$1++];
|
|
35443
|
+
ch = source$1[index$1];
|
|
35444
35444
|
if (ch === '+' || ch === '-') {
|
|
35445
|
-
number += source$
|
|
35445
|
+
number += source$1[index$1++];
|
|
35446
35446
|
}
|
|
35447
|
-
if (isDecimalDigit$
|
|
35448
|
-
while (isDecimalDigit$
|
|
35449
|
-
number += source$
|
|
35447
|
+
if (isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
35448
|
+
while (isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
35449
|
+
number += source$1[index$1++];
|
|
35450
35450
|
}
|
|
35451
35451
|
} else {
|
|
35452
|
-
throwError$
|
|
35452
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35453
35453
|
}
|
|
35454
35454
|
}
|
|
35455
|
-
if (isIdentifierStart$
|
|
35456
|
-
throwError$
|
|
35455
|
+
if (isIdentifierStart$1(source$1.charCodeAt(index$1))) {
|
|
35456
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35457
35457
|
}
|
|
35458
35458
|
return {
|
|
35459
|
-
type: TokenNumericLiteral$
|
|
35459
|
+
type: TokenNumericLiteral$1,
|
|
35460
35460
|
value: parseFloat(number),
|
|
35461
35461
|
start: start,
|
|
35462
|
-
end: index$
|
|
35462
|
+
end: index$1
|
|
35463
35463
|
};
|
|
35464
35464
|
}
|
|
35465
35465
|
|
|
35466
35466
|
// 7.8.4 String Literals
|
|
35467
35467
|
|
|
35468
|
-
function scanStringLiteral$
|
|
35468
|
+
function scanStringLiteral$1() {
|
|
35469
35469
|
var str = '',
|
|
35470
35470
|
quote,
|
|
35471
35471
|
start,
|
|
35472
35472
|
ch,
|
|
35473
35473
|
code,
|
|
35474
35474
|
octal = false;
|
|
35475
|
-
quote = source$
|
|
35476
|
-
assert$
|
|
35477
|
-
start = index$
|
|
35478
|
-
++index$
|
|
35479
|
-
while (index$
|
|
35480
|
-
ch = source$
|
|
35475
|
+
quote = source$1[index$1];
|
|
35476
|
+
assert$1(quote === '\'' || quote === '"', 'String literal must starts with a quote');
|
|
35477
|
+
start = index$1;
|
|
35478
|
+
++index$1;
|
|
35479
|
+
while (index$1 < length$1) {
|
|
35480
|
+
ch = source$1[index$1++];
|
|
35481
35481
|
if (ch === quote) {
|
|
35482
35482
|
quote = '';
|
|
35483
35483
|
break;
|
|
35484
35484
|
} else if (ch === '\\') {
|
|
35485
|
-
ch = source$
|
|
35486
|
-
if (!ch || !isLineTerminator$
|
|
35485
|
+
ch = source$1[index$1++];
|
|
35486
|
+
if (!ch || !isLineTerminator$1(ch.charCodeAt(0))) {
|
|
35487
35487
|
switch (ch) {
|
|
35488
35488
|
case 'u':
|
|
35489
35489
|
case 'x':
|
|
35490
|
-
if (source$
|
|
35491
|
-
++index$
|
|
35492
|
-
str += scanUnicodeCodePointEscape$
|
|
35490
|
+
if (source$1[index$1] === '{') {
|
|
35491
|
+
++index$1;
|
|
35492
|
+
str += scanUnicodeCodePointEscape$1();
|
|
35493
35493
|
} else {
|
|
35494
|
-
str += scanHexEscape$
|
|
35494
|
+
str += scanHexEscape$1(ch);
|
|
35495
35495
|
}
|
|
35496
35496
|
break;
|
|
35497
35497
|
case 'n':
|
|
@@ -35513,21 +35513,21 @@ function scanStringLiteral$2() {
|
|
|
35513
35513
|
str += '\x0B';
|
|
35514
35514
|
break;
|
|
35515
35515
|
default:
|
|
35516
|
-
if (isOctalDigit$
|
|
35516
|
+
if (isOctalDigit$1(ch)) {
|
|
35517
35517
|
code = '01234567'.indexOf(ch);
|
|
35518
35518
|
|
|
35519
35519
|
// \0 is not octal escape sequence
|
|
35520
35520
|
if (code !== 0) {
|
|
35521
35521
|
octal = true;
|
|
35522
35522
|
}
|
|
35523
|
-
if (index$
|
|
35523
|
+
if (index$1 < length$1 && isOctalDigit$1(source$1[index$1])) {
|
|
35524
35524
|
octal = true;
|
|
35525
|
-
code = code * 8 + '01234567'.indexOf(source$
|
|
35525
|
+
code = code * 8 + '01234567'.indexOf(source$1[index$1++]);
|
|
35526
35526
|
|
|
35527
35527
|
// 3 digits are only allowed when string starts
|
|
35528
35528
|
// with 0, 1, 2, 3
|
|
35529
|
-
if ('0123'.includes(ch) && index$
|
|
35530
|
-
code = code * 8 + '01234567'.indexOf(source$
|
|
35529
|
+
if ('0123'.includes(ch) && index$1 < length$1 && isOctalDigit$1(source$1[index$1])) {
|
|
35530
|
+
code = code * 8 + '01234567'.indexOf(source$1[index$1++]);
|
|
35531
35531
|
}
|
|
35532
35532
|
}
|
|
35533
35533
|
str += String.fromCharCode(code);
|
|
@@ -35537,28 +35537,28 @@ function scanStringLiteral$2() {
|
|
|
35537
35537
|
break;
|
|
35538
35538
|
}
|
|
35539
35539
|
} else {
|
|
35540
|
-
if (ch === '\r' && source$
|
|
35541
|
-
++index$
|
|
35540
|
+
if (ch === '\r' && source$1[index$1] === '\n') {
|
|
35541
|
+
++index$1;
|
|
35542
35542
|
}
|
|
35543
35543
|
}
|
|
35544
|
-
} else if (isLineTerminator$
|
|
35544
|
+
} else if (isLineTerminator$1(ch.charCodeAt(0))) {
|
|
35545
35545
|
break;
|
|
35546
35546
|
} else {
|
|
35547
35547
|
str += ch;
|
|
35548
35548
|
}
|
|
35549
35549
|
}
|
|
35550
35550
|
if (quote !== '') {
|
|
35551
|
-
throwError$
|
|
35551
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35552
35552
|
}
|
|
35553
35553
|
return {
|
|
35554
|
-
type: TokenStringLiteral$
|
|
35554
|
+
type: TokenStringLiteral$1,
|
|
35555
35555
|
value: str,
|
|
35556
35556
|
octal: octal,
|
|
35557
35557
|
start: start,
|
|
35558
|
-
end: index$
|
|
35558
|
+
end: index$1
|
|
35559
35559
|
};
|
|
35560
35560
|
}
|
|
35561
|
-
function testRegExp$
|
|
35561
|
+
function testRegExp$1(pattern, flags) {
|
|
35562
35562
|
let tmp = pattern;
|
|
35563
35563
|
if (flags.includes('u')) {
|
|
35564
35564
|
// Replace each astral symbol and every Unicode code point
|
|
@@ -35573,7 +35573,7 @@ function testRegExp$2(pattern, flags) {
|
|
|
35573
35573
|
if (parseInt($1, 16) <= 0x10FFFF) {
|
|
35574
35574
|
return 'x';
|
|
35575
35575
|
}
|
|
35576
|
-
throwError$
|
|
35576
|
+
throwError$1({}, MessageInvalidRegExp$1);
|
|
35577
35577
|
}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x');
|
|
35578
35578
|
}
|
|
35579
35579
|
|
|
@@ -35586,25 +35586,25 @@ function testRegExp$2(pattern, flags) {
|
|
|
35586
35586
|
return null;
|
|
35587
35587
|
}
|
|
35588
35588
|
}
|
|
35589
|
-
function scanRegExpBody$
|
|
35589
|
+
function scanRegExpBody$1() {
|
|
35590
35590
|
var ch, str, classMarker, terminated, body;
|
|
35591
|
-
ch = source$
|
|
35592
|
-
assert$
|
|
35593
|
-
str = source$
|
|
35591
|
+
ch = source$1[index$1];
|
|
35592
|
+
assert$1(ch === '/', 'Regular expression literal must start with a slash');
|
|
35593
|
+
str = source$1[index$1++];
|
|
35594
35594
|
classMarker = false;
|
|
35595
35595
|
terminated = false;
|
|
35596
|
-
while (index$
|
|
35597
|
-
ch = source$
|
|
35596
|
+
while (index$1 < length$1) {
|
|
35597
|
+
ch = source$1[index$1++];
|
|
35598
35598
|
str += ch;
|
|
35599
35599
|
if (ch === '\\') {
|
|
35600
|
-
ch = source$
|
|
35600
|
+
ch = source$1[index$1++];
|
|
35601
35601
|
// ECMA-262 7.8.5
|
|
35602
|
-
if (isLineTerminator$
|
|
35603
|
-
throwError$
|
|
35602
|
+
if (isLineTerminator$1(ch.charCodeAt(0))) {
|
|
35603
|
+
throwError$1({}, MessageUnterminatedRegExp$1);
|
|
35604
35604
|
}
|
|
35605
35605
|
str += ch;
|
|
35606
|
-
} else if (isLineTerminator$
|
|
35607
|
-
throwError$
|
|
35606
|
+
} else if (isLineTerminator$1(ch.charCodeAt(0))) {
|
|
35607
|
+
throwError$1({}, MessageUnterminatedRegExp$1);
|
|
35608
35608
|
} else if (classMarker) {
|
|
35609
35609
|
if (ch === ']') {
|
|
35610
35610
|
classMarker = false;
|
|
@@ -35619,7 +35619,7 @@ function scanRegExpBody$2() {
|
|
|
35619
35619
|
}
|
|
35620
35620
|
}
|
|
35621
35621
|
if (!terminated) {
|
|
35622
|
-
throwError$
|
|
35622
|
+
throwError$1({}, MessageUnterminatedRegExp$1);
|
|
35623
35623
|
}
|
|
35624
35624
|
|
|
35625
35625
|
// Exclude leading and trailing slash.
|
|
@@ -35629,39 +35629,39 @@ function scanRegExpBody$2() {
|
|
|
35629
35629
|
literal: str
|
|
35630
35630
|
};
|
|
35631
35631
|
}
|
|
35632
|
-
function scanRegExpFlags$
|
|
35632
|
+
function scanRegExpFlags$1() {
|
|
35633
35633
|
var ch, str, flags;
|
|
35634
35634
|
str = '';
|
|
35635
35635
|
flags = '';
|
|
35636
|
-
while (index$
|
|
35637
|
-
ch = source$
|
|
35638
|
-
if (!isIdentifierPart$
|
|
35636
|
+
while (index$1 < length$1) {
|
|
35637
|
+
ch = source$1[index$1];
|
|
35638
|
+
if (!isIdentifierPart$1(ch.charCodeAt(0))) {
|
|
35639
35639
|
break;
|
|
35640
35640
|
}
|
|
35641
|
-
++index$
|
|
35642
|
-
if (ch === '\\' && index$
|
|
35643
|
-
throwError$
|
|
35641
|
+
++index$1;
|
|
35642
|
+
if (ch === '\\' && index$1 < length$1) {
|
|
35643
|
+
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$2);
|
|
35644
35644
|
} else {
|
|
35645
35645
|
flags += ch;
|
|
35646
35646
|
str += ch;
|
|
35647
35647
|
}
|
|
35648
35648
|
}
|
|
35649
35649
|
if (flags.search(/[^gimuy]/g) >= 0) {
|
|
35650
|
-
throwError$
|
|
35650
|
+
throwError$1({}, MessageInvalidRegExp$1, flags);
|
|
35651
35651
|
}
|
|
35652
35652
|
return {
|
|
35653
35653
|
value: flags,
|
|
35654
35654
|
literal: str
|
|
35655
35655
|
};
|
|
35656
35656
|
}
|
|
35657
|
-
function scanRegExp$
|
|
35657
|
+
function scanRegExp$1() {
|
|
35658
35658
|
var start, body, flags, value;
|
|
35659
|
-
lookahead$
|
|
35660
|
-
skipComment$
|
|
35661
|
-
start = index$
|
|
35662
|
-
body = scanRegExpBody$
|
|
35663
|
-
flags = scanRegExpFlags$
|
|
35664
|
-
value = testRegExp$
|
|
35659
|
+
lookahead$1 = null;
|
|
35660
|
+
skipComment$1();
|
|
35661
|
+
start = index$1;
|
|
35662
|
+
body = scanRegExpBody$1();
|
|
35663
|
+
flags = scanRegExpFlags$1();
|
|
35664
|
+
value = testRegExp$1(body.value, flags.value);
|
|
35665
35665
|
return {
|
|
35666
35666
|
literal: body.literal + flags.literal,
|
|
35667
35667
|
value: value,
|
|
@@ -35670,95 +35670,95 @@ function scanRegExp$2() {
|
|
|
35670
35670
|
flags: flags.value
|
|
35671
35671
|
},
|
|
35672
35672
|
start: start,
|
|
35673
|
-
end: index$
|
|
35673
|
+
end: index$1
|
|
35674
35674
|
};
|
|
35675
35675
|
}
|
|
35676
|
-
function isIdentifierName$
|
|
35677
|
-
return token.type === TokenIdentifier$
|
|
35676
|
+
function isIdentifierName$1(token) {
|
|
35677
|
+
return token.type === TokenIdentifier$1 || token.type === TokenKeyword$1 || token.type === TokenBooleanLiteral$1 || token.type === TokenNullLiteral$1;
|
|
35678
35678
|
}
|
|
35679
|
-
function advance$
|
|
35680
|
-
skipComment$
|
|
35681
|
-
if (index$
|
|
35679
|
+
function advance$1() {
|
|
35680
|
+
skipComment$1();
|
|
35681
|
+
if (index$1 >= length$1) {
|
|
35682
35682
|
return {
|
|
35683
|
-
type: TokenEOF$
|
|
35684
|
-
start: index$
|
|
35685
|
-
end: index$
|
|
35683
|
+
type: TokenEOF$1,
|
|
35684
|
+
start: index$1,
|
|
35685
|
+
end: index$1
|
|
35686
35686
|
};
|
|
35687
35687
|
}
|
|
35688
|
-
const ch = source$
|
|
35689
|
-
if (isIdentifierStart$
|
|
35690
|
-
return scanIdentifier$
|
|
35688
|
+
const ch = source$1.charCodeAt(index$1);
|
|
35689
|
+
if (isIdentifierStart$1(ch)) {
|
|
35690
|
+
return scanIdentifier$1();
|
|
35691
35691
|
}
|
|
35692
35692
|
|
|
35693
35693
|
// Very common: ( and ) and ;
|
|
35694
35694
|
if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {
|
|
35695
|
-
return scanPunctuator$
|
|
35695
|
+
return scanPunctuator$1();
|
|
35696
35696
|
}
|
|
35697
35697
|
|
|
35698
35698
|
// String literal starts with single quote (U+0027) or double quote (U+0022).
|
|
35699
35699
|
if (ch === 0x27 || ch === 0x22) {
|
|
35700
|
-
return scanStringLiteral$
|
|
35700
|
+
return scanStringLiteral$1();
|
|
35701
35701
|
}
|
|
35702
35702
|
|
|
35703
35703
|
// Dot (.) U+002E can also start a floating-point number, hence the need
|
|
35704
35704
|
// to check the next character.
|
|
35705
35705
|
if (ch === 0x2E) {
|
|
35706
|
-
if (isDecimalDigit$
|
|
35707
|
-
return scanNumericLiteral$
|
|
35706
|
+
if (isDecimalDigit$1(source$1.charCodeAt(index$1 + 1))) {
|
|
35707
|
+
return scanNumericLiteral$1();
|
|
35708
35708
|
}
|
|
35709
|
-
return scanPunctuator$
|
|
35709
|
+
return scanPunctuator$1();
|
|
35710
35710
|
}
|
|
35711
|
-
if (isDecimalDigit$
|
|
35712
|
-
return scanNumericLiteral$
|
|
35711
|
+
if (isDecimalDigit$1(ch)) {
|
|
35712
|
+
return scanNumericLiteral$1();
|
|
35713
35713
|
}
|
|
35714
|
-
return scanPunctuator$
|
|
35714
|
+
return scanPunctuator$1();
|
|
35715
35715
|
}
|
|
35716
|
-
function lex$
|
|
35717
|
-
const token = lookahead$
|
|
35718
|
-
index$
|
|
35719
|
-
lookahead$
|
|
35720
|
-
index$
|
|
35716
|
+
function lex$1() {
|
|
35717
|
+
const token = lookahead$1;
|
|
35718
|
+
index$1 = token.end;
|
|
35719
|
+
lookahead$1 = advance$1();
|
|
35720
|
+
index$1 = token.end;
|
|
35721
35721
|
return token;
|
|
35722
35722
|
}
|
|
35723
|
-
function peek$
|
|
35724
|
-
const pos = index$
|
|
35725
|
-
lookahead$
|
|
35726
|
-
index$
|
|
35723
|
+
function peek$1() {
|
|
35724
|
+
const pos = index$1;
|
|
35725
|
+
lookahead$1 = advance$1();
|
|
35726
|
+
index$1 = pos;
|
|
35727
35727
|
}
|
|
35728
|
-
function finishArrayExpression$
|
|
35729
|
-
const node = new ASTNode$
|
|
35728
|
+
function finishArrayExpression$1(elements) {
|
|
35729
|
+
const node = new ASTNode$1(SyntaxArrayExpression$1);
|
|
35730
35730
|
node.elements = elements;
|
|
35731
35731
|
return node;
|
|
35732
35732
|
}
|
|
35733
|
-
function finishBinaryExpression$
|
|
35734
|
-
const node = new ASTNode$
|
|
35733
|
+
function finishBinaryExpression$1(operator, left, right) {
|
|
35734
|
+
const node = new ASTNode$1(operator === '||' || operator === '&&' ? SyntaxLogicalExpression$1 : SyntaxBinaryExpression$1);
|
|
35735
35735
|
node.operator = operator;
|
|
35736
35736
|
node.left = left;
|
|
35737
35737
|
node.right = right;
|
|
35738
35738
|
return node;
|
|
35739
35739
|
}
|
|
35740
|
-
function finishCallExpression$
|
|
35741
|
-
const node = new ASTNode$
|
|
35740
|
+
function finishCallExpression$1(callee, args) {
|
|
35741
|
+
const node = new ASTNode$1(SyntaxCallExpression$1);
|
|
35742
35742
|
node.callee = callee;
|
|
35743
35743
|
node.arguments = args;
|
|
35744
35744
|
return node;
|
|
35745
35745
|
}
|
|
35746
|
-
function finishConditionalExpression$
|
|
35747
|
-
const node = new ASTNode$
|
|
35746
|
+
function finishConditionalExpression$1(test, consequent, alternate) {
|
|
35747
|
+
const node = new ASTNode$1(SyntaxConditionalExpression$1);
|
|
35748
35748
|
node.test = test;
|
|
35749
35749
|
node.consequent = consequent;
|
|
35750
35750
|
node.alternate = alternate;
|
|
35751
35751
|
return node;
|
|
35752
35752
|
}
|
|
35753
|
-
function finishIdentifier$
|
|
35754
|
-
const node = new ASTNode$
|
|
35753
|
+
function finishIdentifier$1(name) {
|
|
35754
|
+
const node = new ASTNode$1(SyntaxIdentifier$1);
|
|
35755
35755
|
node.name = name;
|
|
35756
35756
|
return node;
|
|
35757
35757
|
}
|
|
35758
|
-
function finishLiteral$
|
|
35759
|
-
const node = new ASTNode$
|
|
35758
|
+
function finishLiteral$1(token) {
|
|
35759
|
+
const node = new ASTNode$1(SyntaxLiteral$1);
|
|
35760
35760
|
node.value = token.value;
|
|
35761
|
-
node.raw = source$
|
|
35761
|
+
node.raw = source$1.slice(token.start, token.end);
|
|
35762
35762
|
if (token.regex) {
|
|
35763
35763
|
if (node.raw === '//') {
|
|
35764
35764
|
node.raw = '/(?:)/';
|
|
@@ -35767,28 +35767,28 @@ function finishLiteral$2(token) {
|
|
|
35767
35767
|
}
|
|
35768
35768
|
return node;
|
|
35769
35769
|
}
|
|
35770
|
-
function finishMemberExpression$
|
|
35771
|
-
const node = new ASTNode$
|
|
35770
|
+
function finishMemberExpression$1(accessor, object, property) {
|
|
35771
|
+
const node = new ASTNode$1(SyntaxMemberExpression$1);
|
|
35772
35772
|
node.computed = accessor === '[';
|
|
35773
35773
|
node.object = object;
|
|
35774
35774
|
node.property = property;
|
|
35775
35775
|
if (!node.computed) property.member = true;
|
|
35776
35776
|
return node;
|
|
35777
35777
|
}
|
|
35778
|
-
function finishObjectExpression$
|
|
35779
|
-
const node = new ASTNode$
|
|
35778
|
+
function finishObjectExpression$1(properties) {
|
|
35779
|
+
const node = new ASTNode$1(SyntaxObjectExpression$1);
|
|
35780
35780
|
node.properties = properties;
|
|
35781
35781
|
return node;
|
|
35782
35782
|
}
|
|
35783
|
-
function finishProperty$
|
|
35784
|
-
const node = new ASTNode$
|
|
35783
|
+
function finishProperty$1(kind, key, value) {
|
|
35784
|
+
const node = new ASTNode$1(SyntaxProperty$1);
|
|
35785
35785
|
node.key = key;
|
|
35786
35786
|
node.value = value;
|
|
35787
35787
|
node.kind = kind;
|
|
35788
35788
|
return node;
|
|
35789
35789
|
}
|
|
35790
|
-
function finishUnaryExpression$
|
|
35791
|
-
const node = new ASTNode$
|
|
35790
|
+
function finishUnaryExpression$1(operator, argument) {
|
|
35791
|
+
const node = new ASTNode$1(SyntaxUnaryExpression$1);
|
|
35792
35792
|
node.operator = operator;
|
|
35793
35793
|
node.argument = argument;
|
|
35794
35794
|
node.prefix = true;
|
|
@@ -35797,253 +35797,253 @@ function finishUnaryExpression$2(operator, argument) {
|
|
|
35797
35797
|
|
|
35798
35798
|
// Throw an exception
|
|
35799
35799
|
|
|
35800
|
-
function throwError$
|
|
35800
|
+
function throwError$1(token, messageFormat) {
|
|
35801
35801
|
var error,
|
|
35802
35802
|
args = Array.prototype.slice.call(arguments, 2),
|
|
35803
35803
|
msg = messageFormat.replace(/%(\d)/g, (whole, index) => {
|
|
35804
|
-
assert$
|
|
35804
|
+
assert$1(index < args.length, 'Message reference must be in range');
|
|
35805
35805
|
return args[index];
|
|
35806
35806
|
});
|
|
35807
35807
|
error = new Error(msg);
|
|
35808
|
-
error.index = index$
|
|
35808
|
+
error.index = index$1;
|
|
35809
35809
|
error.description = msg;
|
|
35810
35810
|
throw error;
|
|
35811
35811
|
}
|
|
35812
35812
|
|
|
35813
35813
|
// Throw an exception because of the token.
|
|
35814
35814
|
|
|
35815
|
-
function throwUnexpected$
|
|
35816
|
-
if (token.type === TokenEOF$
|
|
35817
|
-
throwError$
|
|
35815
|
+
function throwUnexpected$1(token) {
|
|
35816
|
+
if (token.type === TokenEOF$1) {
|
|
35817
|
+
throwError$1(token, MessageUnexpectedEOS$1);
|
|
35818
35818
|
}
|
|
35819
|
-
if (token.type === TokenNumericLiteral$
|
|
35820
|
-
throwError$
|
|
35819
|
+
if (token.type === TokenNumericLiteral$1) {
|
|
35820
|
+
throwError$1(token, MessageUnexpectedNumber$1);
|
|
35821
35821
|
}
|
|
35822
|
-
if (token.type === TokenStringLiteral$
|
|
35823
|
-
throwError$
|
|
35822
|
+
if (token.type === TokenStringLiteral$1) {
|
|
35823
|
+
throwError$1(token, MessageUnexpectedString$1);
|
|
35824
35824
|
}
|
|
35825
|
-
if (token.type === TokenIdentifier$
|
|
35826
|
-
throwError$
|
|
35825
|
+
if (token.type === TokenIdentifier$1) {
|
|
35826
|
+
throwError$1(token, MessageUnexpectedIdentifier$1);
|
|
35827
35827
|
}
|
|
35828
|
-
if (token.type === TokenKeyword$
|
|
35829
|
-
throwError$
|
|
35828
|
+
if (token.type === TokenKeyword$1) {
|
|
35829
|
+
throwError$1(token, MessageUnexpectedReserved$1);
|
|
35830
35830
|
}
|
|
35831
35831
|
|
|
35832
35832
|
// BooleanLiteral, NullLiteral, or Punctuator.
|
|
35833
|
-
throwError$
|
|
35833
|
+
throwError$1(token, MessageUnexpectedToken$1, token.value);
|
|
35834
35834
|
}
|
|
35835
35835
|
|
|
35836
35836
|
// Expect the next token to match the specified punctuator.
|
|
35837
35837
|
// If not, an exception will be thrown.
|
|
35838
35838
|
|
|
35839
|
-
function expect$
|
|
35840
|
-
const token = lex$
|
|
35841
|
-
if (token.type !== TokenPunctuator$
|
|
35842
|
-
throwUnexpected$
|
|
35839
|
+
function expect$1(value) {
|
|
35840
|
+
const token = lex$1();
|
|
35841
|
+
if (token.type !== TokenPunctuator$1 || token.value !== value) {
|
|
35842
|
+
throwUnexpected$1(token);
|
|
35843
35843
|
}
|
|
35844
35844
|
}
|
|
35845
35845
|
|
|
35846
35846
|
// Return true if the next token matches the specified punctuator.
|
|
35847
35847
|
|
|
35848
|
-
function match$
|
|
35849
|
-
return lookahead$
|
|
35848
|
+
function match$1(value) {
|
|
35849
|
+
return lookahead$1.type === TokenPunctuator$1 && lookahead$1.value === value;
|
|
35850
35850
|
}
|
|
35851
35851
|
|
|
35852
35852
|
// Return true if the next token matches the specified keyword
|
|
35853
35853
|
|
|
35854
|
-
function matchKeyword$
|
|
35855
|
-
return lookahead$
|
|
35854
|
+
function matchKeyword$1(keyword) {
|
|
35855
|
+
return lookahead$1.type === TokenKeyword$1 && lookahead$1.value === keyword;
|
|
35856
35856
|
}
|
|
35857
35857
|
|
|
35858
35858
|
// 11.1.4 Array Initialiser
|
|
35859
35859
|
|
|
35860
|
-
function parseArrayInitialiser$
|
|
35860
|
+
function parseArrayInitialiser$1() {
|
|
35861
35861
|
const elements = [];
|
|
35862
|
-
index$
|
|
35863
|
-
expect$
|
|
35864
|
-
while (!match$
|
|
35865
|
-
if (match$
|
|
35866
|
-
lex$
|
|
35862
|
+
index$1 = lookahead$1.start;
|
|
35863
|
+
expect$1('[');
|
|
35864
|
+
while (!match$1(']')) {
|
|
35865
|
+
if (match$1(',')) {
|
|
35866
|
+
lex$1();
|
|
35867
35867
|
elements.push(null);
|
|
35868
35868
|
} else {
|
|
35869
|
-
elements.push(parseConditionalExpression$
|
|
35870
|
-
if (!match$
|
|
35871
|
-
expect$
|
|
35869
|
+
elements.push(parseConditionalExpression$1());
|
|
35870
|
+
if (!match$1(']')) {
|
|
35871
|
+
expect$1(',');
|
|
35872
35872
|
}
|
|
35873
35873
|
}
|
|
35874
35874
|
}
|
|
35875
|
-
lex$
|
|
35876
|
-
return finishArrayExpression$
|
|
35875
|
+
lex$1();
|
|
35876
|
+
return finishArrayExpression$1(elements);
|
|
35877
35877
|
}
|
|
35878
35878
|
|
|
35879
35879
|
// 11.1.5 Object Initialiser
|
|
35880
35880
|
|
|
35881
|
-
function parseObjectPropertyKey$
|
|
35882
|
-
index$
|
|
35883
|
-
const token = lex$
|
|
35881
|
+
function parseObjectPropertyKey$1() {
|
|
35882
|
+
index$1 = lookahead$1.start;
|
|
35883
|
+
const token = lex$1();
|
|
35884
35884
|
|
|
35885
35885
|
// Note: This function is called only from parseObjectProperty(), where
|
|
35886
35886
|
// EOF and Punctuator tokens are already filtered out.
|
|
35887
35887
|
|
|
35888
|
-
if (token.type === TokenStringLiteral$
|
|
35888
|
+
if (token.type === TokenStringLiteral$1 || token.type === TokenNumericLiteral$1) {
|
|
35889
35889
|
if (token.octal) {
|
|
35890
|
-
throwError$
|
|
35890
|
+
throwError$1(token, MessageStrictOctalLiteral$1);
|
|
35891
35891
|
}
|
|
35892
|
-
return finishLiteral$
|
|
35892
|
+
return finishLiteral$1(token);
|
|
35893
35893
|
}
|
|
35894
|
-
return finishIdentifier$
|
|
35894
|
+
return finishIdentifier$1(token.value);
|
|
35895
35895
|
}
|
|
35896
|
-
function parseObjectProperty$
|
|
35896
|
+
function parseObjectProperty$1() {
|
|
35897
35897
|
var token, key, id, value;
|
|
35898
|
-
index$
|
|
35899
|
-
token = lookahead$
|
|
35900
|
-
if (token.type === TokenIdentifier$
|
|
35901
|
-
id = parseObjectPropertyKey$
|
|
35902
|
-
expect$
|
|
35903
|
-
value = parseConditionalExpression$
|
|
35904
|
-
return finishProperty$
|
|
35905
|
-
}
|
|
35906
|
-
if (token.type === TokenEOF$
|
|
35907
|
-
throwUnexpected$
|
|
35898
|
+
index$1 = lookahead$1.start;
|
|
35899
|
+
token = lookahead$1;
|
|
35900
|
+
if (token.type === TokenIdentifier$1) {
|
|
35901
|
+
id = parseObjectPropertyKey$1();
|
|
35902
|
+
expect$1(':');
|
|
35903
|
+
value = parseConditionalExpression$1();
|
|
35904
|
+
return finishProperty$1('init', id, value);
|
|
35905
|
+
}
|
|
35906
|
+
if (token.type === TokenEOF$1 || token.type === TokenPunctuator$1) {
|
|
35907
|
+
throwUnexpected$1(token);
|
|
35908
35908
|
} else {
|
|
35909
|
-
key = parseObjectPropertyKey$
|
|
35910
|
-
expect$
|
|
35911
|
-
value = parseConditionalExpression$
|
|
35912
|
-
return finishProperty$
|
|
35909
|
+
key = parseObjectPropertyKey$1();
|
|
35910
|
+
expect$1(':');
|
|
35911
|
+
value = parseConditionalExpression$1();
|
|
35912
|
+
return finishProperty$1('init', key, value);
|
|
35913
35913
|
}
|
|
35914
35914
|
}
|
|
35915
|
-
function parseObjectInitialiser$
|
|
35915
|
+
function parseObjectInitialiser$1() {
|
|
35916
35916
|
var properties = [],
|
|
35917
35917
|
property,
|
|
35918
35918
|
name,
|
|
35919
35919
|
key,
|
|
35920
35920
|
map = {},
|
|
35921
35921
|
toString = String;
|
|
35922
|
-
index$
|
|
35923
|
-
expect$
|
|
35924
|
-
while (!match$
|
|
35925
|
-
property = parseObjectProperty$
|
|
35926
|
-
if (property.key.type === SyntaxIdentifier$
|
|
35922
|
+
index$1 = lookahead$1.start;
|
|
35923
|
+
expect$1('{');
|
|
35924
|
+
while (!match$1('}')) {
|
|
35925
|
+
property = parseObjectProperty$1();
|
|
35926
|
+
if (property.key.type === SyntaxIdentifier$1) {
|
|
35927
35927
|
name = property.key.name;
|
|
35928
35928
|
} else {
|
|
35929
35929
|
name = toString(property.key.value);
|
|
35930
35930
|
}
|
|
35931
35931
|
key = '$' + name;
|
|
35932
35932
|
if (Object.prototype.hasOwnProperty.call(map, key)) {
|
|
35933
|
-
throwError$
|
|
35933
|
+
throwError$1({}, MessageStrictDuplicateProperty$1);
|
|
35934
35934
|
} else {
|
|
35935
35935
|
map[key] = true;
|
|
35936
35936
|
}
|
|
35937
35937
|
properties.push(property);
|
|
35938
|
-
if (!match$
|
|
35939
|
-
expect$
|
|
35938
|
+
if (!match$1('}')) {
|
|
35939
|
+
expect$1(',');
|
|
35940
35940
|
}
|
|
35941
35941
|
}
|
|
35942
|
-
expect$
|
|
35943
|
-
return finishObjectExpression$
|
|
35942
|
+
expect$1('}');
|
|
35943
|
+
return finishObjectExpression$1(properties);
|
|
35944
35944
|
}
|
|
35945
35945
|
|
|
35946
35946
|
// 11.1.6 The Grouping Operator
|
|
35947
35947
|
|
|
35948
|
-
function parseGroupExpression$
|
|
35949
|
-
expect$
|
|
35950
|
-
const expr = parseExpression$
|
|
35951
|
-
expect$
|
|
35948
|
+
function parseGroupExpression$1() {
|
|
35949
|
+
expect$1('(');
|
|
35950
|
+
const expr = parseExpression$2();
|
|
35951
|
+
expect$1(')');
|
|
35952
35952
|
return expr;
|
|
35953
35953
|
}
|
|
35954
35954
|
|
|
35955
35955
|
// 11.1 Primary Expressions
|
|
35956
35956
|
|
|
35957
|
-
const legalKeywords$
|
|
35957
|
+
const legalKeywords$1 = {
|
|
35958
35958
|
'if': 1
|
|
35959
35959
|
};
|
|
35960
|
-
function parsePrimaryExpression$
|
|
35960
|
+
function parsePrimaryExpression$1() {
|
|
35961
35961
|
var type, token, expr;
|
|
35962
|
-
if (match$
|
|
35963
|
-
return parseGroupExpression$
|
|
35964
|
-
}
|
|
35965
|
-
if (match$
|
|
35966
|
-
return parseArrayInitialiser$
|
|
35967
|
-
}
|
|
35968
|
-
if (match$
|
|
35969
|
-
return parseObjectInitialiser$
|
|
35970
|
-
}
|
|
35971
|
-
type = lookahead$
|
|
35972
|
-
index$
|
|
35973
|
-
if (type === TokenIdentifier$
|
|
35974
|
-
expr = finishIdentifier$
|
|
35975
|
-
} else if (type === TokenStringLiteral$
|
|
35976
|
-
if (lookahead$
|
|
35977
|
-
throwError$
|
|
35978
|
-
}
|
|
35979
|
-
expr = finishLiteral$
|
|
35980
|
-
} else if (type === TokenKeyword$
|
|
35981
|
-
throw new Error(DISABLED$
|
|
35982
|
-
} else if (type === TokenBooleanLiteral$
|
|
35983
|
-
token = lex$
|
|
35962
|
+
if (match$1('(')) {
|
|
35963
|
+
return parseGroupExpression$1();
|
|
35964
|
+
}
|
|
35965
|
+
if (match$1('[')) {
|
|
35966
|
+
return parseArrayInitialiser$1();
|
|
35967
|
+
}
|
|
35968
|
+
if (match$1('{')) {
|
|
35969
|
+
return parseObjectInitialiser$1();
|
|
35970
|
+
}
|
|
35971
|
+
type = lookahead$1.type;
|
|
35972
|
+
index$1 = lookahead$1.start;
|
|
35973
|
+
if (type === TokenIdentifier$1 || legalKeywords$1[lookahead$1.value]) {
|
|
35974
|
+
expr = finishIdentifier$1(lex$1().value);
|
|
35975
|
+
} else if (type === TokenStringLiteral$1 || type === TokenNumericLiteral$1) {
|
|
35976
|
+
if (lookahead$1.octal) {
|
|
35977
|
+
throwError$1(lookahead$1, MessageStrictOctalLiteral$1);
|
|
35978
|
+
}
|
|
35979
|
+
expr = finishLiteral$1(lex$1());
|
|
35980
|
+
} else if (type === TokenKeyword$1) {
|
|
35981
|
+
throw new Error(DISABLED$1);
|
|
35982
|
+
} else if (type === TokenBooleanLiteral$1) {
|
|
35983
|
+
token = lex$1();
|
|
35984
35984
|
token.value = token.value === 'true';
|
|
35985
|
-
expr = finishLiteral$
|
|
35986
|
-
} else if (type === TokenNullLiteral$
|
|
35987
|
-
token = lex$
|
|
35985
|
+
expr = finishLiteral$1(token);
|
|
35986
|
+
} else if (type === TokenNullLiteral$1) {
|
|
35987
|
+
token = lex$1();
|
|
35988
35988
|
token.value = null;
|
|
35989
|
-
expr = finishLiteral$
|
|
35990
|
-
} else if (match$
|
|
35991
|
-
expr = finishLiteral$
|
|
35992
|
-
peek$
|
|
35989
|
+
expr = finishLiteral$1(token);
|
|
35990
|
+
} else if (match$1('/') || match$1('/=')) {
|
|
35991
|
+
expr = finishLiteral$1(scanRegExp$1());
|
|
35992
|
+
peek$1();
|
|
35993
35993
|
} else {
|
|
35994
|
-
throwUnexpected$
|
|
35994
|
+
throwUnexpected$1(lex$1());
|
|
35995
35995
|
}
|
|
35996
35996
|
return expr;
|
|
35997
35997
|
}
|
|
35998
35998
|
|
|
35999
35999
|
// 11.2 Left-Hand-Side Expressions
|
|
36000
36000
|
|
|
36001
|
-
function parseArguments$
|
|
36001
|
+
function parseArguments$1() {
|
|
36002
36002
|
const args = [];
|
|
36003
|
-
expect$
|
|
36004
|
-
if (!match$
|
|
36005
|
-
while (index$
|
|
36006
|
-
args.push(parseConditionalExpression$
|
|
36007
|
-
if (match$
|
|
36003
|
+
expect$1('(');
|
|
36004
|
+
if (!match$1(')')) {
|
|
36005
|
+
while (index$1 < length$1) {
|
|
36006
|
+
args.push(parseConditionalExpression$1());
|
|
36007
|
+
if (match$1(')')) {
|
|
36008
36008
|
break;
|
|
36009
36009
|
}
|
|
36010
|
-
expect$
|
|
36010
|
+
expect$1(',');
|
|
36011
36011
|
}
|
|
36012
36012
|
}
|
|
36013
|
-
expect$
|
|
36013
|
+
expect$1(')');
|
|
36014
36014
|
return args;
|
|
36015
36015
|
}
|
|
36016
|
-
function parseNonComputedProperty$
|
|
36017
|
-
index$
|
|
36018
|
-
const token = lex$
|
|
36019
|
-
if (!isIdentifierName$
|
|
36020
|
-
throwUnexpected$
|
|
36016
|
+
function parseNonComputedProperty$1() {
|
|
36017
|
+
index$1 = lookahead$1.start;
|
|
36018
|
+
const token = lex$1();
|
|
36019
|
+
if (!isIdentifierName$1(token)) {
|
|
36020
|
+
throwUnexpected$1(token);
|
|
36021
36021
|
}
|
|
36022
|
-
return finishIdentifier$
|
|
36022
|
+
return finishIdentifier$1(token.value);
|
|
36023
36023
|
}
|
|
36024
|
-
function parseNonComputedMember$
|
|
36025
|
-
expect$
|
|
36026
|
-
return parseNonComputedProperty$
|
|
36024
|
+
function parseNonComputedMember$1() {
|
|
36025
|
+
expect$1('.');
|
|
36026
|
+
return parseNonComputedProperty$1();
|
|
36027
36027
|
}
|
|
36028
|
-
function parseComputedMember$
|
|
36029
|
-
expect$
|
|
36030
|
-
const expr = parseExpression$
|
|
36031
|
-
expect$
|
|
36028
|
+
function parseComputedMember$1() {
|
|
36029
|
+
expect$1('[');
|
|
36030
|
+
const expr = parseExpression$2();
|
|
36031
|
+
expect$1(']');
|
|
36032
36032
|
return expr;
|
|
36033
36033
|
}
|
|
36034
|
-
function parseLeftHandSideExpressionAllowCall$
|
|
36034
|
+
function parseLeftHandSideExpressionAllowCall$1() {
|
|
36035
36035
|
var expr, args, property;
|
|
36036
|
-
expr = parsePrimaryExpression$
|
|
36036
|
+
expr = parsePrimaryExpression$1();
|
|
36037
36037
|
for (;;) {
|
|
36038
|
-
if (match$
|
|
36039
|
-
property = parseNonComputedMember$
|
|
36040
|
-
expr = finishMemberExpression$
|
|
36041
|
-
} else if (match$
|
|
36042
|
-
args = parseArguments$
|
|
36043
|
-
expr = finishCallExpression$
|
|
36044
|
-
} else if (match$
|
|
36045
|
-
property = parseComputedMember$
|
|
36046
|
-
expr = finishMemberExpression$
|
|
36038
|
+
if (match$1('.')) {
|
|
36039
|
+
property = parseNonComputedMember$1();
|
|
36040
|
+
expr = finishMemberExpression$1('.', expr, property);
|
|
36041
|
+
} else if (match$1('(')) {
|
|
36042
|
+
args = parseArguments$1();
|
|
36043
|
+
expr = finishCallExpression$1(expr, args);
|
|
36044
|
+
} else if (match$1('[')) {
|
|
36045
|
+
property = parseComputedMember$1();
|
|
36046
|
+
expr = finishMemberExpression$1('[', expr, property);
|
|
36047
36047
|
} else {
|
|
36048
36048
|
break;
|
|
36049
36049
|
}
|
|
@@ -36053,11 +36053,11 @@ function parseLeftHandSideExpressionAllowCall$2() {
|
|
|
36053
36053
|
|
|
36054
36054
|
// 11.3 Postfix Expressions
|
|
36055
36055
|
|
|
36056
|
-
function parsePostfixExpression$
|
|
36057
|
-
const expr = parseLeftHandSideExpressionAllowCall$
|
|
36058
|
-
if (lookahead$
|
|
36059
|
-
if (match$
|
|
36060
|
-
throw new Error(DISABLED$
|
|
36056
|
+
function parsePostfixExpression$1() {
|
|
36057
|
+
const expr = parseLeftHandSideExpressionAllowCall$1();
|
|
36058
|
+
if (lookahead$1.type === TokenPunctuator$1) {
|
|
36059
|
+
if (match$1('++') || match$1('--')) {
|
|
36060
|
+
throw new Error(DISABLED$1);
|
|
36061
36061
|
}
|
|
36062
36062
|
}
|
|
36063
36063
|
return expr;
|
|
@@ -36065,26 +36065,26 @@ function parsePostfixExpression$2() {
|
|
|
36065
36065
|
|
|
36066
36066
|
// 11.4 Unary Operators
|
|
36067
36067
|
|
|
36068
|
-
function parseUnaryExpression$
|
|
36068
|
+
function parseUnaryExpression$1() {
|
|
36069
36069
|
var token, expr;
|
|
36070
|
-
if (lookahead$
|
|
36071
|
-
expr = parsePostfixExpression$
|
|
36072
|
-
} else if (match$
|
|
36073
|
-
throw new Error(DISABLED$
|
|
36074
|
-
} else if (match$
|
|
36075
|
-
token = lex$
|
|
36076
|
-
expr = parseUnaryExpression$
|
|
36077
|
-
expr = finishUnaryExpression$
|
|
36078
|
-
} else if (matchKeyword$
|
|
36079
|
-
throw new Error(DISABLED$
|
|
36070
|
+
if (lookahead$1.type !== TokenPunctuator$1 && lookahead$1.type !== TokenKeyword$1) {
|
|
36071
|
+
expr = parsePostfixExpression$1();
|
|
36072
|
+
} else if (match$1('++') || match$1('--')) {
|
|
36073
|
+
throw new Error(DISABLED$1);
|
|
36074
|
+
} else if (match$1('+') || match$1('-') || match$1('~') || match$1('!')) {
|
|
36075
|
+
token = lex$1();
|
|
36076
|
+
expr = parseUnaryExpression$1();
|
|
36077
|
+
expr = finishUnaryExpression$1(token.value, expr);
|
|
36078
|
+
} else if (matchKeyword$1('delete') || matchKeyword$1('void') || matchKeyword$1('typeof')) {
|
|
36079
|
+
throw new Error(DISABLED$1);
|
|
36080
36080
|
} else {
|
|
36081
|
-
expr = parsePostfixExpression$
|
|
36081
|
+
expr = parsePostfixExpression$1();
|
|
36082
36082
|
}
|
|
36083
36083
|
return expr;
|
|
36084
36084
|
}
|
|
36085
|
-
function binaryPrecedence$
|
|
36085
|
+
function binaryPrecedence$1(token) {
|
|
36086
36086
|
let prec = 0;
|
|
36087
|
-
if (token.type !== TokenPunctuator$
|
|
36087
|
+
if (token.type !== TokenPunctuator$1 && token.type !== TokenKeyword$1) {
|
|
36088
36088
|
return 0;
|
|
36089
36089
|
}
|
|
36090
36090
|
switch (token.value) {
|
|
@@ -36143,37 +36143,37 @@ function binaryPrecedence$2(token) {
|
|
|
36143
36143
|
// 11.10 Binary Bitwise Operators
|
|
36144
36144
|
// 11.11 Binary Logical Operators
|
|
36145
36145
|
|
|
36146
|
-
function parseBinaryExpression$
|
|
36146
|
+
function parseBinaryExpression$1() {
|
|
36147
36147
|
var marker, markers, expr, token, prec, stack, right, operator, left, i;
|
|
36148
|
-
marker = lookahead$
|
|
36149
|
-
left = parseUnaryExpression$
|
|
36150
|
-
token = lookahead$
|
|
36151
|
-
prec = binaryPrecedence$
|
|
36148
|
+
marker = lookahead$1;
|
|
36149
|
+
left = parseUnaryExpression$1();
|
|
36150
|
+
token = lookahead$1;
|
|
36151
|
+
prec = binaryPrecedence$1(token);
|
|
36152
36152
|
if (prec === 0) {
|
|
36153
36153
|
return left;
|
|
36154
36154
|
}
|
|
36155
36155
|
token.prec = prec;
|
|
36156
|
-
lex$
|
|
36157
|
-
markers = [marker, lookahead$
|
|
36158
|
-
right = parseUnaryExpression$
|
|
36156
|
+
lex$1();
|
|
36157
|
+
markers = [marker, lookahead$1];
|
|
36158
|
+
right = parseUnaryExpression$1();
|
|
36159
36159
|
stack = [left, token, right];
|
|
36160
|
-
while ((prec = binaryPrecedence$
|
|
36160
|
+
while ((prec = binaryPrecedence$1(lookahead$1)) > 0) {
|
|
36161
36161
|
// Reduce: make a binary expression from the three topmost entries.
|
|
36162
36162
|
while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {
|
|
36163
36163
|
right = stack.pop();
|
|
36164
36164
|
operator = stack.pop().value;
|
|
36165
36165
|
left = stack.pop();
|
|
36166
36166
|
markers.pop();
|
|
36167
|
-
expr = finishBinaryExpression$
|
|
36167
|
+
expr = finishBinaryExpression$1(operator, left, right);
|
|
36168
36168
|
stack.push(expr);
|
|
36169
36169
|
}
|
|
36170
36170
|
|
|
36171
36171
|
// Shift.
|
|
36172
|
-
token = lex$
|
|
36172
|
+
token = lex$1();
|
|
36173
36173
|
token.prec = prec;
|
|
36174
36174
|
stack.push(token);
|
|
36175
|
-
markers.push(lookahead$
|
|
36176
|
-
expr = parseUnaryExpression$
|
|
36175
|
+
markers.push(lookahead$1);
|
|
36176
|
+
expr = parseUnaryExpression$1();
|
|
36177
36177
|
stack.push(expr);
|
|
36178
36178
|
}
|
|
36179
36179
|
|
|
@@ -36183,7 +36183,7 @@ function parseBinaryExpression$2() {
|
|
|
36183
36183
|
markers.pop();
|
|
36184
36184
|
while (i > 1) {
|
|
36185
36185
|
markers.pop();
|
|
36186
|
-
expr = finishBinaryExpression$
|
|
36186
|
+
expr = finishBinaryExpression$1(stack[i - 1].value, stack[i - 2], expr);
|
|
36187
36187
|
i -= 2;
|
|
36188
36188
|
}
|
|
36189
36189
|
return expr;
|
|
@@ -36191,42 +36191,42 @@ function parseBinaryExpression$2() {
|
|
|
36191
36191
|
|
|
36192
36192
|
// 11.12 Conditional Operator
|
|
36193
36193
|
|
|
36194
|
-
function parseConditionalExpression$
|
|
36194
|
+
function parseConditionalExpression$1() {
|
|
36195
36195
|
var expr, consequent, alternate;
|
|
36196
|
-
expr = parseBinaryExpression$
|
|
36197
|
-
if (match$
|
|
36198
|
-
lex$
|
|
36199
|
-
consequent = parseConditionalExpression$
|
|
36200
|
-
expect$
|
|
36201
|
-
alternate = parseConditionalExpression$
|
|
36202
|
-
expr = finishConditionalExpression$
|
|
36196
|
+
expr = parseBinaryExpression$1();
|
|
36197
|
+
if (match$1('?')) {
|
|
36198
|
+
lex$1();
|
|
36199
|
+
consequent = parseConditionalExpression$1();
|
|
36200
|
+
expect$1(':');
|
|
36201
|
+
alternate = parseConditionalExpression$1();
|
|
36202
|
+
expr = finishConditionalExpression$1(expr, consequent, alternate);
|
|
36203
36203
|
}
|
|
36204
36204
|
return expr;
|
|
36205
36205
|
}
|
|
36206
36206
|
|
|
36207
36207
|
// 11.14 Comma Operator
|
|
36208
36208
|
|
|
36209
|
-
function parseExpression$
|
|
36210
|
-
const expr = parseConditionalExpression$
|
|
36211
|
-
if (match$
|
|
36212
|
-
throw new Error(DISABLED$
|
|
36209
|
+
function parseExpression$2() {
|
|
36210
|
+
const expr = parseConditionalExpression$1();
|
|
36211
|
+
if (match$1(',')) {
|
|
36212
|
+
throw new Error(DISABLED$1); // no sequence expressions
|
|
36213
36213
|
}
|
|
36214
36214
|
return expr;
|
|
36215
36215
|
}
|
|
36216
|
-
function parser$
|
|
36217
|
-
source$
|
|
36218
|
-
index$
|
|
36219
|
-
length$
|
|
36220
|
-
lookahead$
|
|
36221
|
-
peek$
|
|
36222
|
-
const expr = parseExpression$
|
|
36223
|
-
if (lookahead$
|
|
36216
|
+
function parser$3 (code) {
|
|
36217
|
+
source$1 = code;
|
|
36218
|
+
index$1 = 0;
|
|
36219
|
+
length$1 = source$1.length;
|
|
36220
|
+
lookahead$1 = null;
|
|
36221
|
+
peek$1();
|
|
36222
|
+
const expr = parseExpression$2();
|
|
36223
|
+
if (lookahead$1.type !== TokenEOF$1) {
|
|
36224
36224
|
throw new Error('Unexpect token after expression.');
|
|
36225
36225
|
}
|
|
36226
36226
|
return expr;
|
|
36227
36227
|
}
|
|
36228
36228
|
|
|
36229
|
-
var Constants$
|
|
36229
|
+
var Constants$1 = {
|
|
36230
36230
|
NaN: 'NaN',
|
|
36231
36231
|
E: 'Math.E',
|
|
36232
36232
|
LN2: 'Math.LN2',
|
|
@@ -36240,7 +36240,7 @@ var Constants$2 = {
|
|
|
36240
36240
|
MAX_VALUE: 'Number.MAX_VALUE'
|
|
36241
36241
|
};
|
|
36242
36242
|
|
|
36243
|
-
function Functions$
|
|
36243
|
+
function Functions$1 (codegen) {
|
|
36244
36244
|
function fncall(name, args, cast, type) {
|
|
36245
36245
|
let obj = codegen(args[0]);
|
|
36246
36246
|
if (cast) {
|
|
@@ -36334,16 +36334,16 @@ function Functions$2 (codegen) {
|
|
|
36334
36334
|
};
|
|
36335
36335
|
}
|
|
36336
36336
|
|
|
36337
|
-
function stripQuotes
|
|
36337
|
+
function stripQuotes(s) {
|
|
36338
36338
|
const n = s && s.length - 1;
|
|
36339
36339
|
return n && (s[0] === '"' && s[n] === '"' || s[0] === '\'' && s[n] === '\'') ? s.slice(1, -1) : s;
|
|
36340
36340
|
}
|
|
36341
|
-
function codegen
|
|
36341
|
+
function codegen (opt) {
|
|
36342
36342
|
opt = opt || {};
|
|
36343
36343
|
const allowed = opt.allowed ? toSet(opt.allowed) : {},
|
|
36344
36344
|
forbidden = opt.forbidden ? toSet(opt.forbidden) : {},
|
|
36345
|
-
constants = opt.constants || Constants$
|
|
36346
|
-
functions = (opt.functions || Functions$
|
|
36345
|
+
constants = opt.constants || Constants$1,
|
|
36346
|
+
functions = (opt.functions || Functions$1)(visit),
|
|
36347
36347
|
globalvar = opt.globalvar,
|
|
36348
36348
|
fieldvar = opt.fieldvar,
|
|
36349
36349
|
outputGlobal = isFunction(globalvar) ? globalvar : id => `${globalvar}["${id}"]`;
|
|
@@ -36380,7 +36380,7 @@ function codegen$1 (opt) {
|
|
|
36380
36380
|
const p = visit(n.property);
|
|
36381
36381
|
if (o === fieldvar) {
|
|
36382
36382
|
// strip quotes to sanitize field name (#1653)
|
|
36383
|
-
fields[stripQuotes
|
|
36383
|
+
fields[stripQuotes(p)] = 1;
|
|
36384
36384
|
}
|
|
36385
36385
|
if (d) memberDepth -= 1;
|
|
36386
36386
|
return o + (d ? '.' + p : '[' + p + ']');
|
|
@@ -36432,64 +36432,6 @@ function codegen$1 (opt) {
|
|
|
36432
36432
|
return codegen;
|
|
36433
36433
|
}
|
|
36434
36434
|
|
|
36435
|
-
const Literal$2 = 'Literal';
|
|
36436
|
-
|
|
36437
|
-
/*
|
|
36438
|
-
The following expression parser is based on Esprima (http://esprima.org/).
|
|
36439
|
-
Original header comment and license for Esprima is included here:
|
|
36440
|
-
|
|
36441
|
-
Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
|
|
36442
|
-
Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
|
|
36443
|
-
Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>
|
|
36444
|
-
Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
|
|
36445
|
-
Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
|
|
36446
|
-
Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
|
|
36447
|
-
Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>
|
|
36448
|
-
Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
|
|
36449
|
-
Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>
|
|
36450
|
-
Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
|
|
36451
|
-
|
|
36452
|
-
Redistribution and use in source and binary forms, with or without
|
|
36453
|
-
modification, are permitted provided that the following conditions are met:
|
|
36454
|
-
|
|
36455
|
-
* Redistributions of source code must retain the above copyright
|
|
36456
|
-
notice, this list of conditions and the following disclaimer.
|
|
36457
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
36458
|
-
notice, this list of conditions and the following disclaimer in the
|
|
36459
|
-
documentation and/or other materials provided with the distribution.
|
|
36460
|
-
|
|
36461
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
36462
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
36463
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
36464
|
-
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
36465
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
36466
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
36467
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
36468
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
36469
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
36470
|
-
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
36471
|
-
*/
|
|
36472
|
-
var TokenName$2;
|
|
36473
|
-
var TokenBooleanLiteral$2 = 1,
|
|
36474
|
-
TokenEOF$2 = 2,
|
|
36475
|
-
TokenIdentifier$2 = 3,
|
|
36476
|
-
TokenKeyword$2 = 4,
|
|
36477
|
-
TokenNullLiteral$2 = 5,
|
|
36478
|
-
TokenNumericLiteral$2 = 6,
|
|
36479
|
-
TokenPunctuator$2 = 7,
|
|
36480
|
-
TokenStringLiteral$2 = 8,
|
|
36481
|
-
TokenRegularExpression$2 = 9;
|
|
36482
|
-
TokenName$2 = {};
|
|
36483
|
-
TokenName$2[TokenBooleanLiteral$2] = 'Boolean';
|
|
36484
|
-
TokenName$2[TokenEOF$2] = '<end>';
|
|
36485
|
-
TokenName$2[TokenIdentifier$2] = 'Identifier';
|
|
36486
|
-
TokenName$2[TokenKeyword$2] = 'Keyword';
|
|
36487
|
-
TokenName$2[TokenNullLiteral$2] = 'Null';
|
|
36488
|
-
TokenName$2[TokenNumericLiteral$2] = 'Numeric';
|
|
36489
|
-
TokenName$2[TokenPunctuator$2] = 'Punctuator';
|
|
36490
|
-
TokenName$2[TokenStringLiteral$2] = 'String';
|
|
36491
|
-
TokenName$2[TokenRegularExpression$2] = 'RegularExpression';
|
|
36492
|
-
|
|
36493
36435
|
// Registers vega-util field accessors to protect against XSS attacks
|
|
36494
36436
|
const SELECTION_GETTER = Symbol('vega_selection_getter');
|
|
36495
36437
|
function getter(f) {
|
|
@@ -36811,9 +36753,9 @@ var ops = {
|
|
|
36811
36753
|
const DataPrefix$1 = ':',
|
|
36812
36754
|
IndexPrefix$1 = '@';
|
|
36813
36755
|
function selectionVisitor(name, args, scope, params) {
|
|
36814
|
-
if (args[0].type !== Literal$
|
|
36756
|
+
if (args[0].type !== Literal$1) error$1('First argument to selection functions must be a string literal.');
|
|
36815
36757
|
const data = args[0].value,
|
|
36816
|
-
op = args.length >= 2 && peek$
|
|
36758
|
+
op = args.length >= 2 && peek$2(args).value,
|
|
36817
36759
|
field = 'unit',
|
|
36818
36760
|
indexName = IndexPrefix$1 + field,
|
|
36819
36761
|
dataName = DataPrefix$1 + data;
|
|
@@ -36919,7 +36861,7 @@ function interpolateLinear(values, frac) {
|
|
|
36919
36861
|
lo = values[0],
|
|
36920
36862
|
f = +frac;
|
|
36921
36863
|
if (n === 1 || !(f > 0)) return lo;
|
|
36922
|
-
if (f >= 1) return peek$
|
|
36864
|
+
if (f >= 1) return peek$2(values);
|
|
36923
36865
|
const pos = f * (n - 1),
|
|
36924
36866
|
i = Math.floor(pos),
|
|
36925
36867
|
t = pos - i;
|
|
@@ -36962,7 +36904,7 @@ const ScalePrefix = '%';
|
|
|
36962
36904
|
const SignalPrefix = '$';
|
|
36963
36905
|
|
|
36964
36906
|
function dataVisitor(name, args, scope, params) {
|
|
36965
|
-
if (args[0].type !== Literal$
|
|
36907
|
+
if (args[0].type !== Literal$1) {
|
|
36966
36908
|
error$1('First argument to data functions must be a string literal.');
|
|
36967
36909
|
}
|
|
36968
36910
|
const data = args[0].value,
|
|
@@ -36976,8 +36918,8 @@ function dataVisitor(name, args, scope, params) {
|
|
|
36976
36918
|
}
|
|
36977
36919
|
}
|
|
36978
36920
|
function indataVisitor(name, args, scope, params) {
|
|
36979
|
-
if (args[0].type !== Literal$
|
|
36980
|
-
if (args[1].type !== Literal$
|
|
36921
|
+
if (args[0].type !== Literal$1) error$1('First argument to indata must be a string literal.');
|
|
36922
|
+
if (args[1].type !== Literal$1) error$1('Second argument to indata must be a string literal.');
|
|
36981
36923
|
const data = args[0].value,
|
|
36982
36924
|
field = args[1].value,
|
|
36983
36925
|
indexName = IndexPrefix + field;
|
|
@@ -36986,7 +36928,7 @@ function indataVisitor(name, args, scope, params) {
|
|
|
36986
36928
|
}
|
|
36987
36929
|
}
|
|
36988
36930
|
function scaleVisitor(name, args, scope, params) {
|
|
36989
|
-
if (args[0].type === Literal$
|
|
36931
|
+
if (args[0].type === Literal$1) {
|
|
36990
36932
|
// add scale dependency
|
|
36991
36933
|
addScaleDependency(scope, params, args[0].value);
|
|
36992
36934
|
} else {
|
|
@@ -37030,7 +36972,7 @@ function internalScaleFunctions(codegen, fnctx, visitors) {
|
|
|
37030
36972
|
visitors._scale = scaleVisitor;
|
|
37031
36973
|
|
|
37032
36974
|
// resolve scale reference directly to the signal hash argument
|
|
37033
|
-
const ref = arg => '_[' + (arg.type === Literal$
|
|
36975
|
+
const ref = arg => '_[' + (arg.type === Literal$1 ? stringValue(ScalePrefix + arg.value) : stringValue(ScalePrefix) + '+' + codegen(arg)) + ']';
|
|
37034
36976
|
|
|
37035
36977
|
// define and return internal scale function code generators
|
|
37036
36978
|
// these internal functions are called by mark encoders
|
|
@@ -37282,7 +37224,7 @@ function scaleGradient (scale, p0, p1, count, group) {
|
|
|
37282
37224
|
const gradient = Gradient$1(p0, p1);
|
|
37283
37225
|
let stops = scale.domain(),
|
|
37284
37226
|
min = stops[0],
|
|
37285
|
-
max = peek$
|
|
37227
|
+
max = peek$2(stops),
|
|
37286
37228
|
fraction = identity$7;
|
|
37287
37229
|
if (!(max - min)) {
|
|
37288
37230
|
// expand scale if domain has zero span, fix #1479
|
|
@@ -37293,7 +37235,7 @@ function scaleGradient (scale, p0, p1, count, group) {
|
|
|
37293
37235
|
if (scale.ticks) {
|
|
37294
37236
|
stops = scale.ticks(+count || 15);
|
|
37295
37237
|
if (min !== stops[0]) stops.unshift(min);
|
|
37296
|
-
if (max !== peek$
|
|
37238
|
+
if (max !== peek$2(stops)) stops.push(max);
|
|
37297
37239
|
}
|
|
37298
37240
|
stops.forEach(_ => gradient.stop(fraction(_), scale(_)));
|
|
37299
37241
|
return gradient;
|
|
@@ -37499,7 +37441,7 @@ const functionContext = {
|
|
|
37499
37441
|
interpolateLinear,
|
|
37500
37442
|
merge,
|
|
37501
37443
|
pad: pad$2,
|
|
37502
|
-
peek: peek$
|
|
37444
|
+
peek: peek$2,
|
|
37503
37445
|
pluck,
|
|
37504
37446
|
span,
|
|
37505
37447
|
inrange,
|
|
@@ -37581,16 +37523,16 @@ const codegenParams = {
|
|
|
37581
37523
|
fieldvar: 'datum',
|
|
37582
37524
|
globalvar: id => `_[${stringValue(SignalPrefix + id)}]`,
|
|
37583
37525
|
functions: buildFunctions,
|
|
37584
|
-
constants: Constants$
|
|
37526
|
+
constants: Constants$1,
|
|
37585
37527
|
visitors: astVisitors
|
|
37586
37528
|
};
|
|
37587
37529
|
|
|
37588
37530
|
// export code generator
|
|
37589
|
-
const codeGenerator = codegen
|
|
37531
|
+
const codeGenerator = codegen(codegenParams);
|
|
37590
37532
|
|
|
37591
37533
|
// Build expression function registry
|
|
37592
37534
|
function buildFunctions(codegen) {
|
|
37593
|
-
const fn = Functions$
|
|
37535
|
+
const fn = Functions$1(codegen);
|
|
37594
37536
|
eventFunctions.forEach(name => fn[name] = eventPrefix + name);
|
|
37595
37537
|
for (const name in functionContext) {
|
|
37596
37538
|
fn[name] = thisPrefix + name;
|
|
@@ -37642,21 +37584,21 @@ expressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);
|
|
|
37642
37584
|
expressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);
|
|
37643
37585
|
expressionFunction('vlSelectionTuples', selectionTuples);
|
|
37644
37586
|
|
|
37645
|
-
function parser$
|
|
37587
|
+
function parser$2 (expr, scope) {
|
|
37646
37588
|
const params = {};
|
|
37647
37589
|
|
|
37648
37590
|
// parse the expression to an abstract syntax tree (ast)
|
|
37649
37591
|
let ast;
|
|
37650
37592
|
try {
|
|
37651
37593
|
expr = isString(expr) ? expr : stringValue(expr) + '';
|
|
37652
|
-
ast = parser$
|
|
37594
|
+
ast = parser$3(expr);
|
|
37653
37595
|
} catch (err) {
|
|
37654
37596
|
error$1('Expression parse error: ' + expr);
|
|
37655
37597
|
}
|
|
37656
37598
|
|
|
37657
37599
|
// analyze ast function calls for dependencies
|
|
37658
37600
|
ast.visit(node => {
|
|
37659
|
-
if (node.type !== CallExpression$
|
|
37601
|
+
if (node.type !== CallExpression$1) return;
|
|
37660
37602
|
const name = node.callee.name,
|
|
37661
37603
|
visit = codegenParams.visitors[name];
|
|
37662
37604
|
if (visit) visit(name, node.arguments, scope, params);
|
|
@@ -39623,7 +39565,7 @@ const VIEW = 'view',
|
|
|
39623
39565
|
COMMA = ',',
|
|
39624
39566
|
NAME = '@',
|
|
39625
39567
|
GT = '>',
|
|
39626
|
-
ILLEGAL$
|
|
39568
|
+
ILLEGAL$1 = /[[\]{}]/,
|
|
39627
39569
|
DEFAULT_MARKS = {
|
|
39628
39570
|
'*': 1,
|
|
39629
39571
|
arc: 1,
|
|
@@ -39769,7 +39711,7 @@ function parseStream$1(s) {
|
|
|
39769
39711
|
}
|
|
39770
39712
|
|
|
39771
39713
|
// marshall event stream specification
|
|
39772
|
-
if (!(n = source.length) || ILLEGAL$
|
|
39714
|
+
if (!(n = source.length) || ILLEGAL$1.test(source[n - 1])) {
|
|
39773
39715
|
throw 'Invalid event selector: ' + s;
|
|
39774
39716
|
}
|
|
39775
39717
|
if (n > 1) {
|
|
@@ -39973,7 +39915,7 @@ function gradient$1(enc) {
|
|
|
39973
39915
|
const args = [enc.start, enc.stop, enc.count].map(_ => _ == null ? null : stringValue(_));
|
|
39974
39916
|
|
|
39975
39917
|
// trim null inputs from the end
|
|
39976
|
-
while (args.length && peek$
|
|
39918
|
+
while (args.length && peek$2(args) == null) args.pop();
|
|
39977
39919
|
args.unshift(scaleRef(enc.gradient));
|
|
39978
39920
|
return `gradient(${args.join(',')})`;
|
|
39979
39921
|
}
|
|
@@ -40041,7 +39983,7 @@ function rule$1 (enc) {
|
|
|
40041
39983
|
});
|
|
40042
39984
|
|
|
40043
39985
|
// if no else clause, terminate with null (#1366)
|
|
40044
|
-
if (peek$
|
|
39986
|
+
if (peek$2(code) === ':') {
|
|
40045
39987
|
code += 'null';
|
|
40046
39988
|
}
|
|
40047
39989
|
return code;
|
|
@@ -40081,7 +40023,7 @@ function expr(enc) {
|
|
|
40081
40023
|
return isArray(enc) ? rule$1(enc) : entry$1(enc);
|
|
40082
40024
|
}
|
|
40083
40025
|
function parse$1(code, scope, params, fields) {
|
|
40084
|
-
const expr = parser$
|
|
40026
|
+
const expr = parser$2(code, scope);
|
|
40085
40027
|
expr.$fields.forEach(name => fields[name] = 1);
|
|
40086
40028
|
extend$1(params, expr.$params);
|
|
40087
40029
|
return expr.$expr;
|
|
@@ -40253,7 +40195,7 @@ function streamParameters(entry, stream, scope) {
|
|
|
40253
40195
|
param.push('inScope(event.item)');
|
|
40254
40196
|
}
|
|
40255
40197
|
if (param.length) {
|
|
40256
|
-
entry.filter = parser$
|
|
40198
|
+
entry.filter = parser$2('(' + param.join(')&&(') + ')', scope).$expr;
|
|
40257
40199
|
}
|
|
40258
40200
|
if ((param = stream.throttle) != null) {
|
|
40259
40201
|
entry.throttle = +param;
|
|
@@ -40316,7 +40258,7 @@ function parseUpdate (spec, scope, target) {
|
|
|
40316
40258
|
}
|
|
40317
40259
|
|
|
40318
40260
|
// resolve update value
|
|
40319
|
-
entry.update = isString(update) ? parser$
|
|
40261
|
+
entry.update = isString(update) ? parser$2(update, scope) : update.expr != null ? parser$2(update.expr, scope) : update.value != null ? update.value : update.signal != null ? {
|
|
40320
40262
|
$expr: OP_VALUE_EXPR,
|
|
40321
40263
|
$params: {
|
|
40322
40264
|
$value: scope.signalRef(update.signal)
|
|
@@ -40352,7 +40294,7 @@ function parseSignalUpdates (signal, scope) {
|
|
|
40352
40294
|
}
|
|
40353
40295
|
}
|
|
40354
40296
|
if (expr) {
|
|
40355
|
-
expr = parser$
|
|
40297
|
+
expr = parser$2(expr, scope);
|
|
40356
40298
|
op.update = expr.$expr;
|
|
40357
40299
|
op.params = expr.$params;
|
|
40358
40300
|
}
|
|
@@ -41337,7 +41279,7 @@ function parameterValue(def, value, scope) {
|
|
|
41337
41279
|
return isExpr(type) ? error$1('Expression references can not be signals.') : isField(type) ? scope.fieldRef(value) : isCompare(type) ? scope.compareRef(value) : scope.signalRef(value.signal);
|
|
41338
41280
|
} else {
|
|
41339
41281
|
const expr = def.expr || isField(type);
|
|
41340
|
-
return expr && outerExpr(value) ? scope.exprRef(value.expr, value.as) : expr && outerField(value) ? fieldRef$1(value.field, value.as) : isExpr(type) ? parser$
|
|
41282
|
+
return expr && outerExpr(value) ? scope.exprRef(value.expr, value.as) : expr && outerField(value) ? fieldRef$1(value.field, value.as) : isExpr(type) ? parser$2(value, scope) : isData(type) ? ref(scope.getData(value).values) : isField(type) ? fieldRef$1(value) : isCompare(type) ? scope.compareRef(value) : value;
|
|
41341
41283
|
}
|
|
41342
41284
|
}
|
|
41343
41285
|
|
|
@@ -41641,7 +41583,7 @@ function parseTrigger (spec, scope, name) {
|
|
|
41641
41583
|
values = spec.values,
|
|
41642
41584
|
op = scope.add(operator());
|
|
41643
41585
|
const update = 'if(' + spec.trigger + ',modify("' + name + '",' + [insert, remove, toggle, modify, values].map(_ => _ == null ? 'null' : _).join(',') + '),0)';
|
|
41644
|
-
const expr = parser$
|
|
41586
|
+
const expr = parser$2(update, scope);
|
|
41645
41587
|
op.update = expr.$expr;
|
|
41646
41588
|
op.params = expr.$params;
|
|
41647
41589
|
}
|
|
@@ -41951,7 +41893,7 @@ function sizeExpression(spec, scope, marks) {
|
|
|
41951
41893
|
const size = deref(getChannel('size', spec, marks)),
|
|
41952
41894
|
strokeWidth = deref(getChannel('strokeWidth', spec, marks)),
|
|
41953
41895
|
fontSize = deref(getFontSize(marks[1].encode, scope, GuideLabelStyle));
|
|
41954
|
-
return parser$
|
|
41896
|
+
return parser$2(`max(ceil(sqrt(${size})+${strokeWidth}),${fontSize})`, scope);
|
|
41955
41897
|
}
|
|
41956
41898
|
function getChannel(name, spec, marks) {
|
|
41957
41899
|
return spec[name] ? `scale("${spec[name]}",datum)` : getEncoding(name, marks[0].encode);
|
|
@@ -43140,13 +43082,13 @@ Scope.prototype = Subscope.prototype = {
|
|
|
43140
43082
|
this._markpath.pop();
|
|
43141
43083
|
},
|
|
43142
43084
|
parent() {
|
|
43143
|
-
return peek$
|
|
43085
|
+
return peek$2(this._parent);
|
|
43144
43086
|
},
|
|
43145
43087
|
encode() {
|
|
43146
|
-
return peek$
|
|
43088
|
+
return peek$2(this._encode);
|
|
43147
43089
|
},
|
|
43148
43090
|
lookup() {
|
|
43149
|
-
return peek$
|
|
43091
|
+
return peek$2(this._lookup);
|
|
43150
43092
|
},
|
|
43151
43093
|
markpath() {
|
|
43152
43094
|
const p = this._markpath;
|
|
@@ -43246,7 +43188,7 @@ Scope.prototype = Subscope.prototype = {
|
|
|
43246
43188
|
const code = Object.keys(this.lambdas);
|
|
43247
43189
|
for (let i = 0, n = code.length; i < n; ++i) {
|
|
43248
43190
|
const s = code[i],
|
|
43249
|
-
e = parser$
|
|
43191
|
+
e = parser$2(s, this),
|
|
43250
43192
|
op = this.lambdas[s];
|
|
43251
43193
|
op.params = e.$params;
|
|
43252
43194
|
op.update = e.$expr;
|
|
@@ -43260,7 +43202,7 @@ Scope.prototype = Subscope.prototype = {
|
|
|
43260
43202
|
},
|
|
43261
43203
|
exprRef(code, name) {
|
|
43262
43204
|
const params = {
|
|
43263
|
-
expr: parser$
|
|
43205
|
+
expr: parser$2(code, this)
|
|
43264
43206
|
};
|
|
43265
43207
|
if (name) params.expr.$name = name;
|
|
43266
43208
|
return ref(this.add(Expression(params)));
|
|
@@ -43297,1880 +43239,293 @@ Scope.prototype = Subscope.prototype = {
|
|
|
43297
43239
|
return ref(this.getScale(name));
|
|
43298
43240
|
},
|
|
43299
43241
|
scaleType(name) {
|
|
43300
|
-
return this.getScale(name).params.type;
|
|
43301
|
-
},
|
|
43302
|
-
projectionRef(name) {
|
|
43303
|
-
return this.scaleRef(name);
|
|
43304
|
-
},
|
|
43305
|
-
projectionType(name) {
|
|
43306
|
-
return this.scaleType(name);
|
|
43307
|
-
},
|
|
43308
|
-
// ----
|
|
43309
|
-
|
|
43310
|
-
addData(name, dataScope) {
|
|
43311
|
-
if (hasOwnProperty$1(this.data, name)) {
|
|
43312
|
-
error$1('Duplicate data set name: ' + stringValue(name));
|
|
43313
|
-
}
|
|
43314
|
-
return this.data[name] = dataScope;
|
|
43315
|
-
},
|
|
43316
|
-
getData(name) {
|
|
43317
|
-
if (!this.data[name]) {
|
|
43318
|
-
error$1('Undefined data set name: ' + stringValue(name));
|
|
43319
|
-
}
|
|
43320
|
-
return this.data[name];
|
|
43321
|
-
},
|
|
43322
|
-
addDataPipeline(name, entries) {
|
|
43323
|
-
if (hasOwnProperty$1(this.data, name)) {
|
|
43324
|
-
error$1('Duplicate data set name: ' + stringValue(name));
|
|
43325
|
-
}
|
|
43326
|
-
return this.addData(name, DataScope.fromEntries(this, entries));
|
|
43327
|
-
}
|
|
43328
|
-
};
|
|
43329
|
-
function propertyLambda(spec) {
|
|
43330
|
-
return (isArray(spec) ? arrayLambda : objectLambda)(spec);
|
|
43331
|
-
}
|
|
43332
|
-
function arrayLambda(array) {
|
|
43333
|
-
const n = array.length;
|
|
43334
|
-
let code = '[';
|
|
43335
|
-
for (let i = 0; i < n; ++i) {
|
|
43336
|
-
const value = array[i];
|
|
43337
|
-
code += (i > 0 ? ',' : '') + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));
|
|
43338
|
-
}
|
|
43339
|
-
return code + ']';
|
|
43340
|
-
}
|
|
43341
|
-
function objectLambda(obj) {
|
|
43342
|
-
let code = '{',
|
|
43343
|
-
i = 0,
|
|
43344
|
-
key,
|
|
43345
|
-
value;
|
|
43346
|
-
for (key in obj) {
|
|
43347
|
-
value = obj[key];
|
|
43348
|
-
code += (++i > 1 ? ',' : '') + stringValue(key) + ':' + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));
|
|
43349
|
-
}
|
|
43350
|
-
return code + '}';
|
|
43351
|
-
}
|
|
43352
|
-
|
|
43353
|
-
/**
|
|
43354
|
-
* Standard configuration defaults for Vega specification parsing.
|
|
43355
|
-
* Users can provide their own (sub-)set of these default values
|
|
43356
|
-
* by passing in a config object to the top-level parse method.
|
|
43357
|
-
*/
|
|
43358
|
-
function defaults () {
|
|
43359
|
-
const defaultFont = 'sans-serif',
|
|
43360
|
-
defaultSymbolSize = 30,
|
|
43361
|
-
defaultStrokeWidth = 2,
|
|
43362
|
-
defaultColor = '#4c78a8',
|
|
43363
|
-
black = '#000',
|
|
43364
|
-
gray = '#888',
|
|
43365
|
-
lightGray = '#ddd';
|
|
43366
|
-
return {
|
|
43367
|
-
// default visualization description
|
|
43368
|
-
description: 'Vega visualization',
|
|
43369
|
-
// default padding around visualization
|
|
43370
|
-
padding: 0,
|
|
43371
|
-
// default for automatic sizing; options: 'none', 'pad', 'fit'
|
|
43372
|
-
// or provide an object (e.g., {'type': 'pad', 'resize': true})
|
|
43373
|
-
autosize: 'pad',
|
|
43374
|
-
// default view background color
|
|
43375
|
-
// covers the entire view component
|
|
43376
|
-
background: null,
|
|
43377
|
-
// default event handling configuration
|
|
43378
|
-
// preventDefault for view-sourced event types except 'wheel'
|
|
43379
|
-
events: {
|
|
43380
|
-
defaults: {
|
|
43381
|
-
allow: ['wheel']
|
|
43382
|
-
}
|
|
43383
|
-
},
|
|
43384
|
-
// defaults for top-level group marks
|
|
43385
|
-
// accepts mark properties (fill, stroke, etc)
|
|
43386
|
-
// covers the data rectangle within group width/height
|
|
43387
|
-
group: null,
|
|
43388
|
-
// defaults for basic mark types
|
|
43389
|
-
// each subset accepts mark properties (fill, stroke, etc)
|
|
43390
|
-
mark: null,
|
|
43391
|
-
arc: {
|
|
43392
|
-
fill: defaultColor
|
|
43393
|
-
},
|
|
43394
|
-
area: {
|
|
43395
|
-
fill: defaultColor
|
|
43396
|
-
},
|
|
43397
|
-
image: null,
|
|
43398
|
-
line: {
|
|
43399
|
-
stroke: defaultColor,
|
|
43400
|
-
strokeWidth: defaultStrokeWidth
|
|
43401
|
-
},
|
|
43402
|
-
path: {
|
|
43403
|
-
stroke: defaultColor
|
|
43404
|
-
},
|
|
43405
|
-
rect: {
|
|
43406
|
-
fill: defaultColor
|
|
43407
|
-
},
|
|
43408
|
-
rule: {
|
|
43409
|
-
stroke: black
|
|
43410
|
-
},
|
|
43411
|
-
shape: {
|
|
43412
|
-
stroke: defaultColor
|
|
43413
|
-
},
|
|
43414
|
-
symbol: {
|
|
43415
|
-
fill: defaultColor,
|
|
43416
|
-
size: 64
|
|
43417
|
-
},
|
|
43418
|
-
text: {
|
|
43419
|
-
fill: black,
|
|
43420
|
-
font: defaultFont,
|
|
43421
|
-
fontSize: 11
|
|
43422
|
-
},
|
|
43423
|
-
trail: {
|
|
43424
|
-
fill: defaultColor,
|
|
43425
|
-
size: defaultStrokeWidth
|
|
43426
|
-
},
|
|
43427
|
-
// style definitions
|
|
43428
|
-
style: {
|
|
43429
|
-
// axis & legend labels
|
|
43430
|
-
'guide-label': {
|
|
43431
|
-
fill: black,
|
|
43432
|
-
font: defaultFont,
|
|
43433
|
-
fontSize: 10
|
|
43434
|
-
},
|
|
43435
|
-
// axis & legend titles
|
|
43436
|
-
'guide-title': {
|
|
43437
|
-
fill: black,
|
|
43438
|
-
font: defaultFont,
|
|
43439
|
-
fontSize: 11,
|
|
43440
|
-
fontWeight: 'bold'
|
|
43441
|
-
},
|
|
43442
|
-
// headers, including chart title
|
|
43443
|
-
'group-title': {
|
|
43444
|
-
fill: black,
|
|
43445
|
-
font: defaultFont,
|
|
43446
|
-
fontSize: 13,
|
|
43447
|
-
fontWeight: 'bold'
|
|
43448
|
-
},
|
|
43449
|
-
// chart subtitle
|
|
43450
|
-
'group-subtitle': {
|
|
43451
|
-
fill: black,
|
|
43452
|
-
font: defaultFont,
|
|
43453
|
-
fontSize: 12
|
|
43454
|
-
},
|
|
43455
|
-
// defaults for styled point marks in Vega-Lite
|
|
43456
|
-
point: {
|
|
43457
|
-
size: defaultSymbolSize,
|
|
43458
|
-
strokeWidth: defaultStrokeWidth,
|
|
43459
|
-
shape: 'circle'
|
|
43460
|
-
},
|
|
43461
|
-
circle: {
|
|
43462
|
-
size: defaultSymbolSize,
|
|
43463
|
-
strokeWidth: defaultStrokeWidth
|
|
43464
|
-
},
|
|
43465
|
-
square: {
|
|
43466
|
-
size: defaultSymbolSize,
|
|
43467
|
-
strokeWidth: defaultStrokeWidth,
|
|
43468
|
-
shape: 'square'
|
|
43469
|
-
},
|
|
43470
|
-
// defaults for styled group marks in Vega-Lite
|
|
43471
|
-
cell: {
|
|
43472
|
-
fill: 'transparent',
|
|
43473
|
-
stroke: lightGray
|
|
43474
|
-
},
|
|
43475
|
-
view: {
|
|
43476
|
-
fill: 'transparent'
|
|
43477
|
-
}
|
|
43478
|
-
},
|
|
43479
|
-
// defaults for title
|
|
43480
|
-
title: {
|
|
43481
|
-
orient: 'top',
|
|
43482
|
-
anchor: 'middle',
|
|
43483
|
-
offset: 4,
|
|
43484
|
-
subtitlePadding: 3
|
|
43485
|
-
},
|
|
43486
|
-
// defaults for axes
|
|
43487
|
-
axis: {
|
|
43488
|
-
minExtent: 0,
|
|
43489
|
-
maxExtent: 200,
|
|
43490
|
-
bandPosition: 0.5,
|
|
43491
|
-
domain: true,
|
|
43492
|
-
domainWidth: 1,
|
|
43493
|
-
domainColor: gray,
|
|
43494
|
-
grid: false,
|
|
43495
|
-
gridWidth: 1,
|
|
43496
|
-
gridColor: lightGray,
|
|
43497
|
-
labels: true,
|
|
43498
|
-
labelAngle: 0,
|
|
43499
|
-
labelLimit: 180,
|
|
43500
|
-
labelOffset: 0,
|
|
43501
|
-
labelPadding: 2,
|
|
43502
|
-
ticks: true,
|
|
43503
|
-
tickColor: gray,
|
|
43504
|
-
tickOffset: 0,
|
|
43505
|
-
tickRound: true,
|
|
43506
|
-
tickSize: 5,
|
|
43507
|
-
tickWidth: 1,
|
|
43508
|
-
titlePadding: 4
|
|
43509
|
-
},
|
|
43510
|
-
// correction for centering bias
|
|
43511
|
-
axisBand: {
|
|
43512
|
-
tickOffset: -0.5
|
|
43513
|
-
},
|
|
43514
|
-
// defaults for cartographic projection
|
|
43515
|
-
projection: {
|
|
43516
|
-
type: 'mercator'
|
|
43517
|
-
},
|
|
43518
|
-
// defaults for legends
|
|
43519
|
-
legend: {
|
|
43520
|
-
orient: 'right',
|
|
43521
|
-
padding: 0,
|
|
43522
|
-
gridAlign: 'each',
|
|
43523
|
-
columnPadding: 10,
|
|
43524
|
-
rowPadding: 2,
|
|
43525
|
-
symbolDirection: 'vertical',
|
|
43526
|
-
gradientDirection: 'vertical',
|
|
43527
|
-
gradientLength: 200,
|
|
43528
|
-
gradientThickness: 16,
|
|
43529
|
-
gradientStrokeColor: lightGray,
|
|
43530
|
-
gradientStrokeWidth: 0,
|
|
43531
|
-
gradientLabelOffset: 2,
|
|
43532
|
-
labelAlign: 'left',
|
|
43533
|
-
labelBaseline: 'middle',
|
|
43534
|
-
labelLimit: 160,
|
|
43535
|
-
labelOffset: 4,
|
|
43536
|
-
labelOverlap: true,
|
|
43537
|
-
symbolLimit: 30,
|
|
43538
|
-
symbolType: 'circle',
|
|
43539
|
-
symbolSize: 100,
|
|
43540
|
-
symbolOffset: 0,
|
|
43541
|
-
symbolStrokeWidth: 1.5,
|
|
43542
|
-
symbolBaseFillColor: 'transparent',
|
|
43543
|
-
symbolBaseStrokeColor: gray,
|
|
43544
|
-
titleLimit: 180,
|
|
43545
|
-
titleOrient: 'top',
|
|
43546
|
-
titlePadding: 5,
|
|
43547
|
-
layout: {
|
|
43548
|
-
offset: 18,
|
|
43549
|
-
direction: 'horizontal',
|
|
43550
|
-
left: {
|
|
43551
|
-
direction: 'vertical'
|
|
43552
|
-
},
|
|
43553
|
-
right: {
|
|
43554
|
-
direction: 'vertical'
|
|
43555
|
-
}
|
|
43556
|
-
}
|
|
43557
|
-
},
|
|
43558
|
-
// defaults for scale ranges
|
|
43559
|
-
range: {
|
|
43560
|
-
category: {
|
|
43561
|
-
scheme: 'tableau10'
|
|
43562
|
-
},
|
|
43563
|
-
ordinal: {
|
|
43564
|
-
scheme: 'blues'
|
|
43565
|
-
},
|
|
43566
|
-
heatmap: {
|
|
43567
|
-
scheme: 'yellowgreenblue'
|
|
43568
|
-
},
|
|
43569
|
-
ramp: {
|
|
43570
|
-
scheme: 'blues'
|
|
43571
|
-
},
|
|
43572
|
-
diverging: {
|
|
43573
|
-
scheme: 'blueorange',
|
|
43574
|
-
extent: [1, 0]
|
|
43575
|
-
},
|
|
43576
|
-
symbol: ['circle', 'square', 'triangle-up', 'cross', 'diamond', 'triangle-right', 'triangle-down', 'triangle-left']
|
|
43577
|
-
}
|
|
43578
|
-
};
|
|
43579
|
-
}
|
|
43580
|
-
|
|
43581
|
-
function parse (spec, config, options) {
|
|
43582
|
-
if (!isObject(spec)) {
|
|
43583
|
-
error$1('Input Vega specification must be an object.');
|
|
43584
|
-
}
|
|
43585
|
-
config = mergeConfig(defaults(), config, spec.config);
|
|
43586
|
-
return parseView(spec, new Scope(config, options)).toRuntime();
|
|
43587
|
-
}
|
|
43588
|
-
|
|
43589
|
-
const RawCode$1 = 'RawCode';
|
|
43590
|
-
const Literal$1 = 'Literal';
|
|
43591
|
-
const Property$1 = 'Property';
|
|
43592
|
-
const Identifier$1 = 'Identifier';
|
|
43593
|
-
const ArrayExpression$1 = 'ArrayExpression';
|
|
43594
|
-
const BinaryExpression$1 = 'BinaryExpression';
|
|
43595
|
-
const CallExpression$1 = 'CallExpression';
|
|
43596
|
-
const ConditionalExpression$1 = 'ConditionalExpression';
|
|
43597
|
-
const LogicalExpression$1 = 'LogicalExpression';
|
|
43598
|
-
const MemberExpression$1 = 'MemberExpression';
|
|
43599
|
-
const ObjectExpression$1 = 'ObjectExpression';
|
|
43600
|
-
const UnaryExpression$1 = 'UnaryExpression';
|
|
43601
|
-
function ASTNode$1(type) {
|
|
43602
|
-
this.type = type;
|
|
43603
|
-
}
|
|
43604
|
-
ASTNode$1.prototype.visit = function (visitor) {
|
|
43605
|
-
let c, i, n;
|
|
43606
|
-
if (visitor(this)) return 1;
|
|
43607
|
-
for (c = children$1(this), i = 0, n = c.length; i < n; ++i) {
|
|
43608
|
-
if (c[i].visit(visitor)) return 1;
|
|
43609
|
-
}
|
|
43610
|
-
};
|
|
43611
|
-
function children$1(node) {
|
|
43612
|
-
switch (node.type) {
|
|
43613
|
-
case ArrayExpression$1:
|
|
43614
|
-
return node.elements;
|
|
43615
|
-
case BinaryExpression$1:
|
|
43616
|
-
case LogicalExpression$1:
|
|
43617
|
-
return [node.left, node.right];
|
|
43618
|
-
case CallExpression$1:
|
|
43619
|
-
return [node.callee].concat(node.arguments);
|
|
43620
|
-
case ConditionalExpression$1:
|
|
43621
|
-
return [node.test, node.consequent, node.alternate];
|
|
43622
|
-
case MemberExpression$1:
|
|
43623
|
-
return [node.object, node.property];
|
|
43624
|
-
case ObjectExpression$1:
|
|
43625
|
-
return node.properties;
|
|
43626
|
-
case Property$1:
|
|
43627
|
-
return [node.key, node.value];
|
|
43628
|
-
case UnaryExpression$1:
|
|
43629
|
-
return [node.argument];
|
|
43630
|
-
case Identifier$1:
|
|
43631
|
-
case Literal$1:
|
|
43632
|
-
case RawCode$1:
|
|
43633
|
-
default:
|
|
43634
|
-
return [];
|
|
43635
|
-
}
|
|
43636
|
-
}
|
|
43637
|
-
|
|
43638
|
-
/*
|
|
43639
|
-
The following expression parser is based on Esprima (http://esprima.org/).
|
|
43640
|
-
Original header comment and license for Esprima is included here:
|
|
43641
|
-
|
|
43642
|
-
Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
|
|
43643
|
-
Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
|
|
43644
|
-
Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>
|
|
43645
|
-
Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
|
|
43646
|
-
Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
|
|
43647
|
-
Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
|
|
43648
|
-
Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>
|
|
43649
|
-
Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
|
|
43650
|
-
Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>
|
|
43651
|
-
Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
|
|
43652
|
-
|
|
43653
|
-
Redistribution and use in source and binary forms, with or without
|
|
43654
|
-
modification, are permitted provided that the following conditions are met:
|
|
43655
|
-
|
|
43656
|
-
* Redistributions of source code must retain the above copyright
|
|
43657
|
-
notice, this list of conditions and the following disclaimer.
|
|
43658
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
43659
|
-
notice, this list of conditions and the following disclaimer in the
|
|
43660
|
-
documentation and/or other materials provided with the distribution.
|
|
43661
|
-
|
|
43662
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
43663
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
43664
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
43665
|
-
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
43666
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
43667
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
43668
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
43669
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
43670
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
43671
|
-
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
43672
|
-
*/
|
|
43673
|
-
var TokenName$1, source$1, index$1, length$1, lookahead$1;
|
|
43674
|
-
var TokenBooleanLiteral$1 = 1,
|
|
43675
|
-
TokenEOF$1 = 2,
|
|
43676
|
-
TokenIdentifier$1 = 3,
|
|
43677
|
-
TokenKeyword$1 = 4,
|
|
43678
|
-
TokenNullLiteral$1 = 5,
|
|
43679
|
-
TokenNumericLiteral$1 = 6,
|
|
43680
|
-
TokenPunctuator$1 = 7,
|
|
43681
|
-
TokenStringLiteral$1 = 8,
|
|
43682
|
-
TokenRegularExpression$1 = 9;
|
|
43683
|
-
TokenName$1 = {};
|
|
43684
|
-
TokenName$1[TokenBooleanLiteral$1] = 'Boolean';
|
|
43685
|
-
TokenName$1[TokenEOF$1] = '<end>';
|
|
43686
|
-
TokenName$1[TokenIdentifier$1] = 'Identifier';
|
|
43687
|
-
TokenName$1[TokenKeyword$1] = 'Keyword';
|
|
43688
|
-
TokenName$1[TokenNullLiteral$1] = 'Null';
|
|
43689
|
-
TokenName$1[TokenNumericLiteral$1] = 'Numeric';
|
|
43690
|
-
TokenName$1[TokenPunctuator$1] = 'Punctuator';
|
|
43691
|
-
TokenName$1[TokenStringLiteral$1] = 'String';
|
|
43692
|
-
TokenName$1[TokenRegularExpression$1] = 'RegularExpression';
|
|
43693
|
-
var SyntaxArrayExpression$1 = 'ArrayExpression',
|
|
43694
|
-
SyntaxBinaryExpression$1 = 'BinaryExpression',
|
|
43695
|
-
SyntaxCallExpression$1 = 'CallExpression',
|
|
43696
|
-
SyntaxConditionalExpression$1 = 'ConditionalExpression',
|
|
43697
|
-
SyntaxIdentifier$1 = 'Identifier',
|
|
43698
|
-
SyntaxLiteral$1 = 'Literal',
|
|
43699
|
-
SyntaxLogicalExpression$1 = 'LogicalExpression',
|
|
43700
|
-
SyntaxMemberExpression$1 = 'MemberExpression',
|
|
43701
|
-
SyntaxObjectExpression$1 = 'ObjectExpression',
|
|
43702
|
-
SyntaxProperty$1 = 'Property',
|
|
43703
|
-
SyntaxUnaryExpression$1 = 'UnaryExpression';
|
|
43704
|
-
|
|
43705
|
-
// Error messages should be identical to V8.
|
|
43706
|
-
var MessageUnexpectedToken$1 = 'Unexpected token %0',
|
|
43707
|
-
MessageUnexpectedNumber$1 = 'Unexpected number',
|
|
43708
|
-
MessageUnexpectedString$1 = 'Unexpected string',
|
|
43709
|
-
MessageUnexpectedIdentifier$1 = 'Unexpected identifier',
|
|
43710
|
-
MessageUnexpectedReserved$1 = 'Unexpected reserved word',
|
|
43711
|
-
MessageUnexpectedEOS$1 = 'Unexpected end of input',
|
|
43712
|
-
MessageInvalidRegExp$1 = 'Invalid regular expression',
|
|
43713
|
-
MessageUnterminatedRegExp$1 = 'Invalid regular expression: missing /',
|
|
43714
|
-
MessageStrictOctalLiteral$1 = 'Octal literals are not allowed in strict mode.',
|
|
43715
|
-
MessageStrictDuplicateProperty$1 = 'Duplicate data property in object literal not allowed in strict mode';
|
|
43716
|
-
var ILLEGAL$1 = 'ILLEGAL',
|
|
43717
|
-
DISABLED$1 = 'Disabled.';
|
|
43718
|
-
|
|
43719
|
-
// See also tools/generate-unicode-regex.py.
|
|
43720
|
-
var RegexNonAsciiIdentifierStart$1 = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),
|
|
43721
|
-
// eslint-disable-next-line no-misleading-character-class
|
|
43722
|
-
RegexNonAsciiIdentifierPart$1 = new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]');
|
|
43723
|
-
|
|
43724
|
-
// Ensure the condition is true, otherwise throw an error.
|
|
43725
|
-
// This is only to have a better contract semantic, i.e. another safety net
|
|
43726
|
-
// to catch a logic error. The condition shall be fulfilled in normal case.
|
|
43727
|
-
// Do NOT use this to enforce a certain condition on any user input.
|
|
43728
|
-
|
|
43729
|
-
function assert$1(condition, message) {
|
|
43730
|
-
/* istanbul ignore next */
|
|
43731
|
-
if (!condition) {
|
|
43732
|
-
throw new Error('ASSERT: ' + message);
|
|
43733
|
-
}
|
|
43734
|
-
}
|
|
43735
|
-
function isDecimalDigit$1(ch) {
|
|
43736
|
-
return ch >= 0x30 && ch <= 0x39; // 0..9
|
|
43737
|
-
}
|
|
43738
|
-
function isHexDigit$1(ch) {
|
|
43739
|
-
return '0123456789abcdefABCDEF'.includes(ch);
|
|
43740
|
-
}
|
|
43741
|
-
function isOctalDigit$1(ch) {
|
|
43742
|
-
return '01234567'.includes(ch);
|
|
43743
|
-
}
|
|
43744
|
-
|
|
43745
|
-
// 7.2 White Space
|
|
43746
|
-
|
|
43747
|
-
function isWhiteSpace$1(ch) {
|
|
43748
|
-
return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].includes(ch);
|
|
43749
|
-
}
|
|
43750
|
-
|
|
43751
|
-
// 7.3 Line Terminators
|
|
43752
|
-
|
|
43753
|
-
function isLineTerminator$1(ch) {
|
|
43754
|
-
return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
|
|
43755
|
-
}
|
|
43756
|
-
|
|
43757
|
-
// 7.6 Identifier Names and Identifiers
|
|
43758
|
-
|
|
43759
|
-
function isIdentifierStart$1(ch) {
|
|
43760
|
-
return ch === 0x24 || ch === 0x5F ||
|
|
43761
|
-
// $ (dollar) and _ (underscore)
|
|
43762
|
-
ch >= 0x41 && ch <= 0x5A ||
|
|
43763
|
-
// A..Z
|
|
43764
|
-
ch >= 0x61 && ch <= 0x7A ||
|
|
43765
|
-
// a..z
|
|
43766
|
-
ch === 0x5C ||
|
|
43767
|
-
// \ (backslash)
|
|
43768
|
-
ch >= 0x80 && RegexNonAsciiIdentifierStart$1.test(String.fromCharCode(ch));
|
|
43769
|
-
}
|
|
43770
|
-
function isIdentifierPart$1(ch) {
|
|
43771
|
-
return ch === 0x24 || ch === 0x5F ||
|
|
43772
|
-
// $ (dollar) and _ (underscore)
|
|
43773
|
-
ch >= 0x41 && ch <= 0x5A ||
|
|
43774
|
-
// A..Z
|
|
43775
|
-
ch >= 0x61 && ch <= 0x7A ||
|
|
43776
|
-
// a..z
|
|
43777
|
-
ch >= 0x30 && ch <= 0x39 ||
|
|
43778
|
-
// 0..9
|
|
43779
|
-
ch === 0x5C ||
|
|
43780
|
-
// \ (backslash)
|
|
43781
|
-
ch >= 0x80 && RegexNonAsciiIdentifierPart$1.test(String.fromCharCode(ch));
|
|
43782
|
-
}
|
|
43783
|
-
|
|
43784
|
-
// 7.6.1.1 Keywords
|
|
43785
|
-
|
|
43786
|
-
const keywords$1 = {
|
|
43787
|
-
'if': 1,
|
|
43788
|
-
'in': 1,
|
|
43789
|
-
'do': 1,
|
|
43790
|
-
'var': 1,
|
|
43791
|
-
'for': 1,
|
|
43792
|
-
'new': 1,
|
|
43793
|
-
'try': 1,
|
|
43794
|
-
'let': 1,
|
|
43795
|
-
'this': 1,
|
|
43796
|
-
'else': 1,
|
|
43797
|
-
'case': 1,
|
|
43798
|
-
'void': 1,
|
|
43799
|
-
'with': 1,
|
|
43800
|
-
'enum': 1,
|
|
43801
|
-
'while': 1,
|
|
43802
|
-
'break': 1,
|
|
43803
|
-
'catch': 1,
|
|
43804
|
-
'throw': 1,
|
|
43805
|
-
'const': 1,
|
|
43806
|
-
'yield': 1,
|
|
43807
|
-
'class': 1,
|
|
43808
|
-
'super': 1,
|
|
43809
|
-
'return': 1,
|
|
43810
|
-
'typeof': 1,
|
|
43811
|
-
'delete': 1,
|
|
43812
|
-
'switch': 1,
|
|
43813
|
-
'export': 1,
|
|
43814
|
-
'import': 1,
|
|
43815
|
-
'public': 1,
|
|
43816
|
-
'static': 1,
|
|
43817
|
-
'default': 1,
|
|
43818
|
-
'finally': 1,
|
|
43819
|
-
'extends': 1,
|
|
43820
|
-
'package': 1,
|
|
43821
|
-
'private': 1,
|
|
43822
|
-
'function': 1,
|
|
43823
|
-
'continue': 1,
|
|
43824
|
-
'debugger': 1,
|
|
43825
|
-
'interface': 1,
|
|
43826
|
-
'protected': 1,
|
|
43827
|
-
'instanceof': 1,
|
|
43828
|
-
'implements': 1
|
|
43829
|
-
};
|
|
43830
|
-
function skipComment$1() {
|
|
43831
|
-
while (index$1 < length$1) {
|
|
43832
|
-
const ch = source$1.charCodeAt(index$1);
|
|
43833
|
-
if (isWhiteSpace$1(ch) || isLineTerminator$1(ch)) {
|
|
43834
|
-
++index$1;
|
|
43835
|
-
} else {
|
|
43836
|
-
break;
|
|
43837
|
-
}
|
|
43838
|
-
}
|
|
43839
|
-
}
|
|
43840
|
-
function scanHexEscape$1(prefix) {
|
|
43841
|
-
var i,
|
|
43842
|
-
len,
|
|
43843
|
-
ch,
|
|
43844
|
-
code = 0;
|
|
43845
|
-
len = prefix === 'u' ? 4 : 2;
|
|
43846
|
-
for (i = 0; i < len; ++i) {
|
|
43847
|
-
if (index$1 < length$1 && isHexDigit$1(source$1[index$1])) {
|
|
43848
|
-
ch = source$1[index$1++];
|
|
43849
|
-
code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
|
|
43850
|
-
} else {
|
|
43851
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
43852
|
-
}
|
|
43853
|
-
}
|
|
43854
|
-
return String.fromCharCode(code);
|
|
43855
|
-
}
|
|
43856
|
-
function scanUnicodeCodePointEscape$1() {
|
|
43857
|
-
var ch, code, cu1, cu2;
|
|
43858
|
-
ch = source$1[index$1];
|
|
43859
|
-
code = 0;
|
|
43860
|
-
|
|
43861
|
-
// At least, one hex digit is required.
|
|
43862
|
-
if (ch === '}') {
|
|
43863
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
43864
|
-
}
|
|
43865
|
-
while (index$1 < length$1) {
|
|
43866
|
-
ch = source$1[index$1++];
|
|
43867
|
-
if (!isHexDigit$1(ch)) {
|
|
43868
|
-
break;
|
|
43869
|
-
}
|
|
43870
|
-
code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
|
|
43871
|
-
}
|
|
43872
|
-
if (code > 0x10FFFF || ch !== '}') {
|
|
43873
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
43874
|
-
}
|
|
43875
|
-
|
|
43876
|
-
// UTF-16 Encoding
|
|
43877
|
-
if (code <= 0xFFFF) {
|
|
43878
|
-
return String.fromCharCode(code);
|
|
43879
|
-
}
|
|
43880
|
-
cu1 = (code - 0x10000 >> 10) + 0xD800;
|
|
43881
|
-
cu2 = (code - 0x10000 & 1023) + 0xDC00;
|
|
43882
|
-
return String.fromCharCode(cu1, cu2);
|
|
43883
|
-
}
|
|
43884
|
-
function getEscapedIdentifier$1() {
|
|
43885
|
-
var ch, id;
|
|
43886
|
-
ch = source$1.charCodeAt(index$1++);
|
|
43887
|
-
id = String.fromCharCode(ch);
|
|
43888
|
-
|
|
43889
|
-
// '\u' (U+005C, U+0075) denotes an escaped character.
|
|
43890
|
-
if (ch === 0x5C) {
|
|
43891
|
-
if (source$1.charCodeAt(index$1) !== 0x75) {
|
|
43892
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
43893
|
-
}
|
|
43894
|
-
++index$1;
|
|
43895
|
-
ch = scanHexEscape$1('u');
|
|
43896
|
-
if (!ch || ch === '\\' || !isIdentifierStart$1(ch.charCodeAt(0))) {
|
|
43897
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
43898
|
-
}
|
|
43899
|
-
id = ch;
|
|
43900
|
-
}
|
|
43901
|
-
while (index$1 < length$1) {
|
|
43902
|
-
ch = source$1.charCodeAt(index$1);
|
|
43903
|
-
if (!isIdentifierPart$1(ch)) {
|
|
43904
|
-
break;
|
|
43905
|
-
}
|
|
43906
|
-
++index$1;
|
|
43907
|
-
id += String.fromCharCode(ch);
|
|
43908
|
-
|
|
43909
|
-
// '\u' (U+005C, U+0075) denotes an escaped character.
|
|
43910
|
-
if (ch === 0x5C) {
|
|
43911
|
-
id = id.substr(0, id.length - 1);
|
|
43912
|
-
if (source$1.charCodeAt(index$1) !== 0x75) {
|
|
43913
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
43914
|
-
}
|
|
43915
|
-
++index$1;
|
|
43916
|
-
ch = scanHexEscape$1('u');
|
|
43917
|
-
if (!ch || ch === '\\' || !isIdentifierPart$1(ch.charCodeAt(0))) {
|
|
43918
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
43919
|
-
}
|
|
43920
|
-
id += ch;
|
|
43921
|
-
}
|
|
43922
|
-
}
|
|
43923
|
-
return id;
|
|
43924
|
-
}
|
|
43925
|
-
function getIdentifier$1() {
|
|
43926
|
-
var start, ch;
|
|
43927
|
-
start = index$1++;
|
|
43928
|
-
while (index$1 < length$1) {
|
|
43929
|
-
ch = source$1.charCodeAt(index$1);
|
|
43930
|
-
if (ch === 0x5C) {
|
|
43931
|
-
// Blackslash (U+005C) marks Unicode escape sequence.
|
|
43932
|
-
index$1 = start;
|
|
43933
|
-
return getEscapedIdentifier$1();
|
|
43934
|
-
}
|
|
43935
|
-
if (isIdentifierPart$1(ch)) {
|
|
43936
|
-
++index$1;
|
|
43937
|
-
} else {
|
|
43938
|
-
break;
|
|
43939
|
-
}
|
|
43940
|
-
}
|
|
43941
|
-
return source$1.slice(start, index$1);
|
|
43942
|
-
}
|
|
43943
|
-
function scanIdentifier$1() {
|
|
43944
|
-
var start, id, type;
|
|
43945
|
-
start = index$1;
|
|
43946
|
-
|
|
43947
|
-
// Backslash (U+005C) starts an escaped character.
|
|
43948
|
-
id = source$1.charCodeAt(index$1) === 0x5C ? getEscapedIdentifier$1() : getIdentifier$1();
|
|
43949
|
-
|
|
43950
|
-
// There is no keyword or literal with only one character.
|
|
43951
|
-
// Thus, it must be an identifier.
|
|
43952
|
-
if (id.length === 1) {
|
|
43953
|
-
type = TokenIdentifier$1;
|
|
43954
|
-
} else if (keywords$1.hasOwnProperty(id)) {
|
|
43955
|
-
// eslint-disable-line no-prototype-builtins
|
|
43956
|
-
type = TokenKeyword$1;
|
|
43957
|
-
} else if (id === 'null') {
|
|
43958
|
-
type = TokenNullLiteral$1;
|
|
43959
|
-
} else if (id === 'true' || id === 'false') {
|
|
43960
|
-
type = TokenBooleanLiteral$1;
|
|
43961
|
-
} else {
|
|
43962
|
-
type = TokenIdentifier$1;
|
|
43963
|
-
}
|
|
43964
|
-
return {
|
|
43965
|
-
type: type,
|
|
43966
|
-
value: id,
|
|
43967
|
-
start: start,
|
|
43968
|
-
end: index$1
|
|
43969
|
-
};
|
|
43970
|
-
}
|
|
43971
|
-
|
|
43972
|
-
// 7.7 Punctuators
|
|
43973
|
-
|
|
43974
|
-
function scanPunctuator$1() {
|
|
43975
|
-
var start = index$1,
|
|
43976
|
-
code = source$1.charCodeAt(index$1),
|
|
43977
|
-
code2,
|
|
43978
|
-
ch1 = source$1[index$1],
|
|
43979
|
-
ch2,
|
|
43980
|
-
ch3,
|
|
43981
|
-
ch4;
|
|
43982
|
-
switch (code) {
|
|
43983
|
-
// Check for most common single-character punctuators.
|
|
43984
|
-
case 0x2E: // . dot
|
|
43985
|
-
case 0x28: // ( open bracket
|
|
43986
|
-
case 0x29: // ) close bracket
|
|
43987
|
-
case 0x3B: // ; semicolon
|
|
43988
|
-
case 0x2C: // , comma
|
|
43989
|
-
case 0x7B: // { open curly brace
|
|
43990
|
-
case 0x7D: // } close curly brace
|
|
43991
|
-
case 0x5B: // [
|
|
43992
|
-
case 0x5D: // ]
|
|
43993
|
-
case 0x3A: // :
|
|
43994
|
-
case 0x3F: // ?
|
|
43995
|
-
case 0x7E:
|
|
43996
|
-
// ~
|
|
43997
|
-
++index$1;
|
|
43998
|
-
return {
|
|
43999
|
-
type: TokenPunctuator$1,
|
|
44000
|
-
value: String.fromCharCode(code),
|
|
44001
|
-
start: start,
|
|
44002
|
-
end: index$1
|
|
44003
|
-
};
|
|
44004
|
-
default:
|
|
44005
|
-
code2 = source$1.charCodeAt(index$1 + 1);
|
|
44006
|
-
|
|
44007
|
-
// '=' (U+003D) marks an assignment or comparison operator.
|
|
44008
|
-
if (code2 === 0x3D) {
|
|
44009
|
-
switch (code) {
|
|
44010
|
-
case 0x2B: // +
|
|
44011
|
-
case 0x2D: // -
|
|
44012
|
-
case 0x2F: // /
|
|
44013
|
-
case 0x3C: // <
|
|
44014
|
-
case 0x3E: // >
|
|
44015
|
-
case 0x5E: // ^
|
|
44016
|
-
case 0x7C: // |
|
|
44017
|
-
case 0x25: // %
|
|
44018
|
-
case 0x26: // &
|
|
44019
|
-
case 0x2A:
|
|
44020
|
-
// *
|
|
44021
|
-
index$1 += 2;
|
|
44022
|
-
return {
|
|
44023
|
-
type: TokenPunctuator$1,
|
|
44024
|
-
value: String.fromCharCode(code) + String.fromCharCode(code2),
|
|
44025
|
-
start: start,
|
|
44026
|
-
end: index$1
|
|
44027
|
-
};
|
|
44028
|
-
case 0x21: // !
|
|
44029
|
-
case 0x3D:
|
|
44030
|
-
// =
|
|
44031
|
-
index$1 += 2;
|
|
44032
|
-
|
|
44033
|
-
// !== and ===
|
|
44034
|
-
if (source$1.charCodeAt(index$1) === 0x3D) {
|
|
44035
|
-
++index$1;
|
|
44036
|
-
}
|
|
44037
|
-
return {
|
|
44038
|
-
type: TokenPunctuator$1,
|
|
44039
|
-
value: source$1.slice(start, index$1),
|
|
44040
|
-
start: start,
|
|
44041
|
-
end: index$1
|
|
44042
|
-
};
|
|
44043
|
-
}
|
|
44044
|
-
}
|
|
44045
|
-
}
|
|
44046
|
-
|
|
44047
|
-
// 4-character punctuator: >>>=
|
|
44048
|
-
|
|
44049
|
-
ch4 = source$1.substr(index$1, 4);
|
|
44050
|
-
if (ch4 === '>>>=') {
|
|
44051
|
-
index$1 += 4;
|
|
44052
|
-
return {
|
|
44053
|
-
type: TokenPunctuator$1,
|
|
44054
|
-
value: ch4,
|
|
44055
|
-
start: start,
|
|
44056
|
-
end: index$1
|
|
44057
|
-
};
|
|
44058
|
-
}
|
|
44059
|
-
|
|
44060
|
-
// 3-character punctuators: === !== >>> <<= >>=
|
|
44061
|
-
|
|
44062
|
-
ch3 = ch4.substr(0, 3);
|
|
44063
|
-
if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {
|
|
44064
|
-
index$1 += 3;
|
|
44065
|
-
return {
|
|
44066
|
-
type: TokenPunctuator$1,
|
|
44067
|
-
value: ch3,
|
|
44068
|
-
start: start,
|
|
44069
|
-
end: index$1
|
|
44070
|
-
};
|
|
44071
|
-
}
|
|
44072
|
-
|
|
44073
|
-
// Other 2-character punctuators: ++ -- << >> && ||
|
|
44074
|
-
ch2 = ch3.substr(0, 2);
|
|
44075
|
-
if (ch1 === ch2[1] && '+-<>&|'.includes(ch1) || ch2 === '=>') {
|
|
44076
|
-
index$1 += 2;
|
|
44077
|
-
return {
|
|
44078
|
-
type: TokenPunctuator$1,
|
|
44079
|
-
value: ch2,
|
|
44080
|
-
start: start,
|
|
44081
|
-
end: index$1
|
|
44082
|
-
};
|
|
44083
|
-
}
|
|
44084
|
-
if (ch2 === '//') {
|
|
44085
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44086
|
-
}
|
|
44087
|
-
|
|
44088
|
-
// 1-character punctuators: < > = ! + - * % & | ^ /
|
|
44089
|
-
|
|
44090
|
-
if ('<>=!+-*%&|^/'.includes(ch1)) {
|
|
44091
|
-
++index$1;
|
|
44092
|
-
return {
|
|
44093
|
-
type: TokenPunctuator$1,
|
|
44094
|
-
value: ch1,
|
|
44095
|
-
start: start,
|
|
44096
|
-
end: index$1
|
|
44097
|
-
};
|
|
44098
|
-
}
|
|
44099
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44100
|
-
}
|
|
44101
|
-
|
|
44102
|
-
// 7.8.3 Numeric Literals
|
|
44103
|
-
|
|
44104
|
-
function scanHexLiteral$1(start) {
|
|
44105
|
-
let number = '';
|
|
44106
|
-
while (index$1 < length$1) {
|
|
44107
|
-
if (!isHexDigit$1(source$1[index$1])) {
|
|
44108
|
-
break;
|
|
44109
|
-
}
|
|
44110
|
-
number += source$1[index$1++];
|
|
44111
|
-
}
|
|
44112
|
-
if (number.length === 0) {
|
|
44113
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44114
|
-
}
|
|
44115
|
-
if (isIdentifierStart$1(source$1.charCodeAt(index$1))) {
|
|
44116
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44117
|
-
}
|
|
44118
|
-
return {
|
|
44119
|
-
type: TokenNumericLiteral$1,
|
|
44120
|
-
value: parseInt('0x' + number, 16),
|
|
44121
|
-
start: start,
|
|
44122
|
-
end: index$1
|
|
44123
|
-
};
|
|
44124
|
-
}
|
|
44125
|
-
function scanOctalLiteral$1(start) {
|
|
44126
|
-
let number = '0' + source$1[index$1++];
|
|
44127
|
-
while (index$1 < length$1) {
|
|
44128
|
-
if (!isOctalDigit$1(source$1[index$1])) {
|
|
44129
|
-
break;
|
|
44130
|
-
}
|
|
44131
|
-
number += source$1[index$1++];
|
|
44132
|
-
}
|
|
44133
|
-
if (isIdentifierStart$1(source$1.charCodeAt(index$1)) || isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
44134
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44135
|
-
}
|
|
44136
|
-
return {
|
|
44137
|
-
type: TokenNumericLiteral$1,
|
|
44138
|
-
value: parseInt(number, 8),
|
|
44139
|
-
octal: true,
|
|
44140
|
-
start: start,
|
|
44141
|
-
end: index$1
|
|
44142
|
-
};
|
|
44143
|
-
}
|
|
44144
|
-
function scanNumericLiteral$1() {
|
|
44145
|
-
var number, start, ch;
|
|
44146
|
-
ch = source$1[index$1];
|
|
44147
|
-
assert$1(isDecimalDigit$1(ch.charCodeAt(0)) || ch === '.', 'Numeric literal must start with a decimal digit or a decimal point');
|
|
44148
|
-
start = index$1;
|
|
44149
|
-
number = '';
|
|
44150
|
-
if (ch !== '.') {
|
|
44151
|
-
number = source$1[index$1++];
|
|
44152
|
-
ch = source$1[index$1];
|
|
44153
|
-
|
|
44154
|
-
// Hex number starts with '0x'.
|
|
44155
|
-
// Octal number starts with '0'.
|
|
44156
|
-
if (number === '0') {
|
|
44157
|
-
if (ch === 'x' || ch === 'X') {
|
|
44158
|
-
++index$1;
|
|
44159
|
-
return scanHexLiteral$1(start);
|
|
44160
|
-
}
|
|
44161
|
-
if (isOctalDigit$1(ch)) {
|
|
44162
|
-
return scanOctalLiteral$1(start);
|
|
44163
|
-
}
|
|
44164
|
-
|
|
44165
|
-
// decimal number starts with '0' such as '09' is illegal.
|
|
44166
|
-
if (ch && isDecimalDigit$1(ch.charCodeAt(0))) {
|
|
44167
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44168
|
-
}
|
|
44169
|
-
}
|
|
44170
|
-
while (isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
44171
|
-
number += source$1[index$1++];
|
|
44172
|
-
}
|
|
44173
|
-
ch = source$1[index$1];
|
|
44174
|
-
}
|
|
44175
|
-
if (ch === '.') {
|
|
44176
|
-
number += source$1[index$1++];
|
|
44177
|
-
while (isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
44178
|
-
number += source$1[index$1++];
|
|
44179
|
-
}
|
|
44180
|
-
ch = source$1[index$1];
|
|
44181
|
-
}
|
|
44182
|
-
if (ch === 'e' || ch === 'E') {
|
|
44183
|
-
number += source$1[index$1++];
|
|
44184
|
-
ch = source$1[index$1];
|
|
44185
|
-
if (ch === '+' || ch === '-') {
|
|
44186
|
-
number += source$1[index$1++];
|
|
44187
|
-
}
|
|
44188
|
-
if (isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
44189
|
-
while (isDecimalDigit$1(source$1.charCodeAt(index$1))) {
|
|
44190
|
-
number += source$1[index$1++];
|
|
44191
|
-
}
|
|
44192
|
-
} else {
|
|
44193
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44194
|
-
}
|
|
44195
|
-
}
|
|
44196
|
-
if (isIdentifierStart$1(source$1.charCodeAt(index$1))) {
|
|
44197
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44198
|
-
}
|
|
44199
|
-
return {
|
|
44200
|
-
type: TokenNumericLiteral$1,
|
|
44201
|
-
value: parseFloat(number),
|
|
44202
|
-
start: start,
|
|
44203
|
-
end: index$1
|
|
44204
|
-
};
|
|
44205
|
-
}
|
|
44206
|
-
|
|
44207
|
-
// 7.8.4 String Literals
|
|
44208
|
-
|
|
44209
|
-
function scanStringLiteral$1() {
|
|
44210
|
-
var str = '',
|
|
44211
|
-
quote,
|
|
44212
|
-
start,
|
|
44213
|
-
ch,
|
|
44214
|
-
code,
|
|
44215
|
-
octal = false;
|
|
44216
|
-
quote = source$1[index$1];
|
|
44217
|
-
assert$1(quote === '\'' || quote === '"', 'String literal must starts with a quote');
|
|
44218
|
-
start = index$1;
|
|
44219
|
-
++index$1;
|
|
44220
|
-
while (index$1 < length$1) {
|
|
44221
|
-
ch = source$1[index$1++];
|
|
44222
|
-
if (ch === quote) {
|
|
44223
|
-
quote = '';
|
|
44224
|
-
break;
|
|
44225
|
-
} else if (ch === '\\') {
|
|
44226
|
-
ch = source$1[index$1++];
|
|
44227
|
-
if (!ch || !isLineTerminator$1(ch.charCodeAt(0))) {
|
|
44228
|
-
switch (ch) {
|
|
44229
|
-
case 'u':
|
|
44230
|
-
case 'x':
|
|
44231
|
-
if (source$1[index$1] === '{') {
|
|
44232
|
-
++index$1;
|
|
44233
|
-
str += scanUnicodeCodePointEscape$1();
|
|
44234
|
-
} else {
|
|
44235
|
-
str += scanHexEscape$1(ch);
|
|
44236
|
-
}
|
|
44237
|
-
break;
|
|
44238
|
-
case 'n':
|
|
44239
|
-
str += '\n';
|
|
44240
|
-
break;
|
|
44241
|
-
case 'r':
|
|
44242
|
-
str += '\r';
|
|
44243
|
-
break;
|
|
44244
|
-
case 't':
|
|
44245
|
-
str += '\t';
|
|
44246
|
-
break;
|
|
44247
|
-
case 'b':
|
|
44248
|
-
str += '\b';
|
|
44249
|
-
break;
|
|
44250
|
-
case 'f':
|
|
44251
|
-
str += '\f';
|
|
44252
|
-
break;
|
|
44253
|
-
case 'v':
|
|
44254
|
-
str += '\x0B';
|
|
44255
|
-
break;
|
|
44256
|
-
default:
|
|
44257
|
-
if (isOctalDigit$1(ch)) {
|
|
44258
|
-
code = '01234567'.indexOf(ch);
|
|
44259
|
-
|
|
44260
|
-
// \0 is not octal escape sequence
|
|
44261
|
-
if (code !== 0) {
|
|
44262
|
-
octal = true;
|
|
44263
|
-
}
|
|
44264
|
-
if (index$1 < length$1 && isOctalDigit$1(source$1[index$1])) {
|
|
44265
|
-
octal = true;
|
|
44266
|
-
code = code * 8 + '01234567'.indexOf(source$1[index$1++]);
|
|
44267
|
-
|
|
44268
|
-
// 3 digits are only allowed when string starts
|
|
44269
|
-
// with 0, 1, 2, 3
|
|
44270
|
-
if ('0123'.includes(ch) && index$1 < length$1 && isOctalDigit$1(source$1[index$1])) {
|
|
44271
|
-
code = code * 8 + '01234567'.indexOf(source$1[index$1++]);
|
|
44272
|
-
}
|
|
44273
|
-
}
|
|
44274
|
-
str += String.fromCharCode(code);
|
|
44275
|
-
} else {
|
|
44276
|
-
str += ch;
|
|
44277
|
-
}
|
|
44278
|
-
break;
|
|
44279
|
-
}
|
|
44280
|
-
} else {
|
|
44281
|
-
if (ch === '\r' && source$1[index$1] === '\n') {
|
|
44282
|
-
++index$1;
|
|
44283
|
-
}
|
|
44284
|
-
}
|
|
44285
|
-
} else if (isLineTerminator$1(ch.charCodeAt(0))) {
|
|
44286
|
-
break;
|
|
44287
|
-
} else {
|
|
44288
|
-
str += ch;
|
|
44289
|
-
}
|
|
44290
|
-
}
|
|
44291
|
-
if (quote !== '') {
|
|
44292
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44293
|
-
}
|
|
44294
|
-
return {
|
|
44295
|
-
type: TokenStringLiteral$1,
|
|
44296
|
-
value: str,
|
|
44297
|
-
octal: octal,
|
|
44298
|
-
start: start,
|
|
44299
|
-
end: index$1
|
|
44300
|
-
};
|
|
44301
|
-
}
|
|
44302
|
-
function testRegExp$1(pattern, flags) {
|
|
44303
|
-
let tmp = pattern;
|
|
44304
|
-
if (flags.includes('u')) {
|
|
44305
|
-
// Replace each astral symbol and every Unicode code point
|
|
44306
|
-
// escape sequence with a single ASCII symbol to avoid throwing on
|
|
44307
|
-
// regular expressions that are only valid in combination with the
|
|
44308
|
-
// `/u` flag.
|
|
44309
|
-
// Note: replacing with the ASCII symbol `x` might cause false
|
|
44310
|
-
// negatives in unlikely scenarios. For example, `[\u{61}-b]` is a
|
|
44311
|
-
// perfectly valid pattern that is equivalent to `[a-b]`, but it
|
|
44312
|
-
// would be replaced by `[x-b]` which throws an error.
|
|
44313
|
-
tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}/g, ($0, $1) => {
|
|
44314
|
-
if (parseInt($1, 16) <= 0x10FFFF) {
|
|
44315
|
-
return 'x';
|
|
44316
|
-
}
|
|
44317
|
-
throwError$1({}, MessageInvalidRegExp$1);
|
|
44318
|
-
}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, 'x');
|
|
44319
|
-
}
|
|
44320
|
-
|
|
44321
|
-
// Return a regular expression object for this pattern-flag pair, or
|
|
44322
|
-
// `null` in case the current environment doesn't support the flags it
|
|
44323
|
-
// uses.
|
|
44324
|
-
try {
|
|
44325
|
-
return new RegExp(pattern, flags);
|
|
44326
|
-
} catch (exception) {
|
|
44327
|
-
return null;
|
|
44328
|
-
}
|
|
44329
|
-
}
|
|
44330
|
-
function scanRegExpBody$1() {
|
|
44331
|
-
var ch, str, classMarker, terminated, body;
|
|
44332
|
-
ch = source$1[index$1];
|
|
44333
|
-
assert$1(ch === '/', 'Regular expression literal must start with a slash');
|
|
44334
|
-
str = source$1[index$1++];
|
|
44335
|
-
classMarker = false;
|
|
44336
|
-
terminated = false;
|
|
44337
|
-
while (index$1 < length$1) {
|
|
44338
|
-
ch = source$1[index$1++];
|
|
44339
|
-
str += ch;
|
|
44340
|
-
if (ch === '\\') {
|
|
44341
|
-
ch = source$1[index$1++];
|
|
44342
|
-
// ECMA-262 7.8.5
|
|
44343
|
-
if (isLineTerminator$1(ch.charCodeAt(0))) {
|
|
44344
|
-
throwError$1({}, MessageUnterminatedRegExp$1);
|
|
44345
|
-
}
|
|
44346
|
-
str += ch;
|
|
44347
|
-
} else if (isLineTerminator$1(ch.charCodeAt(0))) {
|
|
44348
|
-
throwError$1({}, MessageUnterminatedRegExp$1);
|
|
44349
|
-
} else if (classMarker) {
|
|
44350
|
-
if (ch === ']') {
|
|
44351
|
-
classMarker = false;
|
|
44352
|
-
}
|
|
44353
|
-
} else {
|
|
44354
|
-
if (ch === '/') {
|
|
44355
|
-
terminated = true;
|
|
44356
|
-
break;
|
|
44357
|
-
} else if (ch === '[') {
|
|
44358
|
-
classMarker = true;
|
|
44359
|
-
}
|
|
44360
|
-
}
|
|
44361
|
-
}
|
|
44362
|
-
if (!terminated) {
|
|
44363
|
-
throwError$1({}, MessageUnterminatedRegExp$1);
|
|
44364
|
-
}
|
|
44365
|
-
|
|
44366
|
-
// Exclude leading and trailing slash.
|
|
44367
|
-
body = str.substr(1, str.length - 2);
|
|
44368
|
-
return {
|
|
44369
|
-
value: body,
|
|
44370
|
-
literal: str
|
|
44371
|
-
};
|
|
44372
|
-
}
|
|
44373
|
-
function scanRegExpFlags$1() {
|
|
44374
|
-
var ch, str, flags;
|
|
44375
|
-
str = '';
|
|
44376
|
-
flags = '';
|
|
44377
|
-
while (index$1 < length$1) {
|
|
44378
|
-
ch = source$1[index$1];
|
|
44379
|
-
if (!isIdentifierPart$1(ch.charCodeAt(0))) {
|
|
44380
|
-
break;
|
|
44381
|
-
}
|
|
44382
|
-
++index$1;
|
|
44383
|
-
if (ch === '\\' && index$1 < length$1) {
|
|
44384
|
-
throwError$1({}, MessageUnexpectedToken$1, ILLEGAL$1);
|
|
44385
|
-
} else {
|
|
44386
|
-
flags += ch;
|
|
44387
|
-
str += ch;
|
|
44388
|
-
}
|
|
44389
|
-
}
|
|
44390
|
-
if (flags.search(/[^gimuy]/g) >= 0) {
|
|
44391
|
-
throwError$1({}, MessageInvalidRegExp$1, flags);
|
|
44392
|
-
}
|
|
44393
|
-
return {
|
|
44394
|
-
value: flags,
|
|
44395
|
-
literal: str
|
|
44396
|
-
};
|
|
44397
|
-
}
|
|
44398
|
-
function scanRegExp$1() {
|
|
44399
|
-
var start, body, flags, value;
|
|
44400
|
-
lookahead$1 = null;
|
|
44401
|
-
skipComment$1();
|
|
44402
|
-
start = index$1;
|
|
44403
|
-
body = scanRegExpBody$1();
|
|
44404
|
-
flags = scanRegExpFlags$1();
|
|
44405
|
-
value = testRegExp$1(body.value, flags.value);
|
|
44406
|
-
return {
|
|
44407
|
-
literal: body.literal + flags.literal,
|
|
44408
|
-
value: value,
|
|
44409
|
-
regex: {
|
|
44410
|
-
pattern: body.value,
|
|
44411
|
-
flags: flags.value
|
|
44412
|
-
},
|
|
44413
|
-
start: start,
|
|
44414
|
-
end: index$1
|
|
44415
|
-
};
|
|
44416
|
-
}
|
|
44417
|
-
function isIdentifierName$1(token) {
|
|
44418
|
-
return token.type === TokenIdentifier$1 || token.type === TokenKeyword$1 || token.type === TokenBooleanLiteral$1 || token.type === TokenNullLiteral$1;
|
|
44419
|
-
}
|
|
44420
|
-
function advance$1() {
|
|
44421
|
-
skipComment$1();
|
|
44422
|
-
if (index$1 >= length$1) {
|
|
44423
|
-
return {
|
|
44424
|
-
type: TokenEOF$1,
|
|
44425
|
-
start: index$1,
|
|
44426
|
-
end: index$1
|
|
44427
|
-
};
|
|
44428
|
-
}
|
|
44429
|
-
const ch = source$1.charCodeAt(index$1);
|
|
44430
|
-
if (isIdentifierStart$1(ch)) {
|
|
44431
|
-
return scanIdentifier$1();
|
|
44432
|
-
}
|
|
44433
|
-
|
|
44434
|
-
// Very common: ( and ) and ;
|
|
44435
|
-
if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {
|
|
44436
|
-
return scanPunctuator$1();
|
|
44437
|
-
}
|
|
44438
|
-
|
|
44439
|
-
// String literal starts with single quote (U+0027) or double quote (U+0022).
|
|
44440
|
-
if (ch === 0x27 || ch === 0x22) {
|
|
44441
|
-
return scanStringLiteral$1();
|
|
44442
|
-
}
|
|
44443
|
-
|
|
44444
|
-
// Dot (.) U+002E can also start a floating-point number, hence the need
|
|
44445
|
-
// to check the next character.
|
|
44446
|
-
if (ch === 0x2E) {
|
|
44447
|
-
if (isDecimalDigit$1(source$1.charCodeAt(index$1 + 1))) {
|
|
44448
|
-
return scanNumericLiteral$1();
|
|
44449
|
-
}
|
|
44450
|
-
return scanPunctuator$1();
|
|
44451
|
-
}
|
|
44452
|
-
if (isDecimalDigit$1(ch)) {
|
|
44453
|
-
return scanNumericLiteral$1();
|
|
44454
|
-
}
|
|
44455
|
-
return scanPunctuator$1();
|
|
44456
|
-
}
|
|
44457
|
-
function lex$1() {
|
|
44458
|
-
const token = lookahead$1;
|
|
44459
|
-
index$1 = token.end;
|
|
44460
|
-
lookahead$1 = advance$1();
|
|
44461
|
-
index$1 = token.end;
|
|
44462
|
-
return token;
|
|
44463
|
-
}
|
|
44464
|
-
function peek$1() {
|
|
44465
|
-
const pos = index$1;
|
|
44466
|
-
lookahead$1 = advance$1();
|
|
44467
|
-
index$1 = pos;
|
|
44468
|
-
}
|
|
44469
|
-
function finishArrayExpression$1(elements) {
|
|
44470
|
-
const node = new ASTNode$1(SyntaxArrayExpression$1);
|
|
44471
|
-
node.elements = elements;
|
|
44472
|
-
return node;
|
|
44473
|
-
}
|
|
44474
|
-
function finishBinaryExpression$1(operator, left, right) {
|
|
44475
|
-
const node = new ASTNode$1(operator === '||' || operator === '&&' ? SyntaxLogicalExpression$1 : SyntaxBinaryExpression$1);
|
|
44476
|
-
node.operator = operator;
|
|
44477
|
-
node.left = left;
|
|
44478
|
-
node.right = right;
|
|
44479
|
-
return node;
|
|
44480
|
-
}
|
|
44481
|
-
function finishCallExpression$1(callee, args) {
|
|
44482
|
-
const node = new ASTNode$1(SyntaxCallExpression$1);
|
|
44483
|
-
node.callee = callee;
|
|
44484
|
-
node.arguments = args;
|
|
44485
|
-
return node;
|
|
44486
|
-
}
|
|
44487
|
-
function finishConditionalExpression$1(test, consequent, alternate) {
|
|
44488
|
-
const node = new ASTNode$1(SyntaxConditionalExpression$1);
|
|
44489
|
-
node.test = test;
|
|
44490
|
-
node.consequent = consequent;
|
|
44491
|
-
node.alternate = alternate;
|
|
44492
|
-
return node;
|
|
44493
|
-
}
|
|
44494
|
-
function finishIdentifier$1(name) {
|
|
44495
|
-
const node = new ASTNode$1(SyntaxIdentifier$1);
|
|
44496
|
-
node.name = name;
|
|
44497
|
-
return node;
|
|
44498
|
-
}
|
|
44499
|
-
function finishLiteral$1(token) {
|
|
44500
|
-
const node = new ASTNode$1(SyntaxLiteral$1);
|
|
44501
|
-
node.value = token.value;
|
|
44502
|
-
node.raw = source$1.slice(token.start, token.end);
|
|
44503
|
-
if (token.regex) {
|
|
44504
|
-
if (node.raw === '//') {
|
|
44505
|
-
node.raw = '/(?:)/';
|
|
44506
|
-
}
|
|
44507
|
-
node.regex = token.regex;
|
|
44508
|
-
}
|
|
44509
|
-
return node;
|
|
44510
|
-
}
|
|
44511
|
-
function finishMemberExpression$1(accessor, object, property) {
|
|
44512
|
-
const node = new ASTNode$1(SyntaxMemberExpression$1);
|
|
44513
|
-
node.computed = accessor === '[';
|
|
44514
|
-
node.object = object;
|
|
44515
|
-
node.property = property;
|
|
44516
|
-
if (!node.computed) property.member = true;
|
|
44517
|
-
return node;
|
|
44518
|
-
}
|
|
44519
|
-
function finishObjectExpression$1(properties) {
|
|
44520
|
-
const node = new ASTNode$1(SyntaxObjectExpression$1);
|
|
44521
|
-
node.properties = properties;
|
|
44522
|
-
return node;
|
|
44523
|
-
}
|
|
44524
|
-
function finishProperty$1(kind, key, value) {
|
|
44525
|
-
const node = new ASTNode$1(SyntaxProperty$1);
|
|
44526
|
-
node.key = key;
|
|
44527
|
-
node.value = value;
|
|
44528
|
-
node.kind = kind;
|
|
44529
|
-
return node;
|
|
44530
|
-
}
|
|
44531
|
-
function finishUnaryExpression$1(operator, argument) {
|
|
44532
|
-
const node = new ASTNode$1(SyntaxUnaryExpression$1);
|
|
44533
|
-
node.operator = operator;
|
|
44534
|
-
node.argument = argument;
|
|
44535
|
-
node.prefix = true;
|
|
44536
|
-
return node;
|
|
44537
|
-
}
|
|
44538
|
-
|
|
44539
|
-
// Throw an exception
|
|
44540
|
-
|
|
44541
|
-
function throwError$1(token, messageFormat) {
|
|
44542
|
-
var error,
|
|
44543
|
-
args = Array.prototype.slice.call(arguments, 2),
|
|
44544
|
-
msg = messageFormat.replace(/%(\d)/g, (whole, index) => {
|
|
44545
|
-
assert$1(index < args.length, 'Message reference must be in range');
|
|
44546
|
-
return args[index];
|
|
44547
|
-
});
|
|
44548
|
-
error = new Error(msg);
|
|
44549
|
-
error.index = index$1;
|
|
44550
|
-
error.description = msg;
|
|
44551
|
-
throw error;
|
|
44552
|
-
}
|
|
44553
|
-
|
|
44554
|
-
// Throw an exception because of the token.
|
|
44555
|
-
|
|
44556
|
-
function throwUnexpected$1(token) {
|
|
44557
|
-
if (token.type === TokenEOF$1) {
|
|
44558
|
-
throwError$1(token, MessageUnexpectedEOS$1);
|
|
44559
|
-
}
|
|
44560
|
-
if (token.type === TokenNumericLiteral$1) {
|
|
44561
|
-
throwError$1(token, MessageUnexpectedNumber$1);
|
|
44562
|
-
}
|
|
44563
|
-
if (token.type === TokenStringLiteral$1) {
|
|
44564
|
-
throwError$1(token, MessageUnexpectedString$1);
|
|
44565
|
-
}
|
|
44566
|
-
if (token.type === TokenIdentifier$1) {
|
|
44567
|
-
throwError$1(token, MessageUnexpectedIdentifier$1);
|
|
44568
|
-
}
|
|
44569
|
-
if (token.type === TokenKeyword$1) {
|
|
44570
|
-
throwError$1(token, MessageUnexpectedReserved$1);
|
|
44571
|
-
}
|
|
44572
|
-
|
|
44573
|
-
// BooleanLiteral, NullLiteral, or Punctuator.
|
|
44574
|
-
throwError$1(token, MessageUnexpectedToken$1, token.value);
|
|
44575
|
-
}
|
|
44576
|
-
|
|
44577
|
-
// Expect the next token to match the specified punctuator.
|
|
44578
|
-
// If not, an exception will be thrown.
|
|
44579
|
-
|
|
44580
|
-
function expect$1(value) {
|
|
44581
|
-
const token = lex$1();
|
|
44582
|
-
if (token.type !== TokenPunctuator$1 || token.value !== value) {
|
|
44583
|
-
throwUnexpected$1(token);
|
|
44584
|
-
}
|
|
44585
|
-
}
|
|
44586
|
-
|
|
44587
|
-
// Return true if the next token matches the specified punctuator.
|
|
44588
|
-
|
|
44589
|
-
function match$1(value) {
|
|
44590
|
-
return lookahead$1.type === TokenPunctuator$1 && lookahead$1.value === value;
|
|
44591
|
-
}
|
|
44592
|
-
|
|
44593
|
-
// Return true if the next token matches the specified keyword
|
|
44594
|
-
|
|
44595
|
-
function matchKeyword$1(keyword) {
|
|
44596
|
-
return lookahead$1.type === TokenKeyword$1 && lookahead$1.value === keyword;
|
|
44597
|
-
}
|
|
44598
|
-
|
|
44599
|
-
// 11.1.4 Array Initialiser
|
|
44600
|
-
|
|
44601
|
-
function parseArrayInitialiser$1() {
|
|
44602
|
-
const elements = [];
|
|
44603
|
-
index$1 = lookahead$1.start;
|
|
44604
|
-
expect$1('[');
|
|
44605
|
-
while (!match$1(']')) {
|
|
44606
|
-
if (match$1(',')) {
|
|
44607
|
-
lex$1();
|
|
44608
|
-
elements.push(null);
|
|
44609
|
-
} else {
|
|
44610
|
-
elements.push(parseConditionalExpression$1());
|
|
44611
|
-
if (!match$1(']')) {
|
|
44612
|
-
expect$1(',');
|
|
44613
|
-
}
|
|
44614
|
-
}
|
|
44615
|
-
}
|
|
44616
|
-
lex$1();
|
|
44617
|
-
return finishArrayExpression$1(elements);
|
|
44618
|
-
}
|
|
44619
|
-
|
|
44620
|
-
// 11.1.5 Object Initialiser
|
|
44621
|
-
|
|
44622
|
-
function parseObjectPropertyKey$1() {
|
|
44623
|
-
index$1 = lookahead$1.start;
|
|
44624
|
-
const token = lex$1();
|
|
44625
|
-
|
|
44626
|
-
// Note: This function is called only from parseObjectProperty(), where
|
|
44627
|
-
// EOF and Punctuator tokens are already filtered out.
|
|
44628
|
-
|
|
44629
|
-
if (token.type === TokenStringLiteral$1 || token.type === TokenNumericLiteral$1) {
|
|
44630
|
-
if (token.octal) {
|
|
44631
|
-
throwError$1(token, MessageStrictOctalLiteral$1);
|
|
44632
|
-
}
|
|
44633
|
-
return finishLiteral$1(token);
|
|
44634
|
-
}
|
|
44635
|
-
return finishIdentifier$1(token.value);
|
|
44636
|
-
}
|
|
44637
|
-
function parseObjectProperty$1() {
|
|
44638
|
-
var token, key, id, value;
|
|
44639
|
-
index$1 = lookahead$1.start;
|
|
44640
|
-
token = lookahead$1;
|
|
44641
|
-
if (token.type === TokenIdentifier$1) {
|
|
44642
|
-
id = parseObjectPropertyKey$1();
|
|
44643
|
-
expect$1(':');
|
|
44644
|
-
value = parseConditionalExpression$1();
|
|
44645
|
-
return finishProperty$1('init', id, value);
|
|
44646
|
-
}
|
|
44647
|
-
if (token.type === TokenEOF$1 || token.type === TokenPunctuator$1) {
|
|
44648
|
-
throwUnexpected$1(token);
|
|
44649
|
-
} else {
|
|
44650
|
-
key = parseObjectPropertyKey$1();
|
|
44651
|
-
expect$1(':');
|
|
44652
|
-
value = parseConditionalExpression$1();
|
|
44653
|
-
return finishProperty$1('init', key, value);
|
|
44654
|
-
}
|
|
44655
|
-
}
|
|
44656
|
-
function parseObjectInitialiser$1() {
|
|
44657
|
-
var properties = [],
|
|
44658
|
-
property,
|
|
44659
|
-
name,
|
|
44660
|
-
key,
|
|
44661
|
-
map = {},
|
|
44662
|
-
toString = String;
|
|
44663
|
-
index$1 = lookahead$1.start;
|
|
44664
|
-
expect$1('{');
|
|
44665
|
-
while (!match$1('}')) {
|
|
44666
|
-
property = parseObjectProperty$1();
|
|
44667
|
-
if (property.key.type === SyntaxIdentifier$1) {
|
|
44668
|
-
name = property.key.name;
|
|
44669
|
-
} else {
|
|
44670
|
-
name = toString(property.key.value);
|
|
44671
|
-
}
|
|
44672
|
-
key = '$' + name;
|
|
44673
|
-
if (Object.prototype.hasOwnProperty.call(map, key)) {
|
|
44674
|
-
throwError$1({}, MessageStrictDuplicateProperty$1);
|
|
44675
|
-
} else {
|
|
44676
|
-
map[key] = true;
|
|
44677
|
-
}
|
|
44678
|
-
properties.push(property);
|
|
44679
|
-
if (!match$1('}')) {
|
|
44680
|
-
expect$1(',');
|
|
44681
|
-
}
|
|
44682
|
-
}
|
|
44683
|
-
expect$1('}');
|
|
44684
|
-
return finishObjectExpression$1(properties);
|
|
44685
|
-
}
|
|
44686
|
-
|
|
44687
|
-
// 11.1.6 The Grouping Operator
|
|
44688
|
-
|
|
44689
|
-
function parseGroupExpression$1() {
|
|
44690
|
-
expect$1('(');
|
|
44691
|
-
const expr = parseExpression$2();
|
|
44692
|
-
expect$1(')');
|
|
44693
|
-
return expr;
|
|
44694
|
-
}
|
|
44695
|
-
|
|
44696
|
-
// 11.1 Primary Expressions
|
|
44697
|
-
|
|
44698
|
-
const legalKeywords$1 = {
|
|
44699
|
-
'if': 1
|
|
44700
|
-
};
|
|
44701
|
-
function parsePrimaryExpression$1() {
|
|
44702
|
-
var type, token, expr;
|
|
44703
|
-
if (match$1('(')) {
|
|
44704
|
-
return parseGroupExpression$1();
|
|
44705
|
-
}
|
|
44706
|
-
if (match$1('[')) {
|
|
44707
|
-
return parseArrayInitialiser$1();
|
|
44708
|
-
}
|
|
44709
|
-
if (match$1('{')) {
|
|
44710
|
-
return parseObjectInitialiser$1();
|
|
44711
|
-
}
|
|
44712
|
-
type = lookahead$1.type;
|
|
44713
|
-
index$1 = lookahead$1.start;
|
|
44714
|
-
if (type === TokenIdentifier$1 || legalKeywords$1[lookahead$1.value]) {
|
|
44715
|
-
expr = finishIdentifier$1(lex$1().value);
|
|
44716
|
-
} else if (type === TokenStringLiteral$1 || type === TokenNumericLiteral$1) {
|
|
44717
|
-
if (lookahead$1.octal) {
|
|
44718
|
-
throwError$1(lookahead$1, MessageStrictOctalLiteral$1);
|
|
44719
|
-
}
|
|
44720
|
-
expr = finishLiteral$1(lex$1());
|
|
44721
|
-
} else if (type === TokenKeyword$1) {
|
|
44722
|
-
throw new Error(DISABLED$1);
|
|
44723
|
-
} else if (type === TokenBooleanLiteral$1) {
|
|
44724
|
-
token = lex$1();
|
|
44725
|
-
token.value = token.value === 'true';
|
|
44726
|
-
expr = finishLiteral$1(token);
|
|
44727
|
-
} else if (type === TokenNullLiteral$1) {
|
|
44728
|
-
token = lex$1();
|
|
44729
|
-
token.value = null;
|
|
44730
|
-
expr = finishLiteral$1(token);
|
|
44731
|
-
} else if (match$1('/') || match$1('/=')) {
|
|
44732
|
-
expr = finishLiteral$1(scanRegExp$1());
|
|
44733
|
-
peek$1();
|
|
44734
|
-
} else {
|
|
44735
|
-
throwUnexpected$1(lex$1());
|
|
44736
|
-
}
|
|
44737
|
-
return expr;
|
|
44738
|
-
}
|
|
44739
|
-
|
|
44740
|
-
// 11.2 Left-Hand-Side Expressions
|
|
44741
|
-
|
|
44742
|
-
function parseArguments$1() {
|
|
44743
|
-
const args = [];
|
|
44744
|
-
expect$1('(');
|
|
44745
|
-
if (!match$1(')')) {
|
|
44746
|
-
while (index$1 < length$1) {
|
|
44747
|
-
args.push(parseConditionalExpression$1());
|
|
44748
|
-
if (match$1(')')) {
|
|
44749
|
-
break;
|
|
44750
|
-
}
|
|
44751
|
-
expect$1(',');
|
|
44752
|
-
}
|
|
44753
|
-
}
|
|
44754
|
-
expect$1(')');
|
|
44755
|
-
return args;
|
|
44756
|
-
}
|
|
44757
|
-
function parseNonComputedProperty$1() {
|
|
44758
|
-
index$1 = lookahead$1.start;
|
|
44759
|
-
const token = lex$1();
|
|
44760
|
-
if (!isIdentifierName$1(token)) {
|
|
44761
|
-
throwUnexpected$1(token);
|
|
44762
|
-
}
|
|
44763
|
-
return finishIdentifier$1(token.value);
|
|
44764
|
-
}
|
|
44765
|
-
function parseNonComputedMember$1() {
|
|
44766
|
-
expect$1('.');
|
|
44767
|
-
return parseNonComputedProperty$1();
|
|
44768
|
-
}
|
|
44769
|
-
function parseComputedMember$1() {
|
|
44770
|
-
expect$1('[');
|
|
44771
|
-
const expr = parseExpression$2();
|
|
44772
|
-
expect$1(']');
|
|
44773
|
-
return expr;
|
|
44774
|
-
}
|
|
44775
|
-
function parseLeftHandSideExpressionAllowCall$1() {
|
|
44776
|
-
var expr, args, property;
|
|
44777
|
-
expr = parsePrimaryExpression$1();
|
|
44778
|
-
for (;;) {
|
|
44779
|
-
if (match$1('.')) {
|
|
44780
|
-
property = parseNonComputedMember$1();
|
|
44781
|
-
expr = finishMemberExpression$1('.', expr, property);
|
|
44782
|
-
} else if (match$1('(')) {
|
|
44783
|
-
args = parseArguments$1();
|
|
44784
|
-
expr = finishCallExpression$1(expr, args);
|
|
44785
|
-
} else if (match$1('[')) {
|
|
44786
|
-
property = parseComputedMember$1();
|
|
44787
|
-
expr = finishMemberExpression$1('[', expr, property);
|
|
44788
|
-
} else {
|
|
44789
|
-
break;
|
|
44790
|
-
}
|
|
44791
|
-
}
|
|
44792
|
-
return expr;
|
|
44793
|
-
}
|
|
44794
|
-
|
|
44795
|
-
// 11.3 Postfix Expressions
|
|
44796
|
-
|
|
44797
|
-
function parsePostfixExpression$1() {
|
|
44798
|
-
const expr = parseLeftHandSideExpressionAllowCall$1();
|
|
44799
|
-
if (lookahead$1.type === TokenPunctuator$1) {
|
|
44800
|
-
if (match$1('++') || match$1('--')) {
|
|
44801
|
-
throw new Error(DISABLED$1);
|
|
44802
|
-
}
|
|
44803
|
-
}
|
|
44804
|
-
return expr;
|
|
44805
|
-
}
|
|
44806
|
-
|
|
44807
|
-
// 11.4 Unary Operators
|
|
44808
|
-
|
|
44809
|
-
function parseUnaryExpression$1() {
|
|
44810
|
-
var token, expr;
|
|
44811
|
-
if (lookahead$1.type !== TokenPunctuator$1 && lookahead$1.type !== TokenKeyword$1) {
|
|
44812
|
-
expr = parsePostfixExpression$1();
|
|
44813
|
-
} else if (match$1('++') || match$1('--')) {
|
|
44814
|
-
throw new Error(DISABLED$1);
|
|
44815
|
-
} else if (match$1('+') || match$1('-') || match$1('~') || match$1('!')) {
|
|
44816
|
-
token = lex$1();
|
|
44817
|
-
expr = parseUnaryExpression$1();
|
|
44818
|
-
expr = finishUnaryExpression$1(token.value, expr);
|
|
44819
|
-
} else if (matchKeyword$1('delete') || matchKeyword$1('void') || matchKeyword$1('typeof')) {
|
|
44820
|
-
throw new Error(DISABLED$1);
|
|
44821
|
-
} else {
|
|
44822
|
-
expr = parsePostfixExpression$1();
|
|
44823
|
-
}
|
|
44824
|
-
return expr;
|
|
44825
|
-
}
|
|
44826
|
-
function binaryPrecedence$1(token) {
|
|
44827
|
-
let prec = 0;
|
|
44828
|
-
if (token.type !== TokenPunctuator$1 && token.type !== TokenKeyword$1) {
|
|
44829
|
-
return 0;
|
|
44830
|
-
}
|
|
44831
|
-
switch (token.value) {
|
|
44832
|
-
case '||':
|
|
44833
|
-
prec = 1;
|
|
44834
|
-
break;
|
|
44835
|
-
case '&&':
|
|
44836
|
-
prec = 2;
|
|
44837
|
-
break;
|
|
44838
|
-
case '|':
|
|
44839
|
-
prec = 3;
|
|
44840
|
-
break;
|
|
44841
|
-
case '^':
|
|
44842
|
-
prec = 4;
|
|
44843
|
-
break;
|
|
44844
|
-
case '&':
|
|
44845
|
-
prec = 5;
|
|
44846
|
-
break;
|
|
44847
|
-
case '==':
|
|
44848
|
-
case '!=':
|
|
44849
|
-
case '===':
|
|
44850
|
-
case '!==':
|
|
44851
|
-
prec = 6;
|
|
44852
|
-
break;
|
|
44853
|
-
case '<':
|
|
44854
|
-
case '>':
|
|
44855
|
-
case '<=':
|
|
44856
|
-
case '>=':
|
|
44857
|
-
case 'instanceof':
|
|
44858
|
-
case 'in':
|
|
44859
|
-
prec = 7;
|
|
44860
|
-
break;
|
|
44861
|
-
case '<<':
|
|
44862
|
-
case '>>':
|
|
44863
|
-
case '>>>':
|
|
44864
|
-
prec = 8;
|
|
44865
|
-
break;
|
|
44866
|
-
case '+':
|
|
44867
|
-
case '-':
|
|
44868
|
-
prec = 9;
|
|
44869
|
-
break;
|
|
44870
|
-
case '*':
|
|
44871
|
-
case '/':
|
|
44872
|
-
case '%':
|
|
44873
|
-
prec = 11;
|
|
44874
|
-
break;
|
|
44875
|
-
}
|
|
44876
|
-
return prec;
|
|
44877
|
-
}
|
|
44878
|
-
|
|
44879
|
-
// 11.5 Multiplicative Operators
|
|
44880
|
-
// 11.6 Additive Operators
|
|
44881
|
-
// 11.7 Bitwise Shift Operators
|
|
44882
|
-
// 11.8 Relational Operators
|
|
44883
|
-
// 11.9 Equality Operators
|
|
44884
|
-
// 11.10 Binary Bitwise Operators
|
|
44885
|
-
// 11.11 Binary Logical Operators
|
|
44886
|
-
|
|
44887
|
-
function parseBinaryExpression$1() {
|
|
44888
|
-
var marker, markers, expr, token, prec, stack, right, operator, left, i;
|
|
44889
|
-
marker = lookahead$1;
|
|
44890
|
-
left = parseUnaryExpression$1();
|
|
44891
|
-
token = lookahead$1;
|
|
44892
|
-
prec = binaryPrecedence$1(token);
|
|
44893
|
-
if (prec === 0) {
|
|
44894
|
-
return left;
|
|
44895
|
-
}
|
|
44896
|
-
token.prec = prec;
|
|
44897
|
-
lex$1();
|
|
44898
|
-
markers = [marker, lookahead$1];
|
|
44899
|
-
right = parseUnaryExpression$1();
|
|
44900
|
-
stack = [left, token, right];
|
|
44901
|
-
while ((prec = binaryPrecedence$1(lookahead$1)) > 0) {
|
|
44902
|
-
// Reduce: make a binary expression from the three topmost entries.
|
|
44903
|
-
while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {
|
|
44904
|
-
right = stack.pop();
|
|
44905
|
-
operator = stack.pop().value;
|
|
44906
|
-
left = stack.pop();
|
|
44907
|
-
markers.pop();
|
|
44908
|
-
expr = finishBinaryExpression$1(operator, left, right);
|
|
44909
|
-
stack.push(expr);
|
|
44910
|
-
}
|
|
44911
|
-
|
|
44912
|
-
// Shift.
|
|
44913
|
-
token = lex$1();
|
|
44914
|
-
token.prec = prec;
|
|
44915
|
-
stack.push(token);
|
|
44916
|
-
markers.push(lookahead$1);
|
|
44917
|
-
expr = parseUnaryExpression$1();
|
|
44918
|
-
stack.push(expr);
|
|
44919
|
-
}
|
|
44920
|
-
|
|
44921
|
-
// Final reduce to clean-up the stack.
|
|
44922
|
-
i = stack.length - 1;
|
|
44923
|
-
expr = stack[i];
|
|
44924
|
-
markers.pop();
|
|
44925
|
-
while (i > 1) {
|
|
44926
|
-
markers.pop();
|
|
44927
|
-
expr = finishBinaryExpression$1(stack[i - 1].value, stack[i - 2], expr);
|
|
44928
|
-
i -= 2;
|
|
44929
|
-
}
|
|
44930
|
-
return expr;
|
|
44931
|
-
}
|
|
44932
|
-
|
|
44933
|
-
// 11.12 Conditional Operator
|
|
44934
|
-
|
|
44935
|
-
function parseConditionalExpression$1() {
|
|
44936
|
-
var expr, consequent, alternate;
|
|
44937
|
-
expr = parseBinaryExpression$1();
|
|
44938
|
-
if (match$1('?')) {
|
|
44939
|
-
lex$1();
|
|
44940
|
-
consequent = parseConditionalExpression$1();
|
|
44941
|
-
expect$1(':');
|
|
44942
|
-
alternate = parseConditionalExpression$1();
|
|
44943
|
-
expr = finishConditionalExpression$1(expr, consequent, alternate);
|
|
44944
|
-
}
|
|
44945
|
-
return expr;
|
|
44946
|
-
}
|
|
44947
|
-
|
|
44948
|
-
// 11.14 Comma Operator
|
|
43242
|
+
return this.getScale(name).params.type;
|
|
43243
|
+
},
|
|
43244
|
+
projectionRef(name) {
|
|
43245
|
+
return this.scaleRef(name);
|
|
43246
|
+
},
|
|
43247
|
+
projectionType(name) {
|
|
43248
|
+
return this.scaleType(name);
|
|
43249
|
+
},
|
|
43250
|
+
// ----
|
|
44949
43251
|
|
|
44950
|
-
|
|
44951
|
-
|
|
44952
|
-
|
|
44953
|
-
|
|
43252
|
+
addData(name, dataScope) {
|
|
43253
|
+
if (hasOwnProperty$1(this.data, name)) {
|
|
43254
|
+
error$1('Duplicate data set name: ' + stringValue(name));
|
|
43255
|
+
}
|
|
43256
|
+
return this.data[name] = dataScope;
|
|
43257
|
+
},
|
|
43258
|
+
getData(name) {
|
|
43259
|
+
if (!this.data[name]) {
|
|
43260
|
+
error$1('Undefined data set name: ' + stringValue(name));
|
|
43261
|
+
}
|
|
43262
|
+
return this.data[name];
|
|
43263
|
+
},
|
|
43264
|
+
addDataPipeline(name, entries) {
|
|
43265
|
+
if (hasOwnProperty$1(this.data, name)) {
|
|
43266
|
+
error$1('Duplicate data set name: ' + stringValue(name));
|
|
43267
|
+
}
|
|
43268
|
+
return this.addData(name, DataScope.fromEntries(this, entries));
|
|
44954
43269
|
}
|
|
44955
|
-
|
|
43270
|
+
};
|
|
43271
|
+
function propertyLambda(spec) {
|
|
43272
|
+
return (isArray(spec) ? arrayLambda : objectLambda)(spec);
|
|
44956
43273
|
}
|
|
44957
|
-
function
|
|
44958
|
-
|
|
44959
|
-
|
|
44960
|
-
|
|
44961
|
-
|
|
44962
|
-
|
|
44963
|
-
const expr = parseExpression$2();
|
|
44964
|
-
if (lookahead$1.type !== TokenEOF$1) {
|
|
44965
|
-
throw new Error('Unexpect token after expression.');
|
|
43274
|
+
function arrayLambda(array) {
|
|
43275
|
+
const n = array.length;
|
|
43276
|
+
let code = '[';
|
|
43277
|
+
for (let i = 0; i < n; ++i) {
|
|
43278
|
+
const value = array[i];
|
|
43279
|
+
code += (i > 0 ? ',' : '') + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));
|
|
44966
43280
|
}
|
|
44967
|
-
return
|
|
43281
|
+
return code + ']';
|
|
44968
43282
|
}
|
|
44969
|
-
|
|
44970
|
-
|
|
44971
|
-
|
|
44972
|
-
|
|
44973
|
-
|
|
44974
|
-
|
|
44975
|
-
|
|
44976
|
-
|
|
44977
|
-
PI: 'Math.PI',
|
|
44978
|
-
SQRT1_2: 'Math.SQRT1_2',
|
|
44979
|
-
SQRT2: 'Math.SQRT2',
|
|
44980
|
-
MIN_VALUE: 'Number.MIN_VALUE',
|
|
44981
|
-
MAX_VALUE: 'Number.MAX_VALUE'
|
|
44982
|
-
};
|
|
44983
|
-
|
|
44984
|
-
function Functions$1 (codegen) {
|
|
44985
|
-
function fncall(name, args, cast, type) {
|
|
44986
|
-
let obj = codegen(args[0]);
|
|
44987
|
-
if (cast) {
|
|
44988
|
-
obj = cast + '(' + obj + ')';
|
|
44989
|
-
if (cast.lastIndexOf('new ', 0) === 0) obj = '(' + obj + ')';
|
|
44990
|
-
}
|
|
44991
|
-
return obj + '.' + name + (type < 0 ? '' : type === 0 ? '()' : '(' + args.slice(1).map(codegen).join(',') + ')');
|
|
44992
|
-
}
|
|
44993
|
-
function fn(name, cast, type) {
|
|
44994
|
-
return args => fncall(name, args, cast, type);
|
|
43283
|
+
function objectLambda(obj) {
|
|
43284
|
+
let code = '{',
|
|
43285
|
+
i = 0,
|
|
43286
|
+
key,
|
|
43287
|
+
value;
|
|
43288
|
+
for (key in obj) {
|
|
43289
|
+
value = obj[key];
|
|
43290
|
+
code += (++i > 1 ? ',' : '') + stringValue(key) + ':' + (isObject(value) ? value.signal || propertyLambda(value) : stringValue(value));
|
|
44995
43291
|
}
|
|
44996
|
-
|
|
44997
|
-
STRING = 'String',
|
|
44998
|
-
REGEXP = 'RegExp';
|
|
44999
|
-
return {
|
|
45000
|
-
// MATH functions
|
|
45001
|
-
isNaN: 'Number.isNaN',
|
|
45002
|
-
isFinite: 'Number.isFinite',
|
|
45003
|
-
abs: 'Math.abs',
|
|
45004
|
-
acos: 'Math.acos',
|
|
45005
|
-
asin: 'Math.asin',
|
|
45006
|
-
atan: 'Math.atan',
|
|
45007
|
-
atan2: 'Math.atan2',
|
|
45008
|
-
ceil: 'Math.ceil',
|
|
45009
|
-
cos: 'Math.cos',
|
|
45010
|
-
exp: 'Math.exp',
|
|
45011
|
-
floor: 'Math.floor',
|
|
45012
|
-
hypot: 'Math.hypot',
|
|
45013
|
-
log: 'Math.log',
|
|
45014
|
-
max: 'Math.max',
|
|
45015
|
-
min: 'Math.min',
|
|
45016
|
-
pow: 'Math.pow',
|
|
45017
|
-
random: 'Math.random',
|
|
45018
|
-
round: 'Math.round',
|
|
45019
|
-
sin: 'Math.sin',
|
|
45020
|
-
sqrt: 'Math.sqrt',
|
|
45021
|
-
tan: 'Math.tan',
|
|
45022
|
-
clamp: function (args) {
|
|
45023
|
-
if (args.length < 3) error$1('Missing arguments to clamp function.');
|
|
45024
|
-
if (args.length > 3) error$1('Too many arguments to clamp function.');
|
|
45025
|
-
const a = args.map(codegen);
|
|
45026
|
-
return 'Math.max(' + a[1] + ', Math.min(' + a[2] + ',' + a[0] + '))';
|
|
45027
|
-
},
|
|
45028
|
-
// DATE functions
|
|
45029
|
-
now: 'Date.now',
|
|
45030
|
-
utc: 'Date.UTC',
|
|
45031
|
-
datetime: DATE,
|
|
45032
|
-
date: fn('getDate', DATE, 0),
|
|
45033
|
-
day: fn('getDay', DATE, 0),
|
|
45034
|
-
year: fn('getFullYear', DATE, 0),
|
|
45035
|
-
month: fn('getMonth', DATE, 0),
|
|
45036
|
-
hours: fn('getHours', DATE, 0),
|
|
45037
|
-
minutes: fn('getMinutes', DATE, 0),
|
|
45038
|
-
seconds: fn('getSeconds', DATE, 0),
|
|
45039
|
-
milliseconds: fn('getMilliseconds', DATE, 0),
|
|
45040
|
-
time: fn('getTime', DATE, 0),
|
|
45041
|
-
timezoneoffset: fn('getTimezoneOffset', DATE, 0),
|
|
45042
|
-
utcdate: fn('getUTCDate', DATE, 0),
|
|
45043
|
-
utcday: fn('getUTCDay', DATE, 0),
|
|
45044
|
-
utcyear: fn('getUTCFullYear', DATE, 0),
|
|
45045
|
-
utcmonth: fn('getUTCMonth', DATE, 0),
|
|
45046
|
-
utchours: fn('getUTCHours', DATE, 0),
|
|
45047
|
-
utcminutes: fn('getUTCMinutes', DATE, 0),
|
|
45048
|
-
utcseconds: fn('getUTCSeconds', DATE, 0),
|
|
45049
|
-
utcmilliseconds: fn('getUTCMilliseconds', DATE, 0),
|
|
45050
|
-
// sequence functions
|
|
45051
|
-
length: fn('length', null, -1),
|
|
45052
|
-
// STRING functions
|
|
45053
|
-
parseFloat: 'parseFloat',
|
|
45054
|
-
parseInt: 'parseInt',
|
|
45055
|
-
upper: fn('toUpperCase', STRING, 0),
|
|
45056
|
-
lower: fn('toLowerCase', STRING, 0),
|
|
45057
|
-
substring: fn('substring', STRING),
|
|
45058
|
-
split: fn('split', STRING),
|
|
45059
|
-
trim: fn('trim', STRING, 0),
|
|
45060
|
-
// base64 encode/decode
|
|
45061
|
-
btoa: 'btoa',
|
|
45062
|
-
atob: 'atob',
|
|
45063
|
-
// URI encoding
|
|
45064
|
-
encodeURIComponent: 'encodeURIComponent',
|
|
45065
|
-
// REGEXP functions
|
|
45066
|
-
regexp: REGEXP,
|
|
45067
|
-
test: fn('test', REGEXP),
|
|
45068
|
-
// Control Flow functions
|
|
45069
|
-
if: function (args) {
|
|
45070
|
-
if (args.length < 3) error$1('Missing arguments to if function.');
|
|
45071
|
-
if (args.length > 3) error$1('Too many arguments to if function.');
|
|
45072
|
-
const a = args.map(codegen);
|
|
45073
|
-
return '(' + a[0] + '?' + a[1] + ':' + a[2] + ')';
|
|
45074
|
-
}
|
|
45075
|
-
};
|
|
43292
|
+
return code + '}';
|
|
45076
43293
|
}
|
|
45077
43294
|
|
|
45078
|
-
|
|
45079
|
-
|
|
45080
|
-
|
|
45081
|
-
|
|
45082
|
-
|
|
45083
|
-
|
|
45084
|
-
const
|
|
45085
|
-
|
|
45086
|
-
|
|
45087
|
-
|
|
45088
|
-
|
|
45089
|
-
|
|
45090
|
-
|
|
45091
|
-
|
|
45092
|
-
|
|
45093
|
-
|
|
45094
|
-
|
|
45095
|
-
|
|
45096
|
-
|
|
45097
|
-
|
|
45098
|
-
|
|
45099
|
-
|
|
45100
|
-
|
|
45101
|
-
|
|
45102
|
-
|
|
45103
|
-
|
|
45104
|
-
|
|
45105
|
-
|
|
45106
|
-
|
|
45107
|
-
return error$1('Illegal identifier: ' + id);
|
|
45108
|
-
} else if (hasOwnProperty$1(constants, id)) {
|
|
45109
|
-
return constants[id];
|
|
45110
|
-
} else if (hasOwnProperty$1(allowed, id)) {
|
|
45111
|
-
return id;
|
|
45112
|
-
} else {
|
|
45113
|
-
globals[id] = 1;
|
|
45114
|
-
return outputGlobal(id);
|
|
43295
|
+
/**
|
|
43296
|
+
* Standard configuration defaults for Vega specification parsing.
|
|
43297
|
+
* Users can provide their own (sub-)set of these default values
|
|
43298
|
+
* by passing in a config object to the top-level parse method.
|
|
43299
|
+
*/
|
|
43300
|
+
function defaults () {
|
|
43301
|
+
const defaultFont = 'sans-serif',
|
|
43302
|
+
defaultSymbolSize = 30,
|
|
43303
|
+
defaultStrokeWidth = 2,
|
|
43304
|
+
defaultColor = '#4c78a8',
|
|
43305
|
+
black = '#000',
|
|
43306
|
+
gray = '#888',
|
|
43307
|
+
lightGray = '#ddd';
|
|
43308
|
+
return {
|
|
43309
|
+
// default visualization description
|
|
43310
|
+
description: 'Vega visualization',
|
|
43311
|
+
// default padding around visualization
|
|
43312
|
+
padding: 0,
|
|
43313
|
+
// default for automatic sizing; options: 'none', 'pad', 'fit'
|
|
43314
|
+
// or provide an object (e.g., {'type': 'pad', 'resize': true})
|
|
43315
|
+
autosize: 'pad',
|
|
43316
|
+
// default view background color
|
|
43317
|
+
// covers the entire view component
|
|
43318
|
+
background: null,
|
|
43319
|
+
// default event handling configuration
|
|
43320
|
+
// preventDefault for view-sourced event types except 'wheel'
|
|
43321
|
+
events: {
|
|
43322
|
+
defaults: {
|
|
43323
|
+
allow: ['wheel']
|
|
45115
43324
|
}
|
|
45116
43325
|
},
|
|
45117
|
-
|
|
45118
|
-
|
|
45119
|
-
|
|
45120
|
-
|
|
45121
|
-
|
|
45122
|
-
|
|
45123
|
-
|
|
45124
|
-
|
|
45125
|
-
|
|
45126
|
-
if (d) memberDepth -= 1;
|
|
45127
|
-
return o + (d ? '.' + p : '[' + p + ']');
|
|
43326
|
+
// defaults for top-level group marks
|
|
43327
|
+
// accepts mark properties (fill, stroke, etc)
|
|
43328
|
+
// covers the data rectangle within group width/height
|
|
43329
|
+
group: null,
|
|
43330
|
+
// defaults for basic mark types
|
|
43331
|
+
// each subset accepts mark properties (fill, stroke, etc)
|
|
43332
|
+
mark: null,
|
|
43333
|
+
arc: {
|
|
43334
|
+
fill: defaultColor
|
|
45128
43335
|
},
|
|
45129
|
-
|
|
45130
|
-
|
|
45131
|
-
|
|
43336
|
+
area: {
|
|
43337
|
+
fill: defaultColor
|
|
43338
|
+
},
|
|
43339
|
+
image: null,
|
|
43340
|
+
line: {
|
|
43341
|
+
stroke: defaultColor,
|
|
43342
|
+
strokeWidth: defaultStrokeWidth
|
|
43343
|
+
},
|
|
43344
|
+
path: {
|
|
43345
|
+
stroke: defaultColor
|
|
43346
|
+
},
|
|
43347
|
+
rect: {
|
|
43348
|
+
fill: defaultColor
|
|
43349
|
+
},
|
|
43350
|
+
rule: {
|
|
43351
|
+
stroke: black
|
|
43352
|
+
},
|
|
43353
|
+
shape: {
|
|
43354
|
+
stroke: defaultColor
|
|
43355
|
+
},
|
|
43356
|
+
symbol: {
|
|
43357
|
+
fill: defaultColor,
|
|
43358
|
+
size: 64
|
|
43359
|
+
},
|
|
43360
|
+
text: {
|
|
43361
|
+
fill: black,
|
|
43362
|
+
font: defaultFont,
|
|
43363
|
+
fontSize: 11
|
|
43364
|
+
},
|
|
43365
|
+
trail: {
|
|
43366
|
+
fill: defaultColor,
|
|
43367
|
+
size: defaultStrokeWidth
|
|
43368
|
+
},
|
|
43369
|
+
// style definitions
|
|
43370
|
+
style: {
|
|
43371
|
+
// axis & legend labels
|
|
43372
|
+
'guide-label': {
|
|
43373
|
+
fill: black,
|
|
43374
|
+
font: defaultFont,
|
|
43375
|
+
fontSize: 10
|
|
43376
|
+
},
|
|
43377
|
+
// axis & legend titles
|
|
43378
|
+
'guide-title': {
|
|
43379
|
+
fill: black,
|
|
43380
|
+
font: defaultFont,
|
|
43381
|
+
fontSize: 11,
|
|
43382
|
+
fontWeight: 'bold'
|
|
43383
|
+
},
|
|
43384
|
+
// headers, including chart title
|
|
43385
|
+
'group-title': {
|
|
43386
|
+
fill: black,
|
|
43387
|
+
font: defaultFont,
|
|
43388
|
+
fontSize: 13,
|
|
43389
|
+
fontWeight: 'bold'
|
|
43390
|
+
},
|
|
43391
|
+
// chart subtitle
|
|
43392
|
+
'group-subtitle': {
|
|
43393
|
+
fill: black,
|
|
43394
|
+
font: defaultFont,
|
|
43395
|
+
fontSize: 12
|
|
43396
|
+
},
|
|
43397
|
+
// defaults for styled point marks in Vega-Lite
|
|
43398
|
+
point: {
|
|
43399
|
+
size: defaultSymbolSize,
|
|
43400
|
+
strokeWidth: defaultStrokeWidth,
|
|
43401
|
+
shape: 'circle'
|
|
43402
|
+
},
|
|
43403
|
+
circle: {
|
|
43404
|
+
size: defaultSymbolSize,
|
|
43405
|
+
strokeWidth: defaultStrokeWidth
|
|
43406
|
+
},
|
|
43407
|
+
square: {
|
|
43408
|
+
size: defaultSymbolSize,
|
|
43409
|
+
strokeWidth: defaultStrokeWidth,
|
|
43410
|
+
shape: 'square'
|
|
43411
|
+
},
|
|
43412
|
+
// defaults for styled group marks in Vega-Lite
|
|
43413
|
+
cell: {
|
|
43414
|
+
fill: 'transparent',
|
|
43415
|
+
stroke: lightGray
|
|
43416
|
+
},
|
|
43417
|
+
view: {
|
|
43418
|
+
fill: 'transparent'
|
|
45132
43419
|
}
|
|
45133
|
-
const callee = n.callee.name,
|
|
45134
|
-
args = n.arguments,
|
|
45135
|
-
fn = hasOwnProperty$1(functions, callee) && functions[callee];
|
|
45136
|
-
if (!fn) error$1('Unrecognized function: ' + callee);
|
|
45137
|
-
return isFunction(fn) ? fn(args) : fn + '(' + args.map(visit).join(',') + ')';
|
|
45138
43420
|
},
|
|
45139
|
-
|
|
45140
|
-
|
|
45141
|
-
|
|
45142
|
-
|
|
45143
|
-
|
|
45144
|
-
|
|
45145
|
-
|
|
45146
|
-
|
|
45147
|
-
|
|
45148
|
-
|
|
45149
|
-
|
|
43421
|
+
// defaults for title
|
|
43422
|
+
title: {
|
|
43423
|
+
orient: 'top',
|
|
43424
|
+
anchor: 'middle',
|
|
43425
|
+
offset: 4,
|
|
43426
|
+
subtitlePadding: 3
|
|
43427
|
+
},
|
|
43428
|
+
// defaults for axes
|
|
43429
|
+
axis: {
|
|
43430
|
+
minExtent: 0,
|
|
43431
|
+
maxExtent: 200,
|
|
43432
|
+
bandPosition: 0.5,
|
|
43433
|
+
domain: true,
|
|
43434
|
+
domainWidth: 1,
|
|
43435
|
+
domainColor: gray,
|
|
43436
|
+
grid: false,
|
|
43437
|
+
gridWidth: 1,
|
|
43438
|
+
gridColor: lightGray,
|
|
43439
|
+
labels: true,
|
|
43440
|
+
labelAngle: 0,
|
|
43441
|
+
labelLimit: 180,
|
|
43442
|
+
labelOffset: 0,
|
|
43443
|
+
labelPadding: 2,
|
|
43444
|
+
ticks: true,
|
|
43445
|
+
tickColor: gray,
|
|
43446
|
+
tickOffset: 0,
|
|
43447
|
+
tickRound: true,
|
|
43448
|
+
tickSize: 5,
|
|
43449
|
+
tickWidth: 1,
|
|
43450
|
+
titlePadding: 4
|
|
43451
|
+
},
|
|
43452
|
+
// correction for centering bias
|
|
43453
|
+
axisBand: {
|
|
43454
|
+
tickOffset: -0.5
|
|
43455
|
+
},
|
|
43456
|
+
// defaults for cartographic projection
|
|
43457
|
+
projection: {
|
|
43458
|
+
type: 'mercator'
|
|
43459
|
+
},
|
|
43460
|
+
// defaults for legends
|
|
43461
|
+
legend: {
|
|
43462
|
+
orient: 'right',
|
|
43463
|
+
padding: 0,
|
|
43464
|
+
gridAlign: 'each',
|
|
43465
|
+
columnPadding: 10,
|
|
43466
|
+
rowPadding: 2,
|
|
43467
|
+
symbolDirection: 'vertical',
|
|
43468
|
+
gradientDirection: 'vertical',
|
|
43469
|
+
gradientLength: 200,
|
|
43470
|
+
gradientThickness: 16,
|
|
43471
|
+
gradientStrokeColor: lightGray,
|
|
43472
|
+
gradientStrokeWidth: 0,
|
|
43473
|
+
gradientLabelOffset: 2,
|
|
43474
|
+
labelAlign: 'left',
|
|
43475
|
+
labelBaseline: 'middle',
|
|
43476
|
+
labelLimit: 160,
|
|
43477
|
+
labelOffset: 4,
|
|
43478
|
+
labelOverlap: true,
|
|
43479
|
+
symbolLimit: 30,
|
|
43480
|
+
symbolType: 'circle',
|
|
43481
|
+
symbolSize: 100,
|
|
43482
|
+
symbolOffset: 0,
|
|
43483
|
+
symbolStrokeWidth: 1.5,
|
|
43484
|
+
symbolBaseFillColor: 'transparent',
|
|
43485
|
+
symbolBaseStrokeColor: gray,
|
|
43486
|
+
titleLimit: 180,
|
|
43487
|
+
titleOrient: 'top',
|
|
43488
|
+
titlePadding: 5,
|
|
43489
|
+
layout: {
|
|
43490
|
+
offset: 18,
|
|
43491
|
+
direction: 'horizontal',
|
|
43492
|
+
left: {
|
|
43493
|
+
direction: 'vertical'
|
|
43494
|
+
},
|
|
43495
|
+
right: {
|
|
43496
|
+
direction: 'vertical'
|
|
45150
43497
|
}
|
|
45151
43498
|
}
|
|
45152
|
-
return '{' + n.properties.map(visit).join(',') + '}';
|
|
45153
43499
|
},
|
|
45154
|
-
|
|
45155
|
-
|
|
45156
|
-
|
|
45157
|
-
|
|
45158
|
-
|
|
43500
|
+
// defaults for scale ranges
|
|
43501
|
+
range: {
|
|
43502
|
+
category: {
|
|
43503
|
+
scheme: 'tableau10'
|
|
43504
|
+
},
|
|
43505
|
+
ordinal: {
|
|
43506
|
+
scheme: 'blues'
|
|
43507
|
+
},
|
|
43508
|
+
heatmap: {
|
|
43509
|
+
scheme: 'yellowgreenblue'
|
|
43510
|
+
},
|
|
43511
|
+
ramp: {
|
|
43512
|
+
scheme: 'blues'
|
|
43513
|
+
},
|
|
43514
|
+
diverging: {
|
|
43515
|
+
scheme: 'blueorange',
|
|
43516
|
+
extent: [1, 0]
|
|
43517
|
+
},
|
|
43518
|
+
symbol: ['circle', 'square', 'triangle-up', 'cross', 'diamond', 'triangle-right', 'triangle-down', 'triangle-left']
|
|
45159
43519
|
}
|
|
45160
43520
|
};
|
|
45161
|
-
|
|
45162
|
-
|
|
45163
|
-
|
|
45164
|
-
|
|
45165
|
-
|
|
45166
|
-
};
|
|
45167
|
-
globals = {};
|
|
45168
|
-
fields = {};
|
|
45169
|
-
return result;
|
|
43521
|
+
}
|
|
43522
|
+
|
|
43523
|
+
function parse (spec, config, options) {
|
|
43524
|
+
if (!isObject(spec)) {
|
|
43525
|
+
error$1('Input Vega specification must be an object.');
|
|
45170
43526
|
}
|
|
45171
|
-
|
|
45172
|
-
|
|
45173
|
-
return codegen;
|
|
43527
|
+
config = mergeConfig(defaults(), config, spec.config);
|
|
43528
|
+
return parseView(spec, new Scope(config, options)).toRuntime();
|
|
45174
43529
|
}
|
|
45175
43530
|
|
|
45176
43531
|
var version$1$2 = "6.4.0";
|
|
@@ -45320,7 +43675,7 @@ var vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
45320
43675
|
panPow: panPow,
|
|
45321
43676
|
panSymlog: panSymlog,
|
|
45322
43677
|
parse: parse,
|
|
45323
|
-
parseExpression: parser$
|
|
43678
|
+
parseExpression: parser$3,
|
|
45324
43679
|
parseSelector: eventSelector,
|
|
45325
43680
|
path: path$3,
|
|
45326
43681
|
pathCurves: curves,
|
|
@@ -45330,7 +43685,7 @@ var vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
45330
43685
|
pathRender: pathRender,
|
|
45331
43686
|
pathSymbols: symbols$1,
|
|
45332
43687
|
pathTrail: vg_trail,
|
|
45333
|
-
peek: peek$
|
|
43688
|
+
peek: peek$2,
|
|
45334
43689
|
point: point$2,
|
|
45335
43690
|
projection: projection,
|
|
45336
43691
|
quantileLogNormal: quantileLogNormal,
|
|
@@ -68381,10 +66736,7 @@ var defaultStyle = `#vg-tooltip-element {
|
|
|
68381
66736
|
font-size: 11px;
|
|
68382
66737
|
border-radius: 3px;
|
|
68383
66738
|
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
|
|
68384
|
-
|
|
68385
|
-
background-color: rgba(255, 255, 255, 0.95);
|
|
68386
|
-
border: 1px solid #d9d9d9;
|
|
68387
|
-
color: black;
|
|
66739
|
+
white-space: pre-line;
|
|
68388
66740
|
}
|
|
68389
66741
|
#vg-tooltip-element.visible {
|
|
68390
66742
|
visibility: visible;
|
|
@@ -68405,6 +66757,7 @@ var defaultStyle = `#vg-tooltip-element {
|
|
|
68405
66757
|
text-overflow: ellipsis;
|
|
68406
66758
|
padding-top: 2px;
|
|
68407
66759
|
padding-bottom: 2px;
|
|
66760
|
+
vertical-align: text-top;
|
|
68408
66761
|
}
|
|
68409
66762
|
#vg-tooltip-element table tr td.key {
|
|
68410
66763
|
color: #808080;
|
|
@@ -68418,6 +66771,12 @@ var defaultStyle = `#vg-tooltip-element {
|
|
|
68418
66771
|
max-height: 7em;
|
|
68419
66772
|
text-align: left;
|
|
68420
66773
|
}
|
|
66774
|
+
#vg-tooltip-element {
|
|
66775
|
+
/* The default theme is the light theme. */
|
|
66776
|
+
background-color: rgba(255, 255, 255, 0.95);
|
|
66777
|
+
border: 1px solid #d9d9d9;
|
|
66778
|
+
color: black;
|
|
66779
|
+
}
|
|
68421
66780
|
#vg-tooltip-element.dark-theme {
|
|
68422
66781
|
background-color: rgba(32, 32, 32, 0.9);
|
|
68423
66782
|
border: 1px solid #f5f5f5;
|
|
@@ -69568,7 +67927,7 @@ var hasRequiredRe;
|
|
|
69568
67927
|
function requireRe () {
|
|
69569
67928
|
if (hasRequiredRe) return re.exports;
|
|
69570
67929
|
hasRequiredRe = 1;
|
|
69571
|
-
(function (module, exports) {
|
|
67930
|
+
(function (module, exports$1) {
|
|
69572
67931
|
|
|
69573
67932
|
const {
|
|
69574
67933
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
@@ -69576,14 +67935,14 @@ function requireRe () {
|
|
|
69576
67935
|
MAX_LENGTH,
|
|
69577
67936
|
} = requireConstants();
|
|
69578
67937
|
const debug = requireDebug();
|
|
69579
|
-
exports = module.exports = {};
|
|
67938
|
+
exports$1 = module.exports = {};
|
|
69580
67939
|
|
|
69581
67940
|
// The actual regexps go on exports.re
|
|
69582
|
-
const re = exports.re = [];
|
|
69583
|
-
const safeRe = exports.safeRe = [];
|
|
69584
|
-
const src = exports.src = [];
|
|
69585
|
-
const safeSrc = exports.safeSrc = [];
|
|
69586
|
-
const t = exports.t = {};
|
|
67941
|
+
const re = exports$1.re = [];
|
|
67942
|
+
const safeRe = exports$1.safeRe = [];
|
|
67943
|
+
const src = exports$1.src = [];
|
|
67944
|
+
const safeSrc = exports$1.safeSrc = [];
|
|
67945
|
+
const t = exports$1.t = {};
|
|
69587
67946
|
let R = 0;
|
|
69588
67947
|
|
|
69589
67948
|
const LETTERDASHNUMBER = '[a-zA-Z0-9-]';
|
|
@@ -69747,7 +68106,7 @@ function requireRe () {
|
|
|
69747
68106
|
createToken('LONETILDE', '(?:~>?)');
|
|
69748
68107
|
|
|
69749
68108
|
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
69750
|
-
exports.tildeTrimReplace = '$1~';
|
|
68109
|
+
exports$1.tildeTrimReplace = '$1~';
|
|
69751
68110
|
|
|
69752
68111
|
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
69753
68112
|
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
@@ -69757,7 +68116,7 @@ function requireRe () {
|
|
|
69757
68116
|
createToken('LONECARET', '(?:\\^)');
|
|
69758
68117
|
|
|
69759
68118
|
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
69760
|
-
exports.caretTrimReplace = '$1^';
|
|
68119
|
+
exports$1.caretTrimReplace = '$1^';
|
|
69761
68120
|
|
|
69762
68121
|
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
69763
68122
|
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
@@ -69770,7 +68129,7 @@ function requireRe () {
|
|
|
69770
68129
|
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
|
|
69771
68130
|
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
|
|
69772
68131
|
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
69773
|
-
exports.comparatorTrimReplace = '$1$2$3';
|
|
68132
|
+
exports$1.comparatorTrimReplace = '$1$2$3';
|
|
69774
68133
|
|
|
69775
68134
|
// Something like `1.2.3 - 1.2.4`
|
|
69776
68135
|
// Note that these all use the loose form, because they'll be
|
|
@@ -69804,6 +68163,10 @@ function requireIdentifiers () {
|
|
|
69804
68163
|
|
|
69805
68164
|
const numeric = /^[0-9]+$/;
|
|
69806
68165
|
const compareIdentifiers = (a, b) => {
|
|
68166
|
+
if (typeof a === 'number' && typeof b === 'number') {
|
|
68167
|
+
return a === b ? 0 : a < b ? -1 : 1
|
|
68168
|
+
}
|
|
68169
|
+
|
|
69807
68170
|
const anum = numeric.test(a);
|
|
69808
68171
|
const bnum = numeric.test(b);
|
|
69809
68172
|
|
|
@@ -69946,11 +68309,25 @@ function requireSemver () {
|
|
|
69946
68309
|
other = new SemVer(other, this.options);
|
|
69947
68310
|
}
|
|
69948
68311
|
|
|
69949
|
-
|
|
69950
|
-
|
|
69951
|
-
|
|
69952
|
-
|
|
69953
|
-
|
|
68312
|
+
if (this.major < other.major) {
|
|
68313
|
+
return -1
|
|
68314
|
+
}
|
|
68315
|
+
if (this.major > other.major) {
|
|
68316
|
+
return 1
|
|
68317
|
+
}
|
|
68318
|
+
if (this.minor < other.minor) {
|
|
68319
|
+
return -1
|
|
68320
|
+
}
|
|
68321
|
+
if (this.minor > other.minor) {
|
|
68322
|
+
return 1
|
|
68323
|
+
}
|
|
68324
|
+
if (this.patch < other.patch) {
|
|
68325
|
+
return -1
|
|
68326
|
+
}
|
|
68327
|
+
if (this.patch > other.patch) {
|
|
68328
|
+
return 1
|
|
68329
|
+
}
|
|
68330
|
+
return 0
|
|
69954
68331
|
}
|
|
69955
68332
|
|
|
69956
68333
|
comparePre (other) {
|
|
@@ -70723,6 +69100,7 @@ function requireRange () {
|
|
|
70723
69100
|
// already replaced the hyphen ranges
|
|
70724
69101
|
// turn into a set of JUST comparators.
|
|
70725
69102
|
const parseComparator = (comp, options) => {
|
|
69103
|
+
comp = comp.replace(re[t.BUILD], '');
|
|
70726
69104
|
debug('comp', comp, options);
|
|
70727
69105
|
comp = replaceCarets(comp, options);
|
|
70728
69106
|
debug('caret', comp);
|
|
@@ -71082,6 +69460,10 @@ var embedStyle = `.vega-embed {
|
|
|
71082
69460
|
display: inline-block;
|
|
71083
69461
|
box-sizing: border-box;
|
|
71084
69462
|
}
|
|
69463
|
+
.vega-embed.fit-x {
|
|
69464
|
+
display: block;
|
|
69465
|
+
width: 100%;
|
|
69466
|
+
}
|
|
71085
69467
|
.vega-embed.has-actions {
|
|
71086
69468
|
padding-right: 38px;
|
|
71087
69469
|
}
|
|
@@ -71197,6 +69579,19 @@ var embedStyle = `.vega-embed {
|
|
|
71197
69579
|
}
|
|
71198
69580
|
`;
|
|
71199
69581
|
|
|
69582
|
+
/**
|
|
69583
|
+
* Return true if the string is a valid URL using a supported protocol (absolute paths using HTTP or HTTPS only).
|
|
69584
|
+
*/
|
|
69585
|
+
function isValidEditorURL(url) {
|
|
69586
|
+
let protocol;
|
|
69587
|
+
try {
|
|
69588
|
+
({ protocol } = new URL(url));
|
|
69589
|
+
}
|
|
69590
|
+
catch {
|
|
69591
|
+
return false;
|
|
69592
|
+
}
|
|
69593
|
+
return protocol === 'http:' || protocol === 'https:';
|
|
69594
|
+
}
|
|
71200
69595
|
function mergeDeep(dest, ...src) {
|
|
71201
69596
|
for (const s of src) {
|
|
71202
69597
|
deepMerge_(dest, s);
|
|
@@ -71430,19 +69825,13 @@ async function _embed(el, spec, opts = {}, loader) {
|
|
|
71430
69825
|
});
|
|
71431
69826
|
view.addSignalListener('autosize', (_, autosize) => {
|
|
71432
69827
|
const { type } = autosize;
|
|
71433
|
-
|
|
71434
|
-
|
|
71435
|
-
|
|
71436
|
-
|
|
71437
|
-
|
|
71438
|
-
|
|
71439
|
-
|
|
71440
|
-
}
|
|
71441
|
-
else if (type == 'fit') {
|
|
71442
|
-
container.classList.add('fit-x', 'fit-y');
|
|
71443
|
-
}
|
|
71444
|
-
else {
|
|
71445
|
-
container.classList.remove('fit-x', 'fit-y');
|
|
69828
|
+
const fitX = type == 'fit-x' || type == 'fit';
|
|
69829
|
+
const fitY = type == 'fit-y' || type == 'fit';
|
|
69830
|
+
// Mark the chart wrapper and the root (the same element when actions are
|
|
69831
|
+
// disabled) so the CSS can stretch them.
|
|
69832
|
+
for (const target of new Set([container, element])) {
|
|
69833
|
+
target.classList.toggle('fit-x', fitX);
|
|
69834
|
+
target.classList.toggle('fit-y', fitY);
|
|
71446
69835
|
}
|
|
71447
69836
|
});
|
|
71448
69837
|
if (opts.tooltip !== false) {
|
|
@@ -71539,8 +69928,12 @@ async function _embed(el, spec, opts = {}, loader) {
|
|
|
71539
69928
|
ctrl.append(compileLink);
|
|
71540
69929
|
}
|
|
71541
69930
|
// add 'Open in Vega Editor' action
|
|
71542
|
-
|
|
71543
|
-
|
|
69931
|
+
const editorUrl = opts.editorUrl ?? 'https://vega.github.io/editor/';
|
|
69932
|
+
const showEditorAction = actions === true || actions.editor !== false;
|
|
69933
|
+
if (showEditorAction && !isValidEditorURL(editorUrl)) {
|
|
69934
|
+
logger$1.warn(`Ignoring the editor action since editorUrl is not an http or https url: ${editorUrl}`);
|
|
69935
|
+
}
|
|
69936
|
+
else if (showEditorAction) {
|
|
71544
69937
|
const editorLink = document.createElement('a');
|
|
71545
69938
|
editorLink.text = i18n.EDITOR_ACTION;
|
|
71546
69939
|
editorLink.href = '#';
|