Expose XPCServiceMain in a WebProcess header rather than WKProcessPool
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / External / Esprima / esprima.js
1 (function webpackUniversalModuleDefinition(root, factory) {
2 /* istanbul ignore next */
3     if(typeof exports === 'object' && typeof module === 'object')
4         module.exports = factory();
5     else if(typeof define === 'function' && define.amd)
6         define([], factory);
7 /* istanbul ignore next */
8     else if(typeof exports === 'object')
9         exports["esprima"] = factory();
10     else
11         root["esprima"] = factory();
12 })(this, function() {
13 return /******/ (function(modules) { // webpackBootstrap
14 /******/     // The module cache
15 /******/     var installedModules = {};
16
17 /******/     // The require function
18 /******/     function __webpack_require__(moduleId) {
19
20 /******/         // Check if module is in cache
21 /* istanbul ignore if */
22 /******/         if(installedModules[moduleId])
23 /******/             return installedModules[moduleId].exports;
24
25 /******/         // Create a new module (and put it into the cache)
26 /******/         var module = installedModules[moduleId] = {
27 /******/             exports: {},
28 /******/             id: moduleId,
29 /******/             loaded: false
30 /******/         };
31
32 /******/         // Execute the module function
33 /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
34
35 /******/         // Flag the module as loaded
36 /******/         module.loaded = true;
37
38 /******/         // Return the exports of the module
39 /******/         return module.exports;
40 /******/     }
41
42
43 /******/     // expose the modules object (__webpack_modules__)
44 /******/     __webpack_require__.m = modules;
45
46 /******/     // expose the module cache
47 /******/     __webpack_require__.c = installedModules;
48
49 /******/     // __webpack_public_path__
50 /******/     __webpack_require__.p = "";
51
52 /******/     // Load entry module and return exports
53 /******/     return __webpack_require__(0);
54 /******/ })
55 /************************************************************************/
56 /******/ ([
57 /* 0 */
58 /***/ function(module, exports, __webpack_require__) {
59
60     /*
61       Copyright JS Foundation and other contributors, https://js.foundation/
62
63       Redistribution and use in source and binary forms, with or without
64       modification, are permitted provided that the following conditions are met:
65
66         * Redistributions of source code must retain the above copyright
67           notice, this list of conditions and the following disclaimer.
68         * Redistributions in binary form must reproduce the above copyright
69           notice, this list of conditions and the following disclaimer in the
70           documentation and/or other materials provided with the distribution.
71
72       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
73       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
74       IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
75       ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
76       DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
77       (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
78       LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
79       ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
80       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
81       THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
82     */
83     "use strict";
84     var comment_handler_1 = __webpack_require__(1);
85     var jsx_parser_1 = __webpack_require__(3);
86     var parser_1 = __webpack_require__(8);
87     var tokenizer_1 = __webpack_require__(15);
88     function parse(code, options, delegate) {
89         var commentHandler = null;
90         var proxyDelegate = function (node, metadata) {
91             if (delegate) {
92                 delegate(node, metadata);
93             }
94             if (commentHandler) {
95                 commentHandler.visit(node, metadata);
96             }
97         };
98         var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null;
99         var collectComment = false;
100         if (options) {
101             collectComment = (typeof options.comment === 'boolean' && options.comment);
102             var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment);
103             if (collectComment || attachComment) {
104                 commentHandler = new comment_handler_1.CommentHandler();
105                 commentHandler.attach = attachComment;
106                 options.comment = true;
107                 parserDelegate = proxyDelegate;
108             }
109         }
110         var isModule = false;
111         if (options && typeof options.sourceType === 'string') {
112             isModule = (options.sourceType === 'module');
113         }
114         var parser;
115         if (options && typeof options.jsx === 'boolean' && options.jsx) {
116             parser = new jsx_parser_1.JSXParser(code, options, parserDelegate);
117         }
118         else {
119             parser = new parser_1.Parser(code, options, parserDelegate);
120         }
121         var program = isModule ? parser.parseModule() : parser.parseScript();
122         var ast = program;
123         if (collectComment && commentHandler) {
124             ast.comments = commentHandler.comments;
125         }
126         if (parser.config.tokens) {
127             ast.tokens = parser.tokens;
128         }
129         if (parser.config.tolerant) {
130             ast.errors = parser.errorHandler.errors;
131         }
132         return ast;
133     }
134     exports.parse = parse;
135     function parseModule(code, options, delegate) {
136         var parsingOptions = options || {};
137         parsingOptions.sourceType = 'module';
138         return parse(code, parsingOptions, delegate);
139     }
140     exports.parseModule = parseModule;
141     function parseScript(code, options, delegate) {
142         var parsingOptions = options || {};
143         parsingOptions.sourceType = 'script';
144         return parse(code, parsingOptions, delegate);
145     }
146     exports.parseScript = parseScript;
147     function tokenize(code, options, delegate) {
148         var tokenizer = new tokenizer_1.Tokenizer(code, options);
149         var tokens;
150         tokens = [];
151         try {
152             while (true) {
153                 var token = tokenizer.getNextToken();
154                 if (!token) {
155                     break;
156                 }
157                 if (delegate) {
158                     token = delegate(token);
159                 }
160                 tokens.push(token);
161             }
162         }
163         catch (e) {
164             tokenizer.errorHandler.tolerate(e);
165         }
166         if (tokenizer.errorHandler.tolerant) {
167             tokens.errors = tokenizer.errors();
168         }
169         return tokens;
170     }
171     exports.tokenize = tokenize;
172     var syntax_1 = __webpack_require__(2);
173     exports.Syntax = syntax_1.Syntax;
174     // Sync with *.json manifests.
175     exports.version = '4.0.0-dev';
176
177
178 /***/ },
179 /* 1 */
180 /***/ function(module, exports, __webpack_require__) {
181
182     "use strict";
183     var syntax_1 = __webpack_require__(2);
184     var CommentHandler = (function () {
185         function CommentHandler() {
186             this.attach = false;
187             this.comments = [];
188             this.stack = [];
189             this.leading = [];
190             this.trailing = [];
191         }
192         CommentHandler.prototype.insertInnerComments = function (node, metadata) {
193             //  innnerComments for properties empty block
194             //  `function a() {/** comments **\/}`
195             if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) {
196                 var innerComments = [];
197                 for (var i = this.leading.length - 1; i >= 0; --i) {
198                     var entry = this.leading[i];
199                     if (metadata.end.offset >= entry.start) {
200                         innerComments.unshift(entry.comment);
201                         this.leading.splice(i, 1);
202                         this.trailing.splice(i, 1);
203                     }
204                 }
205                 if (innerComments.length) {
206                     node.innerComments = innerComments;
207                 }
208             }
209         };
210         CommentHandler.prototype.findTrailingComments = function (metadata) {
211             var trailingComments = [];
212             if (this.trailing.length > 0) {
213                 for (var i = this.trailing.length - 1; i >= 0; --i) {
214                     var entry_1 = this.trailing[i];
215                     if (entry_1.start >= metadata.end.offset) {
216                         trailingComments.unshift(entry_1.comment);
217                     }
218                 }
219                 this.trailing.length = 0;
220                 return trailingComments;
221             }
222             var entry = this.stack[this.stack.length - 1];
223             if (entry && entry.node.trailingComments) {
224                 var firstComment = entry.node.trailingComments[0];
225                 if (firstComment && firstComment.range[0] >= metadata.end.offset) {
226                     trailingComments = entry.node.trailingComments;
227                     delete entry.node.trailingComments;
228                 }
229             }
230             return trailingComments;
231         };
232         CommentHandler.prototype.findLeadingComments = function (metadata) {
233             var leadingComments = [];
234             var target;
235             while (this.stack.length > 0) {
236                 var entry = this.stack[this.stack.length - 1];
237                 if (entry && entry.start >= metadata.start.offset) {
238                     target = entry.node;
239                     this.stack.pop();
240                 }
241                 else {
242                     break;
243                 }
244             }
245             if (target) {
246                 var count = target.leadingComments ? target.leadingComments.length : 0;
247                 for (var i = count - 1; i >= 0; --i) {
248                     var comment = target.leadingComments[i];
249                     if (comment.range[1] <= metadata.start.offset) {
250                         leadingComments.unshift(comment);
251                         target.leadingComments.splice(i, 1);
252                     }
253                 }
254                 if (target.leadingComments && target.leadingComments.length === 0) {
255                     delete target.leadingComments;
256                 }
257                 return leadingComments;
258             }
259             for (var i = this.leading.length - 1; i >= 0; --i) {
260                 var entry = this.leading[i];
261                 if (entry.start <= metadata.start.offset) {
262                     leadingComments.unshift(entry.comment);
263                     this.leading.splice(i, 1);
264                 }
265             }
266             return leadingComments;
267         };
268         CommentHandler.prototype.visitNode = function (node, metadata) {
269             if (node.type === syntax_1.Syntax.Program && node.body.length > 0) {
270                 return;
271             }
272             this.insertInnerComments(node, metadata);
273             var trailingComments = this.findTrailingComments(metadata);
274             var leadingComments = this.findLeadingComments(metadata);
275             if (leadingComments.length > 0) {
276                 node.leadingComments = leadingComments;
277             }
278             if (trailingComments.length > 0) {
279                 node.trailingComments = trailingComments;
280             }
281             this.stack.push({
282                 node: node,
283                 start: metadata.start.offset
284             });
285         };
286         CommentHandler.prototype.visitComment = function (node, metadata) {
287             var type = (node.type[0] === 'L') ? 'Line' : 'Block';
288             var comment = {
289                 type: type,
290                 value: node.value
291             };
292             if (node.range) {
293                 comment.range = node.range;
294             }
295             if (node.loc) {
296                 comment.loc = node.loc;
297             }
298             this.comments.push(comment);
299             if (this.attach) {
300                 var entry = {
301                     comment: {
302                         type: type,
303                         value: node.value,
304                         range: [metadata.start.offset, metadata.end.offset]
305                     },
306                     start: metadata.start.offset
307                 };
308                 if (node.loc) {
309                     entry.comment.loc = node.loc;
310                 }
311                 node.type = type;
312                 this.leading.push(entry);
313                 this.trailing.push(entry);
314             }
315         };
316         CommentHandler.prototype.visit = function (node, metadata) {
317             if (node.type === 'LineComment') {
318                 this.visitComment(node, metadata);
319             }
320             else if (node.type === 'BlockComment') {
321                 this.visitComment(node, metadata);
322             }
323             else if (this.attach) {
324                 this.visitNode(node, metadata);
325             }
326         };
327         return CommentHandler;
328     }());
329     exports.CommentHandler = CommentHandler;
330
331
332 /***/ },
333 /* 2 */
334 /***/ function(module, exports) {
335
336     "use strict";
337     exports.Syntax = {
338         AssignmentExpression: 'AssignmentExpression',
339         AssignmentPattern: 'AssignmentPattern',
340         ArrayExpression: 'ArrayExpression',
341         ArrayPattern: 'ArrayPattern',
342         ArrowFunctionExpression: 'ArrowFunctionExpression',
343         AwaitExpression: 'AwaitExpression',
344         BlockStatement: 'BlockStatement',
345         BinaryExpression: 'BinaryExpression',
346         BreakStatement: 'BreakStatement',
347         CallExpression: 'CallExpression',
348         CatchClause: 'CatchClause',
349         ClassBody: 'ClassBody',
350         ClassDeclaration: 'ClassDeclaration',
351         ClassExpression: 'ClassExpression',
352         ConditionalExpression: 'ConditionalExpression',
353         ContinueStatement: 'ContinueStatement',
354         DoWhileStatement: 'DoWhileStatement',
355         DebuggerStatement: 'DebuggerStatement',
356         EmptyStatement: 'EmptyStatement',
357         ExportAllDeclaration: 'ExportAllDeclaration',
358         ExportDefaultDeclaration: 'ExportDefaultDeclaration',
359         ExportNamedDeclaration: 'ExportNamedDeclaration',
360         ExportSpecifier: 'ExportSpecifier',
361         ExpressionStatement: 'ExpressionStatement',
362         ForStatement: 'ForStatement',
363         ForOfStatement: 'ForOfStatement',
364         ForInStatement: 'ForInStatement',
365         FunctionDeclaration: 'FunctionDeclaration',
366         FunctionExpression: 'FunctionExpression',
367         Identifier: 'Identifier',
368         IfStatement: 'IfStatement',
369         Import: 'Import',
370         ImportDeclaration: 'ImportDeclaration',
371         ImportDefaultSpecifier: 'ImportDefaultSpecifier',
372         ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
373         ImportSpecifier: 'ImportSpecifier',
374         Literal: 'Literal',
375         LabeledStatement: 'LabeledStatement',
376         LogicalExpression: 'LogicalExpression',
377         MemberExpression: 'MemberExpression',
378         MetaProperty: 'MetaProperty',
379         MethodDefinition: 'MethodDefinition',
380         NewExpression: 'NewExpression',
381         ObjectExpression: 'ObjectExpression',
382         ObjectPattern: 'ObjectPattern',
383         Program: 'Program',
384         Property: 'Property',
385         RestElement: 'RestElement',
386         RestProperty: 'RestProperty',
387         ReturnStatement: 'ReturnStatement',
388         SequenceExpression: 'SequenceExpression',
389         SpreadElement: 'SpreadElement',
390         SpreadProperty: 'SpreadProperty',
391         Super: 'Super',
392         SwitchCase: 'SwitchCase',
393         SwitchStatement: 'SwitchStatement',
394         TaggedTemplateExpression: 'TaggedTemplateExpression',
395         TemplateElement: 'TemplateElement',
396         TemplateLiteral: 'TemplateLiteral',
397         ThisExpression: 'ThisExpression',
398         ThrowStatement: 'ThrowStatement',
399         TryStatement: 'TryStatement',
400         UnaryExpression: 'UnaryExpression',
401         UpdateExpression: 'UpdateExpression',
402         VariableDeclaration: 'VariableDeclaration',
403         VariableDeclarator: 'VariableDeclarator',
404         WhileStatement: 'WhileStatement',
405         WithStatement: 'WithStatement',
406         YieldExpression: 'YieldExpression'
407     };
408
409
410 /***/ },
411 /* 3 */
412 /***/ function(module, exports, __webpack_require__) {
413
414     "use strict";
415 /* istanbul ignore next */
416     var __extends = (this && this.__extends) || function (d, b) {
417         for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
418         function __() { this.constructor = d; }
419         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
420     };
421     var character_1 = __webpack_require__(4);
422     var JSXNode = __webpack_require__(5);
423     var jsx_syntax_1 = __webpack_require__(6);
424     var Node = __webpack_require__(7);
425     var parser_1 = __webpack_require__(8);
426     var token_1 = __webpack_require__(13);
427     var xhtml_entities_1 = __webpack_require__(14);
428     token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier';
429     token_1.TokenName[101 /* Text */] = 'JSXText';
430     // Fully qualified element name, e.g. <svg:path> returns "svg:path"
431     function getQualifiedElementName(elementName) {
432         var qualifiedName;
433         switch (elementName.type) {
434             case jsx_syntax_1.JSXSyntax.JSXIdentifier:
435                 var id = elementName;
436                 qualifiedName = id.name;
437                 break;
438             case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
439                 var ns = elementName;
440                 qualifiedName = getQualifiedElementName(ns.namespace) + ':' +
441                     getQualifiedElementName(ns.name);
442                 break;
443             case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
444                 var expr = elementName;
445                 qualifiedName = getQualifiedElementName(expr.object) + '.' +
446                     getQualifiedElementName(expr.property);
447                 break;
448             /* istanbul ignore next */
449             default:
450                 break;
451         }
452         return qualifiedName;
453     }
454     var JSXParser = (function (_super) {
455         __extends(JSXParser, _super);
456         function JSXParser(code, options, delegate) {
457             return _super.call(this, code, options, delegate) || this;
458         }
459         JSXParser.prototype.parsePrimaryExpression = function () {
460             return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
461         };
462         JSXParser.prototype.startJSX = function () {
463             // Unwind the scanner before the lookahead token.
464             this.scanner.index = this.startMarker.index;
465             this.scanner.lineNumber = this.startMarker.line;
466             this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
467         };
468         JSXParser.prototype.finishJSX = function () {
469             // Prime the next lookahead.
470             this.nextToken();
471         };
472         JSXParser.prototype.reenterJSX = function () {
473             this.startJSX();
474             this.expectJSX('}');
475             // Pop the closing '}' added from the lookahead.
476             if (this.config.tokens) {
477                 this.tokens.pop();
478             }
479         };
480         JSXParser.prototype.createJSXNode = function () {
481             this.collectComments();
482             return {
483                 index: this.scanner.index,
484                 line: this.scanner.lineNumber,
485                 column: this.scanner.index - this.scanner.lineStart
486             };
487         };
488         JSXParser.prototype.createJSXChildNode = function () {
489             return {
490                 index: this.scanner.index,
491                 line: this.scanner.lineNumber,
492                 column: this.scanner.index - this.scanner.lineStart
493             };
494         };
495         JSXParser.prototype.scanXHTMLEntity = function (quote) {
496             var result = '&';
497             var valid = true;
498             var terminated = false;
499             var numeric = false;
500             var hex = false;
501             while (!this.scanner.eof() && valid && !terminated) {
502                 var ch = this.scanner.source[this.scanner.index];
503                 if (ch === quote) {
504                     break;
505                 }
506                 terminated = (ch === ';');
507                 result += ch;
508                 ++this.scanner.index;
509                 if (!terminated) {
510                     switch (result.length) {
511                         case 2:
512                             // e.g. '&#123;'
513                             numeric = (ch === '#');
514                             break;
515                         case 3:
516                             if (numeric) {
517                                 // e.g. '&#x41;'
518                                 hex = (ch === 'x');
519                                 valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0));
520                                 numeric = numeric && !hex;
521                             }
522                             break;
523                         default:
524                             valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0)));
525                             valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0)));
526                             break;
527                     }
528                 }
529             }
530             if (valid && terminated && result.length > 2) {
531                 // e.g. '&#x41;' becomes just '#x41'
532                 var str = result.substr(1, result.length - 2);
533                 if (numeric && str.length > 1) {
534                     result = String.fromCharCode(parseInt(str.substr(1), 10));
535                 }
536                 else if (hex && str.length > 2) {
537                     result = String.fromCharCode(parseInt('0' + str.substr(1), 16));
538                 }
539                 else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) {
540                     result = xhtml_entities_1.XHTMLEntities[str];
541                 }
542             }
543             return result;
544         };
545         // Scan the next JSX token. This replaces Scanner#lex when in JSX mode.
546         JSXParser.prototype.lexJSX = function () {
547             var cp = this.scanner.source.charCodeAt(this.scanner.index);
548             // < > / : = { }
549             if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
550                 var value = this.scanner.source[this.scanner.index++];
551                 return {
552                     type: 7 /* Punctuator */,
553                     value: value,
554                     lineNumber: this.scanner.lineNumber,
555                     lineStart: this.scanner.lineStart,
556                     start: this.scanner.index - 1,
557                     end: this.scanner.index
558                 };
559             }
560             // " '
561             if (cp === 34 || cp === 39) {
562                 var start = this.scanner.index;
563                 var quote = this.scanner.source[this.scanner.index++];
564                 var str = '';
565                 while (!this.scanner.eof()) {
566                     var ch = this.scanner.source[this.scanner.index++];
567                     if (ch === quote) {
568                         break;
569                     }
570                     else if (ch === '&') {
571                         str += this.scanXHTMLEntity(quote);
572                     }
573                     else {
574                         str += ch;
575                     }
576                 }
577                 return {
578                     type: 8 /* StringLiteral */,
579                     value: str,
580                     lineNumber: this.scanner.lineNumber,
581                     lineStart: this.scanner.lineStart,
582                     start: start,
583                     end: this.scanner.index
584                 };
585             }
586             // ... or .
587             if (cp === 46) {
588                 var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
589                 var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2);
590                 var value = (n1 === 46 && n2 === 46) ? '...' : '.';
591                 var start = this.scanner.index;
592                 this.scanner.index += value.length;
593                 return {
594                     type: 7 /* Punctuator */,
595                     value: value,
596                     lineNumber: this.scanner.lineNumber,
597                     lineStart: this.scanner.lineStart,
598                     start: start,
599                     end: this.scanner.index
600                 };
601             }
602             // `
603             if (cp === 96) {
604                 // Only placeholder, since it will be rescanned as a real assignment expression.
605                 return {
606                     type: 10 /* Template */,
607                     value: '',
608                     lineNumber: this.scanner.lineNumber,
609                     lineStart: this.scanner.lineStart,
610                     start: this.scanner.index,
611                     end: this.scanner.index
612                 };
613             }
614             // Identifer can not contain backslash (char code 92).
615             if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) {
616                 var start = this.scanner.index;
617                 ++this.scanner.index;
618                 while (!this.scanner.eof()) {
619                     var ch = this.scanner.source.charCodeAt(this.scanner.index);
620                     if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) {
621                         ++this.scanner.index;
622                     }
623                     else if (ch === 45) {
624                         // Hyphen (char code 45) can be part of an identifier.
625                         ++this.scanner.index;
626                     }
627                     else {
628                         break;
629                     }
630                 }
631                 var id = this.scanner.source.slice(start, this.scanner.index);
632                 return {
633                     type: 100 /* Identifier */,
634                     value: id,
635                     lineNumber: this.scanner.lineNumber,
636                     lineStart: this.scanner.lineStart,
637                     start: start,
638                     end: this.scanner.index
639                 };
640             }
641             return this.scanner.throwUnexpectedToken();
642         };
643         JSXParser.prototype.nextJSXToken = function () {
644             this.collectComments();
645             this.startMarker.index = this.scanner.index;
646             this.startMarker.line = this.scanner.lineNumber;
647             this.startMarker.column = this.scanner.index - this.scanner.lineStart;
648             var token = this.lexJSX();
649             this.lastMarker.index = this.scanner.index;
650             this.lastMarker.line = this.scanner.lineNumber;
651             this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
652             if (this.config.tokens) {
653                 this.tokens.push(this.convertToken(token));
654             }
655             return token;
656         };
657         JSXParser.prototype.nextJSXText = function () {
658             this.startMarker.index = this.scanner.index;
659             this.startMarker.line = this.scanner.lineNumber;
660             this.startMarker.column = this.scanner.index - this.scanner.lineStart;
661             var start = this.scanner.index;
662             var text = '';
663             while (!this.scanner.eof()) {
664                 var ch = this.scanner.source[this.scanner.index];
665                 if (ch === '{' || ch === '<') {
666                     break;
667                 }
668                 ++this.scanner.index;
669                 text += ch;
670                 if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
671                     ++this.scanner.lineNumber;
672                     if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') {
673                         ++this.scanner.index;
674                     }
675                     this.scanner.lineStart = this.scanner.index;
676                 }
677             }
678             this.lastMarker.index = this.scanner.index;
679             this.lastMarker.line = this.scanner.lineNumber;
680             this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
681             var token = {
682                 type: 101 /* Text */,
683                 value: text,
684                 lineNumber: this.scanner.lineNumber,
685                 lineStart: this.scanner.lineStart,
686                 start: start,
687                 end: this.scanner.index
688             };
689             if ((text.length > 0) && this.config.tokens) {
690                 this.tokens.push(this.convertToken(token));
691             }
692             return token;
693         };
694         JSXParser.prototype.peekJSXToken = function () {
695             var state = this.scanner.saveState();
696             this.scanner.scanComments();
697             var next = this.lexJSX();
698             this.scanner.restoreState(state);
699             return next;
700         };
701         // Expect the next JSX token to match the specified punctuator.
702         // If not, an exception will be thrown.
703         JSXParser.prototype.expectJSX = function (value) {
704             var token = this.nextJSXToken();
705             if (token.type !== 7 /* Punctuator */ || token.value !== value) {
706                 this.throwUnexpectedToken(token);
707             }
708         };
709         // Return true if the next JSX token matches the specified punctuator.
710         JSXParser.prototype.matchJSX = function (value) {
711             var next = this.peekJSXToken();
712             return next.type === 7 /* Punctuator */ && next.value === value;
713         };
714         JSXParser.prototype.parseJSXIdentifier = function () {
715             var node = this.createJSXNode();
716             var token = this.nextJSXToken();
717             if (token.type !== 100 /* Identifier */) {
718                 this.throwUnexpectedToken(token);
719             }
720             return this.finalize(node, new JSXNode.JSXIdentifier(token.value));
721         };
722         JSXParser.prototype.parseJSXElementName = function () {
723             var node = this.createJSXNode();
724             var elementName = this.parseJSXIdentifier();
725             if (this.matchJSX(':')) {
726                 var namespace = elementName;
727                 this.expectJSX(':');
728                 var name_1 = this.parseJSXIdentifier();
729                 elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1));
730             }
731             else if (this.matchJSX('.')) {
732                 while (this.matchJSX('.')) {
733                     var object = elementName;
734                     this.expectJSX('.');
735                     var property = this.parseJSXIdentifier();
736                     elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property));
737                 }
738             }
739             return elementName;
740         };
741         JSXParser.prototype.parseJSXAttributeName = function () {
742             var node = this.createJSXNode();
743             var attributeName;
744             var identifier = this.parseJSXIdentifier();
745             if (this.matchJSX(':')) {
746                 var namespace = identifier;
747                 this.expectJSX(':');
748                 var name_2 = this.parseJSXIdentifier();
749                 attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2));
750             }
751             else {
752                 attributeName = identifier;
753             }
754             return attributeName;
755         };
756         JSXParser.prototype.parseJSXStringLiteralAttribute = function () {
757             var node = this.createJSXNode();
758             var token = this.nextJSXToken();
759             if (token.type !== 8 /* StringLiteral */) {
760                 this.throwUnexpectedToken(token);
761             }
762             var raw = this.getTokenRaw(token);
763             return this.finalize(node, new Node.Literal(token.value, raw));
764         };
765         JSXParser.prototype.parseJSXExpressionAttribute = function () {
766             var node = this.createJSXNode();
767             this.expectJSX('{');
768             this.finishJSX();
769             if (this.match('}')) {
770                 this.tolerateError('JSX attributes must only be assigned a non-empty expression');
771             }
772             var expression = this.parseAssignmentExpression();
773             this.reenterJSX();
774             return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
775         };
776         JSXParser.prototype.parseJSXAttributeValue = function () {
777             return this.matchJSX('{') ? this.parseJSXExpressionAttribute() :
778                 this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute();
779         };
780         JSXParser.prototype.parseJSXNameValueAttribute = function () {
781             var node = this.createJSXNode();
782             var name = this.parseJSXAttributeName();
783             var value = null;
784             if (this.matchJSX('=')) {
785                 this.expectJSX('=');
786                 value = this.parseJSXAttributeValue();
787             }
788             return this.finalize(node, new JSXNode.JSXAttribute(name, value));
789         };
790         JSXParser.prototype.parseJSXSpreadAttribute = function () {
791             var node = this.createJSXNode();
792             this.expectJSX('{');
793             this.expectJSX('...');
794             this.finishJSX();
795             var argument = this.parseAssignmentExpression();
796             this.reenterJSX();
797             return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument));
798         };
799         JSXParser.prototype.parseJSXAttributes = function () {
800             var attributes = [];
801             while (!this.matchJSX('/') && !this.matchJSX('>')) {
802                 var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() :
803                     this.parseJSXNameValueAttribute();
804                 attributes.push(attribute);
805             }
806             return attributes;
807         };
808         JSXParser.prototype.parseJSXOpeningElement = function () {
809             var node = this.createJSXNode();
810             this.expectJSX('<');
811             var name = this.parseJSXElementName();
812             var attributes = this.parseJSXAttributes();
813             var selfClosing = this.matchJSX('/');
814             if (selfClosing) {
815                 this.expectJSX('/');
816             }
817             this.expectJSX('>');
818             return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
819         };
820         JSXParser.prototype.parseJSXBoundaryElement = function () {
821             var node = this.createJSXNode();
822             this.expectJSX('<');
823             if (this.matchJSX('/')) {
824                 this.expectJSX('/');
825                 var name_3 = this.parseJSXElementName();
826                 this.expectJSX('>');
827                 return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
828             }
829             var name = this.parseJSXElementName();
830             var attributes = this.parseJSXAttributes();
831             var selfClosing = this.matchJSX('/');
832             if (selfClosing) {
833                 this.expectJSX('/');
834             }
835             this.expectJSX('>');
836             return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
837         };
838         JSXParser.prototype.parseJSXEmptyExpression = function () {
839             var node = this.createJSXChildNode();
840             this.collectComments();
841             this.lastMarker.index = this.scanner.index;
842             this.lastMarker.line = this.scanner.lineNumber;
843             this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
844             return this.finalize(node, new JSXNode.JSXEmptyExpression());
845         };
846         JSXParser.prototype.parseJSXExpressionContainer = function () {
847             var node = this.createJSXNode();
848             this.expectJSX('{');
849             var expression;
850             if (this.matchJSX('}')) {
851                 expression = this.parseJSXEmptyExpression();
852                 this.expectJSX('}');
853             }
854             else {
855                 this.finishJSX();
856                 expression = this.parseAssignmentExpression();
857                 this.reenterJSX();
858             }
859             return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
860         };
861         JSXParser.prototype.parseJSXChildren = function () {
862             var children = [];
863             while (!this.scanner.eof()) {
864                 var node = this.createJSXChildNode();
865                 var token = this.nextJSXText();
866                 if (token.start < token.end) {
867                     var raw = this.getTokenRaw(token);
868                     var child = this.finalize(node, new JSXNode.JSXText(token.value, raw));
869                     children.push(child);
870                 }
871                 if (this.scanner.source[this.scanner.index] === '{') {
872                     var container = this.parseJSXExpressionContainer();
873                     children.push(container);
874                 }
875                 else {
876                     break;
877                 }
878             }
879             return children;
880         };
881         JSXParser.prototype.parseComplexJSXElement = function (el) {
882             var stack = [];
883             while (!this.scanner.eof()) {
884                 el.children = el.children.concat(this.parseJSXChildren());
885                 var node = this.createJSXChildNode();
886                 var element = this.parseJSXBoundaryElement();
887                 if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) {
888                     var opening = element;
889                     if (opening.selfClosing) {
890                         var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null));
891                         el.children.push(child);
892                     }
893                     else {
894                         stack.push(el);
895                         el = { node: node, opening: opening, closing: null, children: [] };
896                     }
897                 }
898                 if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) {
899                     el.closing = element;
900                     var open_1 = getQualifiedElementName(el.opening.name);
901                     var close_1 = getQualifiedElementName(el.closing.name);
902                     if (open_1 !== close_1) {
903                         this.tolerateError('Expected corresponding JSX closing tag for %0', open_1);
904                     }
905                     if (stack.length > 0) {
906                         var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing));
907                         el = stack[stack.length - 1];
908                         el.children.push(child);
909                         stack.pop();
910                     }
911                     else {
912                         break;
913                     }
914                 }
915             }
916             return el;
917         };
918         JSXParser.prototype.parseJSXElement = function () {
919             var node = this.createJSXNode();
920             var opening = this.parseJSXOpeningElement();
921             var children = [];
922             var closing = null;
923             if (!opening.selfClosing) {
924                 var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children });
925                 children = el.children;
926                 closing = el.closing;
927             }
928             return this.finalize(node, new JSXNode.JSXElement(opening, children, closing));
929         };
930         JSXParser.prototype.parseJSXRoot = function () {
931             // Pop the opening '<' added from the lookahead.
932             if (this.config.tokens) {
933                 this.tokens.pop();
934             }
935             this.startJSX();
936             var element = this.parseJSXElement();
937             this.finishJSX();
938             return element;
939         };
940         return JSXParser;
941     }(parser_1.Parser));
942     exports.JSXParser = JSXParser;
943
944
945 /***/ },
946 /* 4 */
947 /***/ function(module, exports) {
948
949     "use strict";
950     // See also tools/generate-unicode-regex.js.
951     var Regex = {
952         // Unicode v8.0.0 NonAsciiIdentifierStart:
953         NonAsciiIdentifierStart: /[\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-\u08B4\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\u0AF9\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-\u0C5A\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\u0D5F-\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-\u13F5\u13F8-\u13FD\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\u19B0-\u19C9\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\u2118-\u211D\u2124\u2126\u2128\u212A-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\uAB70-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
954         // Unicode v8.0.0 NonAsciiIdentifierPart:
955         NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\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-\u08B4\u08E3-\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\u0AF9\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-\u0C5A\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\u0D5F-\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\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\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-\u19DA\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\u2118-\u211D\u2124\u2126\u2128\u212A-\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\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\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-\uAB65\uAB70-\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-\uFE2F\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
956     };
957     exports.Character = {
958         /* tslint:disable:no-bitwise */
959         fromCodePoint: function (cp) {
960             return (cp < 0x10000) ? String.fromCharCode(cp) :
961                 String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
962                     String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
963         },
964         // https://tc39.github.io/ecma262/#sec-white-space
965         isWhiteSpace: function (cp) {
966             return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) ||
967                 (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0);
968         },
969         // https://tc39.github.io/ecma262/#sec-line-terminators
970         isLineTerminator: function (cp) {
971             return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029);
972         },
973         // https://tc39.github.io/ecma262/#sec-names-and-keywords
974         isIdentifierStart: function (cp) {
975             return (cp === 0x24) || (cp === 0x5F) ||
976                 (cp >= 0x41 && cp <= 0x5A) ||
977                 (cp >= 0x61 && cp <= 0x7A) ||
978                 (cp === 0x5C) ||
979                 ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp)));
980         },
981         isIdentifierPart: function (cp) {
982             return (cp === 0x24) || (cp === 0x5F) ||
983                 (cp >= 0x41 && cp <= 0x5A) ||
984                 (cp >= 0x61 && cp <= 0x7A) ||
985                 (cp >= 0x30 && cp <= 0x39) ||
986                 (cp === 0x5C) ||
987                 ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp)));
988         },
989         // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
990         isDecimalDigit: function (cp) {
991             return (cp >= 0x30 && cp <= 0x39); // 0..9
992         },
993         isHexDigit: function (cp) {
994             return (cp >= 0x30 && cp <= 0x39) ||
995                 (cp >= 0x41 && cp <= 0x46) ||
996                 (cp >= 0x61 && cp <= 0x66); // a..f
997         },
998         isOctalDigit: function (cp) {
999             return (cp >= 0x30 && cp <= 0x37); // 0..7
1000         }
1001     };
1002
1003
1004 /***/ },
1005 /* 5 */
1006 /***/ function(module, exports, __webpack_require__) {
1007
1008     "use strict";
1009     var jsx_syntax_1 = __webpack_require__(6);
1010     /* tslint:disable:max-classes-per-file */
1011     var JSXClosingElement = (function () {
1012         function JSXClosingElement(name) {
1013             this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
1014             this.name = name;
1015         }
1016         return JSXClosingElement;
1017     }());
1018     exports.JSXClosingElement = JSXClosingElement;
1019     var JSXElement = (function () {
1020         function JSXElement(openingElement, children, closingElement) {
1021             this.type = jsx_syntax_1.JSXSyntax.JSXElement;
1022             this.openingElement = openingElement;
1023             this.children = children;
1024             this.closingElement = closingElement;
1025         }
1026         return JSXElement;
1027     }());
1028     exports.JSXElement = JSXElement;
1029     var JSXEmptyExpression = (function () {
1030         function JSXEmptyExpression() {
1031             this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression;
1032         }
1033         return JSXEmptyExpression;
1034     }());
1035     exports.JSXEmptyExpression = JSXEmptyExpression;
1036     var JSXExpressionContainer = (function () {
1037         function JSXExpressionContainer(expression) {
1038             this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer;
1039             this.expression = expression;
1040         }
1041         return JSXExpressionContainer;
1042     }());
1043     exports.JSXExpressionContainer = JSXExpressionContainer;
1044     var JSXIdentifier = (function () {
1045         function JSXIdentifier(name) {
1046             this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
1047             this.name = name;
1048         }
1049         return JSXIdentifier;
1050     }());
1051     exports.JSXIdentifier = JSXIdentifier;
1052     var JSXMemberExpression = (function () {
1053         function JSXMemberExpression(object, property) {
1054             this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression;
1055             this.object = object;
1056             this.property = property;
1057         }
1058         return JSXMemberExpression;
1059     }());
1060     exports.JSXMemberExpression = JSXMemberExpression;
1061     var JSXAttribute = (function () {
1062         function JSXAttribute(name, value) {
1063             this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
1064             this.name = name;
1065             this.value = value;
1066         }
1067         return JSXAttribute;
1068     }());
1069     exports.JSXAttribute = JSXAttribute;
1070     var JSXNamespacedName = (function () {
1071         function JSXNamespacedName(namespace, name) {
1072             this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
1073             this.namespace = namespace;
1074             this.name = name;
1075         }
1076         return JSXNamespacedName;
1077     }());
1078     exports.JSXNamespacedName = JSXNamespacedName;
1079     var JSXOpeningElement = (function () {
1080         function JSXOpeningElement(name, selfClosing, attributes) {
1081             this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
1082             this.name = name;
1083             this.selfClosing = selfClosing;
1084             this.attributes = attributes;
1085         }
1086         return JSXOpeningElement;
1087     }());
1088     exports.JSXOpeningElement = JSXOpeningElement;
1089     var JSXSpreadAttribute = (function () {
1090         function JSXSpreadAttribute(argument) {
1091             this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute;
1092             this.argument = argument;
1093         }
1094         return JSXSpreadAttribute;
1095     }());
1096     exports.JSXSpreadAttribute = JSXSpreadAttribute;
1097     var JSXText = (function () {
1098         function JSXText(value, raw) {
1099             this.type = jsx_syntax_1.JSXSyntax.JSXText;
1100             this.value = value;
1101             this.raw = raw;
1102         }
1103         return JSXText;
1104     }());
1105     exports.JSXText = JSXText;
1106
1107
1108 /***/ },
1109 /* 6 */
1110 /***/ function(module, exports) {
1111
1112     "use strict";
1113     exports.JSXSyntax = {
1114         JSXAttribute: 'JSXAttribute',
1115         JSXClosingElement: 'JSXClosingElement',
1116         JSXElement: 'JSXElement',
1117         JSXEmptyExpression: 'JSXEmptyExpression',
1118         JSXExpressionContainer: 'JSXExpressionContainer',
1119         JSXIdentifier: 'JSXIdentifier',
1120         JSXMemberExpression: 'JSXMemberExpression',
1121         JSXNamespacedName: 'JSXNamespacedName',
1122         JSXOpeningElement: 'JSXOpeningElement',
1123         JSXSpreadAttribute: 'JSXSpreadAttribute',
1124         JSXText: 'JSXText'
1125     };
1126
1127
1128 /***/ },
1129 /* 7 */
1130 /***/ function(module, exports, __webpack_require__) {
1131
1132     "use strict";
1133     var syntax_1 = __webpack_require__(2);
1134     /* tslint:disable:max-classes-per-file */
1135     var ArrayExpression = (function () {
1136         function ArrayExpression(elements) {
1137             this.type = syntax_1.Syntax.ArrayExpression;
1138             this.elements = elements;
1139         }
1140         return ArrayExpression;
1141     }());
1142     exports.ArrayExpression = ArrayExpression;
1143     var ArrayPattern = (function () {
1144         function ArrayPattern(elements) {
1145             this.type = syntax_1.Syntax.ArrayPattern;
1146             this.elements = elements;
1147         }
1148         return ArrayPattern;
1149     }());
1150     exports.ArrayPattern = ArrayPattern;
1151     var ArrowFunctionExpression = (function () {
1152         function ArrowFunctionExpression(params, body, expression) {
1153             this.type = syntax_1.Syntax.ArrowFunctionExpression;
1154             this.id = null;
1155             this.params = params;
1156             this.body = body;
1157             this.generator = false;
1158             this.expression = expression;
1159             this.async = false;
1160         }
1161         return ArrowFunctionExpression;
1162     }());
1163     exports.ArrowFunctionExpression = ArrowFunctionExpression;
1164     var AssignmentExpression = (function () {
1165         function AssignmentExpression(operator, left, right) {
1166             this.type = syntax_1.Syntax.AssignmentExpression;
1167             this.operator = operator;
1168             this.left = left;
1169             this.right = right;
1170         }
1171         return AssignmentExpression;
1172     }());
1173     exports.AssignmentExpression = AssignmentExpression;
1174     var AssignmentPattern = (function () {
1175         function AssignmentPattern(left, right) {
1176             this.type = syntax_1.Syntax.AssignmentPattern;
1177             this.left = left;
1178             this.right = right;
1179         }
1180         return AssignmentPattern;
1181     }());
1182     exports.AssignmentPattern = AssignmentPattern;
1183     var AsyncArrowFunctionExpression = (function () {
1184         function AsyncArrowFunctionExpression(params, body, expression) {
1185             this.type = syntax_1.Syntax.ArrowFunctionExpression;
1186             this.id = null;
1187             this.params = params;
1188             this.body = body;
1189             this.generator = false;
1190             this.expression = expression;
1191             this.async = true;
1192         }
1193         return AsyncArrowFunctionExpression;
1194     }());
1195     exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression;
1196     var AsyncFunctionDeclaration = (function () {
1197         function AsyncFunctionDeclaration(id, params, body) {
1198             this.type = syntax_1.Syntax.FunctionDeclaration;
1199             this.id = id;
1200             this.params = params;
1201             this.body = body;
1202             this.generator = false;
1203             this.expression = false;
1204             this.async = true;
1205         }
1206         return AsyncFunctionDeclaration;
1207     }());
1208     exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration;
1209     var AsyncFunctionExpression = (function () {
1210         function AsyncFunctionExpression(id, params, body) {
1211             this.type = syntax_1.Syntax.FunctionExpression;
1212             this.id = id;
1213             this.params = params;
1214             this.body = body;
1215             this.generator = false;
1216             this.expression = false;
1217             this.async = true;
1218         }
1219         return AsyncFunctionExpression;
1220     }());
1221     exports.AsyncFunctionExpression = AsyncFunctionExpression;
1222     var AwaitExpression = (function () {
1223         function AwaitExpression(argument) {
1224             this.type = syntax_1.Syntax.AwaitExpression;
1225             this.argument = argument;
1226         }
1227         return AwaitExpression;
1228     }());
1229     exports.AwaitExpression = AwaitExpression;
1230     var BinaryExpression = (function () {
1231         function BinaryExpression(operator, left, right) {
1232             var logical = (operator === '||' || operator === '&&');
1233             this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression;
1234             this.operator = operator;
1235             this.left = left;
1236             this.right = right;
1237         }
1238         return BinaryExpression;
1239     }());
1240     exports.BinaryExpression = BinaryExpression;
1241     var BlockStatement = (function () {
1242         function BlockStatement(body) {
1243             this.type = syntax_1.Syntax.BlockStatement;
1244             this.body = body;
1245         }
1246         return BlockStatement;
1247     }());
1248     exports.BlockStatement = BlockStatement;
1249     var BreakStatement = (function () {
1250         function BreakStatement(label) {
1251             this.type = syntax_1.Syntax.BreakStatement;
1252             this.label = label;
1253         }
1254         return BreakStatement;
1255     }());
1256     exports.BreakStatement = BreakStatement;
1257     var CallExpression = (function () {
1258         function CallExpression(callee, args) {
1259             this.type = syntax_1.Syntax.CallExpression;
1260             this.callee = callee;
1261             this.arguments = args;
1262         }
1263         return CallExpression;
1264     }());
1265     exports.CallExpression = CallExpression;
1266     var CatchClause = (function () {
1267         function CatchClause(param, body) {
1268             this.type = syntax_1.Syntax.CatchClause;
1269             this.param = param;
1270             this.body = body;
1271         }
1272         return CatchClause;
1273     }());
1274     exports.CatchClause = CatchClause;
1275     var ClassBody = (function () {
1276         function ClassBody(body) {
1277             this.type = syntax_1.Syntax.ClassBody;
1278             this.body = body;
1279         }
1280         return ClassBody;
1281     }());
1282     exports.ClassBody = ClassBody;
1283     var ClassDeclaration = (function () {
1284         function ClassDeclaration(id, superClass, body) {
1285             this.type = syntax_1.Syntax.ClassDeclaration;
1286             this.id = id;
1287             this.superClass = superClass;
1288             this.body = body;
1289         }
1290         return ClassDeclaration;
1291     }());
1292     exports.ClassDeclaration = ClassDeclaration;
1293     var ClassExpression = (function () {
1294         function ClassExpression(id, superClass, body) {
1295             this.type = syntax_1.Syntax.ClassExpression;
1296             this.id = id;
1297             this.superClass = superClass;
1298             this.body = body;
1299         }
1300         return ClassExpression;
1301     }());
1302     exports.ClassExpression = ClassExpression;
1303     var ComputedMemberExpression = (function () {
1304         function ComputedMemberExpression(object, property) {
1305             this.type = syntax_1.Syntax.MemberExpression;
1306             this.computed = true;
1307             this.object = object;
1308             this.property = property;
1309         }
1310         return ComputedMemberExpression;
1311     }());
1312     exports.ComputedMemberExpression = ComputedMemberExpression;
1313     var ConditionalExpression = (function () {
1314         function ConditionalExpression(test, consequent, alternate) {
1315             this.type = syntax_1.Syntax.ConditionalExpression;
1316             this.test = test;
1317             this.consequent = consequent;
1318             this.alternate = alternate;
1319         }
1320         return ConditionalExpression;
1321     }());
1322     exports.ConditionalExpression = ConditionalExpression;
1323     var ContinueStatement = (function () {
1324         function ContinueStatement(label) {
1325             this.type = syntax_1.Syntax.ContinueStatement;
1326             this.label = label;
1327         }
1328         return ContinueStatement;
1329     }());
1330     exports.ContinueStatement = ContinueStatement;
1331     var DebuggerStatement = (function () {
1332         function DebuggerStatement() {
1333             this.type = syntax_1.Syntax.DebuggerStatement;
1334         }
1335         return DebuggerStatement;
1336     }());
1337     exports.DebuggerStatement = DebuggerStatement;
1338     var Directive = (function () {
1339         function Directive(expression, directive) {
1340             this.type = syntax_1.Syntax.ExpressionStatement;
1341             this.expression = expression;
1342             this.directive = directive;
1343         }
1344         return Directive;
1345     }());
1346     exports.Directive = Directive;
1347     var DoWhileStatement = (function () {
1348         function DoWhileStatement(body, test) {
1349             this.type = syntax_1.Syntax.DoWhileStatement;
1350             this.body = body;
1351             this.test = test;
1352         }
1353         return DoWhileStatement;
1354     }());
1355     exports.DoWhileStatement = DoWhileStatement;
1356     var EmptyStatement = (function () {
1357         function EmptyStatement() {
1358             this.type = syntax_1.Syntax.EmptyStatement;
1359         }
1360         return EmptyStatement;
1361     }());
1362     exports.EmptyStatement = EmptyStatement;
1363     var ExportAllDeclaration = (function () {
1364         function ExportAllDeclaration(source) {
1365             this.type = syntax_1.Syntax.ExportAllDeclaration;
1366             this.source = source;
1367         }
1368         return ExportAllDeclaration;
1369     }());
1370     exports.ExportAllDeclaration = ExportAllDeclaration;
1371     var ExportDefaultDeclaration = (function () {
1372         function ExportDefaultDeclaration(declaration) {
1373             this.type = syntax_1.Syntax.ExportDefaultDeclaration;
1374             this.declaration = declaration;
1375         }
1376         return ExportDefaultDeclaration;
1377     }());
1378     exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
1379     var ExportNamedDeclaration = (function () {
1380         function ExportNamedDeclaration(declaration, specifiers, source) {
1381             this.type = syntax_1.Syntax.ExportNamedDeclaration;
1382             this.declaration = declaration;
1383             this.specifiers = specifiers;
1384             this.source = source;
1385         }
1386         return ExportNamedDeclaration;
1387     }());
1388     exports.ExportNamedDeclaration = ExportNamedDeclaration;
1389     var ExportSpecifier = (function () {
1390         function ExportSpecifier(local, exported) {
1391             this.type = syntax_1.Syntax.ExportSpecifier;
1392             this.exported = exported;
1393             this.local = local;
1394         }
1395         return ExportSpecifier;
1396     }());
1397     exports.ExportSpecifier = ExportSpecifier;
1398     var ExpressionStatement = (function () {
1399         function ExpressionStatement(expression) {
1400             this.type = syntax_1.Syntax.ExpressionStatement;
1401             this.expression = expression;
1402         }
1403         return ExpressionStatement;
1404     }());
1405     exports.ExpressionStatement = ExpressionStatement;
1406     var ForInStatement = (function () {
1407         function ForInStatement(left, right, body) {
1408             this.type = syntax_1.Syntax.ForInStatement;
1409             this.left = left;
1410             this.right = right;
1411             this.body = body;
1412             this.each = false;
1413         }
1414         return ForInStatement;
1415     }());
1416     exports.ForInStatement = ForInStatement;
1417     var ForOfStatement = (function () {
1418         function ForOfStatement(left, right, body) {
1419             this.type = syntax_1.Syntax.ForOfStatement;
1420             this.left = left;
1421             this.right = right;
1422             this.body = body;
1423         }
1424         return ForOfStatement;
1425     }());
1426     exports.ForOfStatement = ForOfStatement;
1427     var ForStatement = (function () {
1428         function ForStatement(init, test, update, body) {
1429             this.type = syntax_1.Syntax.ForStatement;
1430             this.init = init;
1431             this.test = test;
1432             this.update = update;
1433             this.body = body;
1434         }
1435         return ForStatement;
1436     }());
1437     exports.ForStatement = ForStatement;
1438     var FunctionDeclaration = (function () {
1439         function FunctionDeclaration(id, params, body, generator) {
1440             this.type = syntax_1.Syntax.FunctionDeclaration;
1441             this.id = id;
1442             this.params = params;
1443             this.body = body;
1444             this.generator = generator;
1445             this.expression = false;
1446             this.async = false;
1447         }
1448         return FunctionDeclaration;
1449     }());
1450     exports.FunctionDeclaration = FunctionDeclaration;
1451     var FunctionExpression = (function () {
1452         function FunctionExpression(id, params, body, generator) {
1453             this.type = syntax_1.Syntax.FunctionExpression;
1454             this.id = id;
1455             this.params = params;
1456             this.body = body;
1457             this.generator = generator;
1458             this.expression = false;
1459             this.async = false;
1460         }
1461         return FunctionExpression;
1462     }());
1463     exports.FunctionExpression = FunctionExpression;
1464     var Identifier = (function () {
1465         function Identifier(name) {
1466             this.type = syntax_1.Syntax.Identifier;
1467             this.name = name;
1468         }
1469         return Identifier;
1470     }());
1471     exports.Identifier = Identifier;
1472     var IfStatement = (function () {
1473         function IfStatement(test, consequent, alternate) {
1474             this.type = syntax_1.Syntax.IfStatement;
1475             this.test = test;
1476             this.consequent = consequent;
1477             this.alternate = alternate;
1478         }
1479         return IfStatement;
1480     }());
1481     exports.IfStatement = IfStatement;
1482     var Import = (function () {
1483         function Import() {
1484             this.type = syntax_1.Syntax.Import;
1485         }
1486         return Import;
1487     }());
1488     exports.Import = Import;
1489     var ImportDeclaration = (function () {
1490         function ImportDeclaration(specifiers, source) {
1491             this.type = syntax_1.Syntax.ImportDeclaration;
1492             this.specifiers = specifiers;
1493             this.source = source;
1494         }
1495         return ImportDeclaration;
1496     }());
1497     exports.ImportDeclaration = ImportDeclaration;
1498     var ImportDefaultSpecifier = (function () {
1499         function ImportDefaultSpecifier(local) {
1500             this.type = syntax_1.Syntax.ImportDefaultSpecifier;
1501             this.local = local;
1502         }
1503         return ImportDefaultSpecifier;
1504     }());
1505     exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
1506     var ImportNamespaceSpecifier = (function () {
1507         function ImportNamespaceSpecifier(local) {
1508             this.type = syntax_1.Syntax.ImportNamespaceSpecifier;
1509             this.local = local;
1510         }
1511         return ImportNamespaceSpecifier;
1512     }());
1513     exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
1514     var ImportSpecifier = (function () {
1515         function ImportSpecifier(local, imported) {
1516             this.type = syntax_1.Syntax.ImportSpecifier;
1517             this.local = local;
1518             this.imported = imported;
1519         }
1520         return ImportSpecifier;
1521     }());
1522     exports.ImportSpecifier = ImportSpecifier;
1523     var LabeledStatement = (function () {
1524         function LabeledStatement(label, body) {
1525             this.type = syntax_1.Syntax.LabeledStatement;
1526             this.label = label;
1527             this.body = body;
1528         }
1529         return LabeledStatement;
1530     }());
1531     exports.LabeledStatement = LabeledStatement;
1532     var Literal = (function () {
1533         function Literal(value, raw) {
1534             this.type = syntax_1.Syntax.Literal;
1535             this.value = value;
1536             this.raw = raw;
1537         }
1538         return Literal;
1539     }());
1540     exports.Literal = Literal;
1541     var MetaProperty = (function () {
1542         function MetaProperty(meta, property) {
1543             this.type = syntax_1.Syntax.MetaProperty;
1544             this.meta = meta;
1545             this.property = property;
1546         }
1547         return MetaProperty;
1548     }());
1549     exports.MetaProperty = MetaProperty;
1550     var MethodDefinition = (function () {
1551         function MethodDefinition(key, computed, value, kind, isStatic) {
1552             this.type = syntax_1.Syntax.MethodDefinition;
1553             this.key = key;
1554             this.computed = computed;
1555             this.value = value;
1556             this.kind = kind;
1557             this.static = isStatic;
1558         }
1559         return MethodDefinition;
1560     }());
1561     exports.MethodDefinition = MethodDefinition;
1562     var Module = (function () {
1563         function Module(body) {
1564             this.type = syntax_1.Syntax.Program;
1565             this.body = body;
1566             this.sourceType = 'module';
1567         }
1568         return Module;
1569     }());
1570     exports.Module = Module;
1571     var NewExpression = (function () {
1572         function NewExpression(callee, args) {
1573             this.type = syntax_1.Syntax.NewExpression;
1574             this.callee = callee;
1575             this.arguments = args;
1576         }
1577         return NewExpression;
1578     }());
1579     exports.NewExpression = NewExpression;
1580     var ObjectExpression = (function () {
1581         function ObjectExpression(properties) {
1582             this.type = syntax_1.Syntax.ObjectExpression;
1583             this.properties = properties;
1584         }
1585         return ObjectExpression;
1586     }());
1587     exports.ObjectExpression = ObjectExpression;
1588     var ObjectPattern = (function () {
1589         function ObjectPattern(properties) {
1590             this.type = syntax_1.Syntax.ObjectPattern;
1591             this.properties = properties;
1592         }
1593         return ObjectPattern;
1594     }());
1595     exports.ObjectPattern = ObjectPattern;
1596     var Property = (function () {
1597         function Property(kind, key, computed, value, method, shorthand) {
1598             this.type = syntax_1.Syntax.Property;
1599             this.key = key;
1600             this.computed = computed;
1601             this.value = value;
1602             this.kind = kind;
1603             this.method = method;
1604             this.shorthand = shorthand;
1605         }
1606         return Property;
1607     }());
1608     exports.Property = Property;
1609     var RegexLiteral = (function () {
1610         function RegexLiteral(value, raw, pattern, flags) {
1611             this.type = syntax_1.Syntax.Literal;
1612             this.value = value;
1613             this.raw = raw;
1614             this.regex = { pattern: pattern, flags: flags };
1615         }
1616         return RegexLiteral;
1617     }());
1618     exports.RegexLiteral = RegexLiteral;
1619     var RestElement = (function () {
1620         function RestElement(argument) {
1621             this.type = syntax_1.Syntax.RestElement;
1622             this.argument = argument;
1623         }
1624         return RestElement;
1625     }());
1626     exports.RestElement = RestElement;
1627     var RestProperty = (function () {
1628         function RestProperty(argument) {
1629             this.type = syntax_1.Syntax.RestProperty;
1630             this.argument = argument;
1631         }
1632         return RestProperty;
1633     }());
1634     exports.RestProperty = RestProperty;
1635     var ReturnStatement = (function () {
1636         function ReturnStatement(argument) {
1637             this.type = syntax_1.Syntax.ReturnStatement;
1638             this.argument = argument;
1639         }
1640         return ReturnStatement;
1641     }());
1642     exports.ReturnStatement = ReturnStatement;
1643     var Script = (function () {
1644         function Script(body) {
1645             this.type = syntax_1.Syntax.Program;
1646             this.body = body;
1647             this.sourceType = 'script';
1648         }
1649         return Script;
1650     }());
1651     exports.Script = Script;
1652     var SequenceExpression = (function () {
1653         function SequenceExpression(expressions) {
1654             this.type = syntax_1.Syntax.SequenceExpression;
1655             this.expressions = expressions;
1656         }
1657         return SequenceExpression;
1658     }());
1659     exports.SequenceExpression = SequenceExpression;
1660     var SpreadElement = (function () {
1661         function SpreadElement(argument) {
1662             this.type = syntax_1.Syntax.SpreadElement;
1663             this.argument = argument;
1664         }
1665         return SpreadElement;
1666     }());
1667     exports.SpreadElement = SpreadElement;
1668     var SpreadProperty = (function () {
1669         function SpreadProperty(argument) {
1670             this.type = syntax_1.Syntax.SpreadProperty;
1671             this.argument = argument;
1672         }
1673         return SpreadProperty;
1674     }());
1675     exports.SpreadProperty = SpreadProperty;
1676     var StaticMemberExpression = (function () {
1677         function StaticMemberExpression(object, property) {
1678             this.type = syntax_1.Syntax.MemberExpression;
1679             this.computed = false;
1680             this.object = object;
1681             this.property = property;
1682         }
1683         return StaticMemberExpression;
1684     }());
1685     exports.StaticMemberExpression = StaticMemberExpression;
1686     var Super = (function () {
1687         function Super() {
1688             this.type = syntax_1.Syntax.Super;
1689         }
1690         return Super;
1691     }());
1692     exports.Super = Super;
1693     var SwitchCase = (function () {
1694         function SwitchCase(test, consequent) {
1695             this.type = syntax_1.Syntax.SwitchCase;
1696             this.test = test;
1697             this.consequent = consequent;
1698         }
1699         return SwitchCase;
1700     }());
1701     exports.SwitchCase = SwitchCase;
1702     var SwitchStatement = (function () {
1703         function SwitchStatement(discriminant, cases) {
1704             this.type = syntax_1.Syntax.SwitchStatement;
1705             this.discriminant = discriminant;
1706             this.cases = cases;
1707         }
1708         return SwitchStatement;
1709     }());
1710     exports.SwitchStatement = SwitchStatement;
1711     var TaggedTemplateExpression = (function () {
1712         function TaggedTemplateExpression(tag, quasi) {
1713             this.type = syntax_1.Syntax.TaggedTemplateExpression;
1714             this.tag = tag;
1715             this.quasi = quasi;
1716         }
1717         return TaggedTemplateExpression;
1718     }());
1719     exports.TaggedTemplateExpression = TaggedTemplateExpression;
1720     var TemplateElement = (function () {
1721         function TemplateElement(value, tail) {
1722             this.type = syntax_1.Syntax.TemplateElement;
1723             this.value = value;
1724             this.tail = tail;
1725         }
1726         return TemplateElement;
1727     }());
1728     exports.TemplateElement = TemplateElement;
1729     var TemplateLiteral = (function () {
1730         function TemplateLiteral(quasis, expressions) {
1731             this.type = syntax_1.Syntax.TemplateLiteral;
1732             this.quasis = quasis;
1733             this.expressions = expressions;
1734         }
1735         return TemplateLiteral;
1736     }());
1737     exports.TemplateLiteral = TemplateLiteral;
1738     var ThisExpression = (function () {
1739         function ThisExpression() {
1740             this.type = syntax_1.Syntax.ThisExpression;
1741         }
1742         return ThisExpression;
1743     }());
1744     exports.ThisExpression = ThisExpression;
1745     var ThrowStatement = (function () {
1746         function ThrowStatement(argument) {
1747             this.type = syntax_1.Syntax.ThrowStatement;
1748             this.argument = argument;
1749         }
1750         return ThrowStatement;
1751     }());
1752     exports.ThrowStatement = ThrowStatement;
1753     var TryStatement = (function () {
1754         function TryStatement(block, handler, finalizer) {
1755             this.type = syntax_1.Syntax.TryStatement;
1756             this.block = block;
1757             this.handler = handler;
1758             this.finalizer = finalizer;
1759         }
1760         return TryStatement;
1761     }());
1762     exports.TryStatement = TryStatement;
1763     var UnaryExpression = (function () {
1764         function UnaryExpression(operator, argument) {
1765             this.type = syntax_1.Syntax.UnaryExpression;
1766             this.operator = operator;
1767             this.argument = argument;
1768             this.prefix = true;
1769         }
1770         return UnaryExpression;
1771     }());
1772     exports.UnaryExpression = UnaryExpression;
1773     var UpdateExpression = (function () {
1774         function UpdateExpression(operator, argument, prefix) {
1775             this.type = syntax_1.Syntax.UpdateExpression;
1776             this.operator = operator;
1777             this.argument = argument;
1778             this.prefix = prefix;
1779         }
1780         return UpdateExpression;
1781     }());
1782     exports.UpdateExpression = UpdateExpression;
1783     var VariableDeclaration = (function () {
1784         function VariableDeclaration(declarations, kind) {
1785             this.type = syntax_1.Syntax.VariableDeclaration;
1786             this.declarations = declarations;
1787             this.kind = kind;
1788         }
1789         return VariableDeclaration;
1790     }());
1791     exports.VariableDeclaration = VariableDeclaration;
1792     var VariableDeclarator = (function () {
1793         function VariableDeclarator(id, init) {
1794             this.type = syntax_1.Syntax.VariableDeclarator;
1795             this.id = id;
1796             this.init = init;
1797         }
1798         return VariableDeclarator;
1799     }());
1800     exports.VariableDeclarator = VariableDeclarator;
1801     var WhileStatement = (function () {
1802         function WhileStatement(test, body) {
1803             this.type = syntax_1.Syntax.WhileStatement;
1804             this.test = test;
1805             this.body = body;
1806         }
1807         return WhileStatement;
1808     }());
1809     exports.WhileStatement = WhileStatement;
1810     var WithStatement = (function () {
1811         function WithStatement(object, body) {
1812             this.type = syntax_1.Syntax.WithStatement;
1813             this.object = object;
1814             this.body = body;
1815         }
1816         return WithStatement;
1817     }());
1818     exports.WithStatement = WithStatement;
1819     var YieldExpression = (function () {
1820         function YieldExpression(argument, delegate) {
1821             this.type = syntax_1.Syntax.YieldExpression;
1822             this.argument = argument;
1823             this.delegate = delegate;
1824         }
1825         return YieldExpression;
1826     }());
1827     exports.YieldExpression = YieldExpression;
1828
1829
1830 /***/ },
1831 /* 8 */
1832 /***/ function(module, exports, __webpack_require__) {
1833
1834     "use strict";
1835     var assert_1 = __webpack_require__(9);
1836     var error_handler_1 = __webpack_require__(10);
1837     var messages_1 = __webpack_require__(11);
1838     var Node = __webpack_require__(7);
1839     var scanner_1 = __webpack_require__(12);
1840     var syntax_1 = __webpack_require__(2);
1841     var token_1 = __webpack_require__(13);
1842     var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder';
1843     var Parser = (function () {
1844         function Parser(code, options, delegate) {
1845             if (options === void 0) { options = {}; }
1846             this.config = {
1847                 range: (typeof options.range === 'boolean') && options.range,
1848                 loc: (typeof options.loc === 'boolean') && options.loc,
1849                 source: null,
1850                 tokens: (typeof options.tokens === 'boolean') && options.tokens,
1851                 comment: (typeof options.comment === 'boolean') && options.comment,
1852                 tolerant: (typeof options.tolerant === 'boolean') && options.tolerant
1853             };
1854             if (this.config.loc && options.source && options.source !== null) {
1855                 this.config.source = String(options.source);
1856             }
1857             this.delegate = delegate;
1858             this.errorHandler = new error_handler_1.ErrorHandler();
1859             this.errorHandler.tolerant = this.config.tolerant;
1860             this.scanner = new scanner_1.Scanner(code, this.errorHandler);
1861             this.scanner.trackComment = this.config.comment;
1862             this.operatorPrecedence = {
1863                 ')': 0,
1864                 ';': 0,
1865                 ',': 0,
1866                 '=': 0,
1867                 ']': 0,
1868                 '||': 1,
1869                 '&&': 2,
1870                 '|': 3,
1871                 '^': 4,
1872                 '&': 5,
1873                 '==': 6,
1874                 '!=': 6,
1875                 '===': 6,
1876                 '!==': 6,
1877                 '<': 7,
1878                 '>': 7,
1879                 '<=': 7,
1880                 '>=': 7,
1881                 '<<': 8,
1882                 '>>': 8,
1883                 '>>>': 8,
1884                 '+': 9,
1885                 '-': 9,
1886                 '*': 11,
1887                 '/': 11,
1888                 '%': 11
1889             };
1890             this.lookahead = {
1891                 type: 2 /* EOF */,
1892                 value: '',
1893                 lineNumber: this.scanner.lineNumber,
1894                 lineStart: 0,
1895                 start: 0,
1896                 end: 0
1897             };
1898             this.hasLineTerminator = false;
1899             this.context = {
1900                 isModule: false,
1901                 await: false,
1902                 allowIn: true,
1903                 allowStrictDirective: true,
1904                 allowYield: true,
1905                 firstCoverInitializedNameError: null,
1906                 isAssignmentTarget: false,
1907                 isBindingElement: false,
1908                 inFunctionBody: false,
1909                 inIteration: false,
1910                 inSwitch: false,
1911                 labelSet: {},
1912                 strict: false
1913             };
1914             this.tokens = [];
1915             this.startMarker = {
1916                 index: 0,
1917                 line: this.scanner.lineNumber,
1918                 column: 0
1919             };
1920             this.lastMarker = {
1921                 index: 0,
1922                 line: this.scanner.lineNumber,
1923                 column: 0
1924             };
1925             this.nextToken();
1926             this.lastMarker = {
1927                 index: this.scanner.index,
1928                 line: this.scanner.lineNumber,
1929                 column: this.scanner.index - this.scanner.lineStart
1930             };
1931         }
1932         Parser.prototype.throwError = function (messageFormat) {
1933             var values = [];
1934             for (var _i = 1; _i < arguments.length; _i++) {
1935                 values[_i - 1] = arguments[_i];
1936             }
1937             var args = Array.prototype.slice.call(arguments, 1);
1938             var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
1939                 assert_1.assert(idx < args.length, 'Message reference must be in range');
1940                 return args[idx];
1941             });
1942             var index = this.lastMarker.index;
1943             var line = this.lastMarker.line;
1944             var column = this.lastMarker.column + 1;
1945             throw this.errorHandler.createError(index, line, column, msg);
1946         };
1947         Parser.prototype.tolerateError = function (messageFormat) {
1948             var values = [];
1949             for (var _i = 1; _i < arguments.length; _i++) {
1950                 values[_i - 1] = arguments[_i];
1951             }
1952             var args = Array.prototype.slice.call(arguments, 1);
1953             var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
1954                 assert_1.assert(idx < args.length, 'Message reference must be in range');
1955                 return args[idx];
1956             });
1957             var index = this.lastMarker.index;
1958             var line = this.scanner.lineNumber;
1959             var column = this.lastMarker.column + 1;
1960             this.errorHandler.tolerateError(index, line, column, msg);
1961         };
1962         // Throw an exception because of the token.
1963         Parser.prototype.unexpectedTokenError = function (token, message) {
1964             var msg = message || messages_1.Messages.UnexpectedToken;
1965             var value;
1966             if (token) {
1967                 if (!message) {
1968                     msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS :
1969                         (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier :
1970                             (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber :
1971                                 (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString :
1972                                     (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate :
1973                                         messages_1.Messages.UnexpectedToken;
1974                     if (token.type === 4 /* Keyword */) {
1975                         if (this.scanner.isFutureReservedWord(token.value)) {
1976                             msg = messages_1.Messages.UnexpectedReserved;
1977                         }
1978                         else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) {
1979                             msg = messages_1.Messages.StrictReservedWord;
1980                         }
1981                     }
1982                 }
1983                 value = token.value;
1984             }
1985             else {
1986                 value = 'ILLEGAL';
1987             }
1988             msg = msg.replace('%0', value);
1989             if (token && typeof token.lineNumber === 'number') {
1990                 var index = token.start;
1991                 var line = token.lineNumber;
1992                 var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column;
1993                 var column = token.start - lastMarkerLineStart + 1;
1994                 return this.errorHandler.createError(index, line, column, msg);
1995             }
1996             else {
1997                 var index = this.lastMarker.index;
1998                 var line = this.lastMarker.line;
1999                 var column = this.lastMarker.column + 1;
2000                 return this.errorHandler.createError(index, line, column, msg);
2001             }
2002         };
2003         Parser.prototype.throwUnexpectedToken = function (token, message) {
2004             throw this.unexpectedTokenError(token, message);
2005         };
2006         Parser.prototype.tolerateUnexpectedToken = function (token, message) {
2007             this.errorHandler.tolerate(this.unexpectedTokenError(token, message));
2008         };
2009         Parser.prototype.collectComments = function () {
2010             if (!this.config.comment) {
2011                 this.scanner.scanComments();
2012             }
2013             else {
2014                 var comments = this.scanner.scanComments();
2015                 if (comments.length > 0 && this.delegate) {
2016                     for (var i = 0; i < comments.length; ++i) {
2017                         var e = comments[i];
2018                         var node = void 0;
2019                         node = {
2020                             type: e.multiLine ? 'BlockComment' : 'LineComment',
2021                             value: this.scanner.source.slice(e.slice[0], e.slice[1])
2022                         };
2023                         if (this.config.range) {
2024                             node.range = e.range;
2025                         }
2026                         if (this.config.loc) {
2027                             node.loc = e.loc;
2028                         }
2029                         var metadata = {
2030                             start: {
2031                                 line: e.loc.start.line,
2032                                 column: e.loc.start.column,
2033                                 offset: e.range[0]
2034                             },
2035                             end: {
2036                                 line: e.loc.end.line,
2037                                 column: e.loc.end.column,
2038                                 offset: e.range[1]
2039                             }
2040                         };
2041                         this.delegate(node, metadata);
2042                     }
2043                 }
2044             }
2045         };
2046         // From internal representation to an external structure
2047         Parser.prototype.getTokenRaw = function (token) {
2048             return this.scanner.source.slice(token.start, token.end);
2049         };
2050         Parser.prototype.convertToken = function (token) {
2051             var t = {
2052                 type: token_1.TokenName[token.type],
2053                 value: this.getTokenRaw(token)
2054             };
2055             if (this.config.range) {
2056                 t.range = [token.start, token.end];
2057             }
2058             if (this.config.loc) {
2059                 t.loc = {
2060                     start: {
2061                         line: this.startMarker.line,
2062                         column: this.startMarker.column
2063                     },
2064                     end: {
2065                         line: this.scanner.lineNumber,
2066                         column: this.scanner.index - this.scanner.lineStart
2067                     }
2068                 };
2069             }
2070             if (token.type === 9 /* RegularExpression */) {
2071                 var pattern = token.pattern;
2072                 var flags = token.flags;
2073                 t.regex = { pattern: pattern, flags: flags };
2074             }
2075             return t;
2076         };
2077         Parser.prototype.nextToken = function () {
2078             var token = this.lookahead;
2079             this.lastMarker.index = this.scanner.index;
2080             this.lastMarker.line = this.scanner.lineNumber;
2081             this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
2082             this.collectComments();
2083             if (this.scanner.index !== this.startMarker.index) {
2084                 this.startMarker.index = this.scanner.index;
2085                 this.startMarker.line = this.scanner.lineNumber;
2086                 this.startMarker.column = this.scanner.index - this.scanner.lineStart;
2087             }
2088             var next = this.scanner.lex();
2089             this.hasLineTerminator = (token.lineNumber !== next.lineNumber);
2090             if (next && this.context.strict && next.type === 3 /* Identifier */) {
2091                 if (this.scanner.isStrictModeReservedWord(next.value)) {
2092                     next.type = 4 /* Keyword */;
2093                 }
2094             }
2095             this.lookahead = next;
2096             if (this.config.tokens && next.type !== 2 /* EOF */) {
2097                 this.tokens.push(this.convertToken(next));
2098             }
2099             return token;
2100         };
2101         Parser.prototype.nextRegexToken = function () {
2102             this.collectComments();
2103             var token = this.scanner.scanRegExp();
2104             if (this.config.tokens) {
2105                 // Pop the previous token, '/' or '/='
2106                 // This is added from the lookahead token.
2107                 this.tokens.pop();
2108                 this.tokens.push(this.convertToken(token));
2109             }
2110             // Prime the next lookahead.
2111             this.lookahead = token;
2112             this.nextToken();
2113             return token;
2114         };
2115         Parser.prototype.createNode = function () {
2116             return {
2117                 index: this.startMarker.index,
2118                 line: this.startMarker.line,
2119                 column: this.startMarker.column
2120             };
2121         };
2122         Parser.prototype.startNode = function (token) {
2123             return {
2124                 index: token.start,
2125                 line: token.lineNumber,
2126                 column: token.start - token.lineStart
2127             };
2128         };
2129         Parser.prototype.finalize = function (marker, node) {
2130             if (this.config.range) {
2131                 node.range = [marker.index, this.lastMarker.index];
2132             }
2133             if (this.config.loc) {
2134                 node.loc = {
2135                     start: {
2136                         line: marker.line,
2137                         column: marker.column,
2138                     },
2139                     end: {
2140                         line: this.lastMarker.line,
2141                         column: this.lastMarker.column
2142                     }
2143                 };
2144                 if (this.config.source) {
2145                     node.loc.source = this.config.source;
2146                 }
2147             }
2148             if (this.delegate) {
2149                 var metadata = {
2150                     start: {
2151                         line: marker.line,
2152                         column: marker.column,
2153                         offset: marker.index
2154                     },
2155                     end: {
2156                         line: this.lastMarker.line,
2157                         column: this.lastMarker.column,
2158                         offset: this.lastMarker.index
2159                     }
2160                 };
2161                 this.delegate(node, metadata);
2162             }
2163             return node;
2164         };
2165         // Expect the next token to match the specified punctuator.
2166         // If not, an exception will be thrown.
2167         Parser.prototype.expect = function (value) {
2168             var token = this.nextToken();
2169             if (token.type !== 7 /* Punctuator */ || token.value !== value) {
2170                 this.throwUnexpectedToken(token);
2171             }
2172         };
2173         // Quietly expect a comma when in tolerant mode, otherwise delegates to expect().
2174         Parser.prototype.expectCommaSeparator = function () {
2175             if (this.config.tolerant) {
2176                 var token = this.lookahead;
2177                 if (token.type === 7 /* Punctuator */ && token.value === ',') {
2178                     this.nextToken();
2179                 }
2180                 else if (token.type === 7 /* Punctuator */ && token.value === ';') {
2181                     this.nextToken();
2182                     this.tolerateUnexpectedToken(token);
2183                 }
2184                 else {
2185                     this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken);
2186                 }
2187             }
2188             else {
2189                 this.expect(',');
2190             }
2191         };
2192         // Expect the next token to match the specified keyword.
2193         // If not, an exception will be thrown.
2194         Parser.prototype.expectKeyword = function (keyword) {
2195             var token = this.nextToken();
2196             if (token.type !== 4 /* Keyword */ || token.value !== keyword) {
2197                 this.throwUnexpectedToken(token);
2198             }
2199         };
2200         // Return true if the next token matches the specified punctuator.
2201         Parser.prototype.match = function (value) {
2202             return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value;
2203         };
2204         // Return true if the next token matches the specified keyword
2205         Parser.prototype.matchKeyword = function (keyword) {
2206             return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword;
2207         };
2208         // Return true if the next token matches the specified contextual keyword
2209         // (where an identifier is sometimes a keyword depending on the context)
2210         Parser.prototype.matchContextualKeyword = function (keyword) {
2211             return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword;
2212         };
2213         // Return true if the next token is an assignment operator
2214         Parser.prototype.matchAssign = function () {
2215             if (this.lookahead.type !== 7 /* Punctuator */) {
2216                 return false;
2217             }
2218             var op = this.lookahead.value;
2219             return op === '=' ||
2220                 op === '*=' ||
2221                 op === '**=' ||
2222                 op === '/=' ||
2223                 op === '%=' ||
2224                 op === '+=' ||
2225                 op === '-=' ||
2226                 op === '<<=' ||
2227                 op === '>>=' ||
2228                 op === '>>>=' ||
2229                 op === '&=' ||
2230                 op === '^=' ||
2231                 op === '|=';
2232         };
2233         // Cover grammar support.
2234         //
2235         // When an assignment expression position starts with an left parenthesis, the determination of the type
2236         // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
2237         // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
2238         //
2239         // There are three productions that can be parsed in a parentheses pair that needs to be determined
2240         // after the outermost pair is closed. They are:
2241         //
2242         //   1. AssignmentExpression
2243         //   2. BindingElements
2244         //   3. AssignmentTargets
2245         //
2246         // In order to avoid exponential backtracking, we use two flags to denote if the production can be
2247         // binding element or assignment target.
2248         //
2249         // The three productions have the relationship:
2250         //
2251         //   BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
2252         //
2253         // with a single exception that CoverInitializedName when used directly in an Expression, generates
2254         // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
2255         // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
2256         //
2257         // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
2258         // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
2259         // the CoverInitializedName check is conducted.
2260         //
2261         // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
2262         // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
2263         // pattern. The CoverInitializedName check is deferred.
2264         Parser.prototype.isolateCoverGrammar = function (parseFunction) {
2265             var previousIsBindingElement = this.context.isBindingElement;
2266             var previousIsAssignmentTarget = this.context.isAssignmentTarget;
2267             var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
2268             this.context.isBindingElement = true;
2269             this.context.isAssignmentTarget = true;
2270             this.context.firstCoverInitializedNameError = null;
2271             var result = parseFunction.call(this);
2272             if (this.context.firstCoverInitializedNameError !== null) {
2273                 this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
2274             }
2275             this.context.isBindingElement = previousIsBindingElement;
2276             this.context.isAssignmentTarget = previousIsAssignmentTarget;
2277             this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
2278             return result;
2279         };
2280         Parser.prototype.inheritCoverGrammar = function (parseFunction) {
2281             var previousIsBindingElement = this.context.isBindingElement;
2282             var previousIsAssignmentTarget = this.context.isAssignmentTarget;
2283             var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
2284             this.context.isBindingElement = true;
2285             this.context.isAssignmentTarget = true;
2286             this.context.firstCoverInitializedNameError = null;
2287             var result = parseFunction.call(this);
2288             this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement;
2289             this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget;
2290             this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError;
2291             return result;
2292         };
2293         Parser.prototype.consumeSemicolon = function () {
2294             if (this.match(';')) {
2295                 this.nextToken();
2296             }
2297             else if (!this.hasLineTerminator) {
2298                 if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) {
2299                     this.throwUnexpectedToken(this.lookahead);
2300                 }
2301                 this.lastMarker.index = this.startMarker.index;
2302                 this.lastMarker.line = this.startMarker.line;
2303                 this.lastMarker.column = this.startMarker.column;
2304             }
2305         };
2306         // https://tc39.github.io/ecma262/#sec-primary-expression
2307         Parser.prototype.parsePrimaryExpression = function () {
2308             var node = this.createNode();
2309             var expr;
2310             var token, raw;
2311             switch (this.lookahead.type) {
2312                 case 3 /* Identifier */:
2313                     if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') {
2314                         this.tolerateUnexpectedToken(this.lookahead);
2315                     }
2316                     expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value));
2317                     break;
2318                 case 6 /* NumericLiteral */:
2319                 case 8 /* StringLiteral */:
2320                     if (this.context.strict && this.lookahead.octal) {
2321                         this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral);
2322                     }
2323                     this.context.isAssignmentTarget = false;
2324                     this.context.isBindingElement = false;
2325                     token = this.nextToken();
2326                     raw = this.getTokenRaw(token);
2327                     expr = this.finalize(node, new Node.Literal(token.value, raw));
2328                     break;
2329                 case 1 /* BooleanLiteral */:
2330                     this.context.isAssignmentTarget = false;
2331                     this.context.isBindingElement = false;
2332                     token = this.nextToken();
2333                     raw = this.getTokenRaw(token);
2334                     expr = this.finalize(node, new Node.Literal(token.value === 'true', raw));
2335                     break;
2336                 case 5 /* NullLiteral */:
2337                     this.context.isAssignmentTarget = false;
2338                     this.context.isBindingElement = false;
2339                     token = this.nextToken();
2340                     raw = this.getTokenRaw(token);
2341                     expr = this.finalize(node, new Node.Literal(null, raw));
2342                     break;
2343                 case 10 /* Template */:
2344                     expr = this.parseTemplateLiteral();
2345                     break;
2346                 case 7 /* Punctuator */:
2347                     switch (this.lookahead.value) {
2348                         case '(':
2349                             this.context.isBindingElement = false;
2350                             expr = this.inheritCoverGrammar(this.parseGroupExpression);
2351                             break;
2352                         case '[':
2353                             expr = this.inheritCoverGrammar(this.parseArrayInitializer);
2354                             break;
2355                         case '{':
2356                             expr = this.inheritCoverGrammar(this.parseObjectInitializer);
2357                             break;
2358                         case '/':
2359                         case '/=':
2360                             this.context.isAssignmentTarget = false;
2361                             this.context.isBindingElement = false;
2362                             this.scanner.index = this.startMarker.index;
2363                             token = this.nextRegexToken();
2364                             raw = this.getTokenRaw(token);
2365                             expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags));
2366                             break;
2367                         default:
2368                             expr = this.throwUnexpectedToken(this.nextToken());
2369                     }
2370                     break;
2371                 case 4 /* Keyword */:
2372                     if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) {
2373                         expr = this.parseIdentifierName();
2374                     }
2375                     else if (!this.context.strict && this.matchKeyword('let')) {
2376                         expr = this.finalize(node, new Node.Identifier(this.nextToken().value));
2377                     }
2378                     else {
2379                         this.context.isAssignmentTarget = false;
2380                         this.context.isBindingElement = false;
2381                         if (this.matchKeyword('function')) {
2382                             expr = this.parseFunctionExpression();
2383                         }
2384                         else if (this.matchKeyword('this')) {
2385                             this.nextToken();
2386                             expr = this.finalize(node, new Node.ThisExpression());
2387                         }
2388                         else if (this.matchKeyword('class')) {
2389                             expr = this.parseClassExpression();
2390                         }
2391                         else if (this.matchImportCall()) {
2392                             expr = this.parseImportCall();
2393                         }
2394                         else {
2395                             expr = this.throwUnexpectedToken(this.nextToken());
2396                         }
2397                     }
2398                     break;
2399                 default:
2400                     expr = this.throwUnexpectedToken(this.nextToken());
2401             }
2402             return expr;
2403         };
2404         // https://tc39.github.io/ecma262/#sec-array-initializer
2405         Parser.prototype.parseSpreadElement = function () {
2406             var node = this.createNode();
2407             this.expect('...');
2408             var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
2409             return this.finalize(node, new Node.SpreadElement(arg));
2410         };
2411         Parser.prototype.parseArrayInitializer = function () {
2412             var node = this.createNode();
2413             var elements = [];
2414             this.expect('[');
2415             while (!this.match(']')) {
2416                 if (this.match(',')) {
2417                     this.nextToken();
2418                     elements.push(null);
2419                 }
2420                 else if (this.match('...')) {
2421                     var element = this.parseSpreadElement();
2422                     if (!this.match(']')) {
2423                         this.context.isAssignmentTarget = false;
2424                         this.context.isBindingElement = false;
2425                         this.expect(',');
2426                     }
2427                     elements.push(element);
2428                 }
2429                 else {
2430                     elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
2431                     if (!this.match(']')) {
2432                         this.expect(',');
2433                     }
2434                 }
2435             }
2436             this.expect(']');
2437             return this.finalize(node, new Node.ArrayExpression(elements));
2438         };
2439         // https://tc39.github.io/ecma262/#sec-object-initializer
2440         Parser.prototype.parsePropertyMethod = function (params) {
2441             this.context.isAssignmentTarget = false;
2442             this.context.isBindingElement = false;
2443             var previousStrict = this.context.strict;
2444             var previousAllowStrictDirective = this.context.allowStrictDirective;
2445             this.context.allowStrictDirective = params.simple;
2446             var body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
2447             if (this.context.strict && params.firstRestricted) {
2448                 this.tolerateUnexpectedToken(params.firstRestricted, params.message);
2449             }
2450             if (this.context.strict && params.stricted) {
2451                 this.tolerateUnexpectedToken(params.stricted, params.message);
2452             }
2453             this.context.strict = previousStrict;
2454             this.context.allowStrictDirective = previousAllowStrictDirective;
2455             return body;
2456         };
2457         Parser.prototype.parsePropertyMethodFunction = function () {
2458             var isGenerator = false;
2459             var node = this.createNode();
2460             var previousAllowYield = this.context.allowYield;
2461             this.context.allowYield = false;
2462             var params = this.parseFormalParameters();
2463             var method = this.parsePropertyMethod(params);
2464             this.context.allowYield = previousAllowYield;
2465             return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
2466         };
2467         Parser.prototype.parsePropertyMethodAsyncFunction = function () {
2468             var node = this.createNode();
2469             var previousAllowYield = this.context.allowYield;
2470             var previousAwait = this.context.await;
2471             this.context.allowYield = false;
2472             this.context.await = true;
2473             var params = this.parseFormalParameters();
2474             var method = this.parsePropertyMethod(params);
2475             this.context.allowYield = previousAllowYield;
2476             this.context.await = previousAwait;
2477             return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method));
2478         };
2479         Parser.prototype.parseObjectPropertyKey = function () {
2480             var node = this.createNode();
2481             var token = this.nextToken();
2482             var key;
2483             switch (token.type) {
2484                 case 8 /* StringLiteral */:
2485                 case 6 /* NumericLiteral */:
2486                     if (this.context.strict && token.octal) {
2487                         this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral);
2488                     }
2489                     var raw = this.getTokenRaw(token);
2490                     key = this.finalize(node, new Node.Literal(token.value, raw));
2491                     break;
2492                 case 3 /* Identifier */:
2493                 case 1 /* BooleanLiteral */:
2494                 case 5 /* NullLiteral */:
2495                 case 4 /* Keyword */:
2496                     key = this.finalize(node, new Node.Identifier(token.value));
2497                     break;
2498                 case 7 /* Punctuator */:
2499                     if (token.value === '[') {
2500                         key = this.isolateCoverGrammar(this.parseAssignmentExpression);
2501                         this.expect(']');
2502                     }
2503                     else {
2504                         key = this.throwUnexpectedToken(token);
2505                     }
2506                     break;
2507                 default:
2508                     key = this.throwUnexpectedToken(token);
2509             }
2510             return key;
2511         };
2512         Parser.prototype.isPropertyKey = function (key, value) {
2513             return (key.type === syntax_1.Syntax.Identifier && key.name === value) ||
2514                 (key.type === syntax_1.Syntax.Literal && key.value === value);
2515         };
2516         Parser.prototype.parseObjectProperty = function (hasProto) {
2517             var node = this.createNode();
2518             var token = this.lookahead;
2519             var kind;
2520             var key = null;
2521             var value = null;
2522             var computed = false;
2523             var method = false;
2524             var shorthand = false;
2525             var isAsync = false;
2526             if (token.type === 3 /* Identifier */) {
2527                 var id = token.value;
2528                 this.nextToken();
2529                 if (id === 'async' && !this.hasLineTerminator) {
2530                     computed = this.match('[');
2531                     if (computed) {
2532                         isAsync = true;
2533                         key = this.parseObjectPropertyKey();
2534                     }
2535                     else {
2536                         var punctuator = this.lookahead.value;
2537                         if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') {
2538                             isAsync = true;
2539                             token = this.lookahead;
2540                             id = token.value;
2541                             this.nextToken();
2542                         }
2543                         key = this.finalize(node, new Node.Identifier(id));
2544                     }
2545                 }
2546                 else {
2547                     key = this.finalize(node, new Node.Identifier(id));
2548                 }
2549             }
2550             else if (this.match('*')) {
2551                 this.nextToken();
2552             }
2553             else {
2554                 computed = this.match('[');
2555                 key = this.parseObjectPropertyKey();
2556             }
2557             var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
2558             if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) {
2559                 kind = 'get';
2560                 computed = this.match('[');
2561                 key = this.parseObjectPropertyKey();
2562                 this.context.allowYield = false;
2563                 value = this.parseGetterMethod();
2564             }
2565             else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) {
2566                 kind = 'set';
2567                 computed = this.match('[');
2568                 key = this.parseObjectPropertyKey();
2569                 value = this.parseSetterMethod();
2570             }
2571             else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
2572                 kind = 'init';
2573                 computed = this.match('[');
2574                 key = this.parseObjectPropertyKey();
2575                 value = this.parseGeneratorMethod();
2576                 method = true;
2577             }
2578             else {
2579                 if (!key) {
2580                     this.throwUnexpectedToken(this.lookahead);
2581                 }
2582                 kind = 'init';
2583                 if (this.match(':') && !isAsync) {
2584                     if (!computed && this.isPropertyKey(key, '__proto__')) {
2585                         if (hasProto.value) {
2586                             this.tolerateError(messages_1.Messages.DuplicateProtoProperty);
2587                         }
2588                         hasProto.value = true;
2589                     }
2590                     this.nextToken();
2591                     value = this.inheritCoverGrammar(this.parseAssignmentExpression);
2592                 }
2593                 else if (this.match('(')) {
2594                     value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
2595                     method = true;
2596                 }
2597                 else if (token.type === 3 /* Identifier */) {
2598                     var id = this.finalize(node, new Node.Identifier(token.value));
2599                     if (this.match('=')) {
2600                         this.context.firstCoverInitializedNameError = this.lookahead;
2601                         this.nextToken();
2602                         shorthand = true;
2603                         var init = this.isolateCoverGrammar(this.parseAssignmentExpression);
2604                         value = this.finalize(node, new Node.AssignmentPattern(id, init));
2605                     }
2606                     else {
2607                         shorthand = true;
2608                         value = id;
2609                     }
2610                 }
2611                 else {
2612                     this.throwUnexpectedToken(this.nextToken());
2613                 }
2614             }
2615             return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand));
2616         };
2617         Parser.prototype.parseSpreadProperty = function () {
2618             var node = this.createNode();
2619             this.expect('...');
2620             var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
2621             return this.finalize(node, new Node.SpreadProperty(arg));
2622         };
2623         Parser.prototype.parseObjectInitializer = function () {
2624             var node = this.createNode();
2625             this.expect('{');
2626             var properties = [];
2627             var hasProto = { value: false };
2628             while (!this.match('}')) {
2629                 properties.push(this.match('...') ? this.parseSpreadProperty() : this.parseObjectProperty(hasProto));
2630                 if (!this.match('}')) {
2631                     this.expectCommaSeparator();
2632                 }
2633             }
2634             this.expect('}');
2635             return this.finalize(node, new Node.ObjectExpression(properties));
2636         };
2637         // https://tc39.github.io/ecma262/#sec-template-literals
2638         Parser.prototype.parseTemplateHead = function () {
2639             assert_1.assert(this.lookahead.head, 'Template literal must start with a template head');
2640             var node = this.createNode();
2641             var token = this.nextToken();
2642             var raw = token.value;
2643             var cooked = token.cooked;
2644             return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
2645         };
2646         Parser.prototype.parseTemplateElement = function () {
2647             if (this.lookahead.type !== 10 /* Template */) {
2648                 this.throwUnexpectedToken();
2649             }
2650             var node = this.createNode();
2651             var token = this.nextToken();
2652             var raw = token.value;
2653             var cooked = token.cooked;
2654             return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
2655         };
2656         Parser.prototype.parseTemplateLiteral = function () {
2657             var node = this.createNode();
2658             var expressions = [];
2659             var quasis = [];
2660             var quasi = this.parseTemplateHead();
2661             quasis.push(quasi);
2662             while (!quasi.tail) {
2663                 expressions.push(this.parseExpression());
2664                 quasi = this.parseTemplateElement();
2665                 quasis.push(quasi);
2666             }
2667             return this.finalize(node, new Node.TemplateLiteral(quasis, expressions));
2668         };
2669         // https://tc39.github.io/ecma262/#sec-grouping-operator
2670         Parser.prototype.reinterpretExpressionAsPattern = function (expr) {
2671             switch (expr.type) {
2672                 case syntax_1.Syntax.Identifier:
2673                 case syntax_1.Syntax.MemberExpression:
2674                 case syntax_1.Syntax.RestElement:
2675                 case syntax_1.Syntax.AssignmentPattern:
2676                     break;
2677                 case syntax_1.Syntax.SpreadElement:
2678                     expr.type = syntax_1.Syntax.RestElement;
2679                     this.reinterpretExpressionAsPattern(expr.argument);
2680                     break;
2681                 case syntax_1.Syntax.SpreadProperty:
2682                     expr.type = syntax_1.Syntax.RestProperty;
2683                     this.reinterpretExpressionAsPattern(expr.argument);
2684                     break;
2685                 case syntax_1.Syntax.ArrayExpression:
2686                     expr.type = syntax_1.Syntax.ArrayPattern;
2687                     for (var i = 0; i < expr.elements.length; i++) {
2688                         if (expr.elements[i] !== null) {
2689                             this.reinterpretExpressionAsPattern(expr.elements[i]);
2690                         }
2691                     }
2692                     break;
2693                 case syntax_1.Syntax.ObjectExpression:
2694                     expr.type = syntax_1.Syntax.ObjectPattern;
2695                     for (var i = 0; i < expr.properties.length; i++) {
2696                         var property = expr.properties[i];
2697                         this.reinterpretExpressionAsPattern(property.type === syntax_1.Syntax.SpreadProperty ? property : property.value);
2698                     }
2699                     break;
2700                 case syntax_1.Syntax.AssignmentExpression:
2701                     expr.type = syntax_1.Syntax.AssignmentPattern;
2702                     delete expr.operator;
2703                     this.reinterpretExpressionAsPattern(expr.left);
2704                     break;
2705                 default:
2706                     // Allow other node type for tolerant parsing.
2707                     break;
2708             }
2709         };
2710         Parser.prototype.parseGroupExpression = function () {
2711             var expr;
2712             this.expect('(');
2713             if (this.match(')')) {
2714                 this.nextToken();
2715                 if (!this.match('=>')) {
2716                     this.expect('=>');
2717                 }
2718                 expr = {
2719                     type: ArrowParameterPlaceHolder,
2720                     params: [],
2721                     async: false
2722                 };
2723             }
2724             else {
2725                 var startToken = this.lookahead;
2726                 var params = [];
2727                 if (this.match('...')) {
2728                     expr = this.parseRestElement(params);
2729                     this.expect(')');
2730                     if (!this.match('=>')) {
2731                         this.expect('=>');
2732                     }
2733                     expr = {
2734                         type: ArrowParameterPlaceHolder,
2735                         params: [expr],
2736                         async: false
2737                     };
2738                 }
2739                 else {
2740                     var arrow = false;
2741                     this.context.isBindingElement = true;
2742                     expr = this.inheritCoverGrammar(this.parseAssignmentExpression);
2743                     if (this.match(',')) {
2744                         var expressions = [];
2745                         this.context.isAssignmentTarget = false;
2746                         expressions.push(expr);
2747                         while (this.lookahead.type !== 2 /* EOF */) {
2748                             if (!this.match(',')) {
2749                                 break;
2750                             }
2751                             this.nextToken();
2752                             if (this.match(')')) {
2753                                 this.nextToken();
2754                                 for (var i = 0; i < expressions.length; i++) {
2755                                     this.reinterpretExpressionAsPattern(expressions[i]);
2756                                 }
2757                                 arrow = true;
2758                                 expr = {
2759                                     type: ArrowParameterPlaceHolder,
2760                                     params: expressions,
2761                                     async: false
2762                                 };
2763                             }
2764                             else if (this.match('...')) {
2765                                 if (!this.context.isBindingElement) {
2766                                     this.throwUnexpectedToken(this.lookahead);
2767                                 }
2768                                 expressions.push(this.parseRestElement(params));
2769                                 this.expect(')');
2770                                 if (!this.match('=>')) {
2771                                     this.expect('=>');
2772                                 }
2773                                 this.context.isBindingElement = false;
2774                                 for (var i = 0; i < expressions.length; i++) {
2775                                     this.reinterpretExpressionAsPattern(expressions[i]);
2776                                 }
2777                                 arrow = true;
2778                                 expr = {
2779                                     type: ArrowParameterPlaceHolder,
2780                                     params: expressions,
2781                                     async: false
2782                                 };
2783                             }
2784                             else {
2785                                 expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
2786                             }
2787                             if (arrow) {
2788                                 break;
2789                             }
2790                         }
2791                         if (!arrow) {