Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/codemirr...
File: esprima.js
(function webpackUniversalModuleDefinition(root, factory) {
[0] Fix | Delete
/* istanbul ignore next */
[1] Fix | Delete
if(typeof exports === 'object' && typeof module === 'object')
[2] Fix | Delete
module.exports = factory();
[3] Fix | Delete
else if(typeof define === 'function' && define.amd)
[4] Fix | Delete
define([], factory);
[5] Fix | Delete
/* istanbul ignore next */
[6] Fix | Delete
else if(typeof exports === 'object')
[7] Fix | Delete
exports["esprima"] = factory();
[8] Fix | Delete
else
[9] Fix | Delete
root["esprima"] = factory();
[10] Fix | Delete
})(this, function() {
[11] Fix | Delete
return /******/ (function(modules) { // webpackBootstrap
[12] Fix | Delete
/******/ // The module cache
[13] Fix | Delete
/******/ var installedModules = {};
[14] Fix | Delete
[15] Fix | Delete
/******/ // The require function
[16] Fix | Delete
/******/ function __webpack_require__(moduleId) {
[17] Fix | Delete
[18] Fix | Delete
/******/ // Check if module is in cache
[19] Fix | Delete
/* istanbul ignore if */
[20] Fix | Delete
/******/ if(installedModules[moduleId])
[21] Fix | Delete
/******/ return installedModules[moduleId].exports;
[22] Fix | Delete
[23] Fix | Delete
/******/ // Create a new module (and put it into the cache)
[24] Fix | Delete
/******/ var module = installedModules[moduleId] = {
[25] Fix | Delete
/******/ exports: {},
[26] Fix | Delete
/******/ id: moduleId,
[27] Fix | Delete
/******/ loaded: false
[28] Fix | Delete
/******/ };
[29] Fix | Delete
[30] Fix | Delete
/******/ // Execute the module function
[31] Fix | Delete
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
[32] Fix | Delete
[33] Fix | Delete
/******/ // Flag the module as loaded
[34] Fix | Delete
/******/ module.loaded = true;
[35] Fix | Delete
[36] Fix | Delete
/******/ // Return the exports of the module
[37] Fix | Delete
/******/ return module.exports;
[38] Fix | Delete
/******/ }
[39] Fix | Delete
[40] Fix | Delete
[41] Fix | Delete
/******/ // expose the modules object (__webpack_modules__)
[42] Fix | Delete
/******/ __webpack_require__.m = modules;
[43] Fix | Delete
[44] Fix | Delete
/******/ // expose the module cache
[45] Fix | Delete
/******/ __webpack_require__.c = installedModules;
[46] Fix | Delete
[47] Fix | Delete
/******/ // __webpack_public_path__
[48] Fix | Delete
/******/ __webpack_require__.p = "";
[49] Fix | Delete
[50] Fix | Delete
/******/ // Load entry module and return exports
[51] Fix | Delete
/******/ return __webpack_require__(0);
[52] Fix | Delete
/******/ })
[53] Fix | Delete
/************************************************************************/
[54] Fix | Delete
/******/ ([
[55] Fix | Delete
/* 0 */
[56] Fix | Delete
/***/ function(module, exports, __webpack_require__) {
[57] Fix | Delete
[58] Fix | Delete
"use strict";
[59] Fix | Delete
/*
[60] Fix | Delete
Copyright JS Foundation and other contributors, https://js.foundation/
[61] Fix | Delete
[62] Fix | Delete
Redistribution and use in source and binary forms, with or without
[63] Fix | Delete
modification, are permitted provided that the following conditions are met:
[64] Fix | Delete
[65] Fix | Delete
* Redistributions of source code must retain the above copyright
[66] Fix | Delete
notice, this list of conditions and the following disclaimer.
[67] Fix | Delete
* Redistributions in binary form must reproduce the above copyright
[68] Fix | Delete
notice, this list of conditions and the following disclaimer in the
[69] Fix | Delete
documentation and/or other materials provided with the distribution.
[70] Fix | Delete
[71] Fix | Delete
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
[72] Fix | Delete
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
[73] Fix | Delete
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
[74] Fix | Delete
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
[75] Fix | Delete
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
[76] Fix | Delete
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
[77] Fix | Delete
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
[78] Fix | Delete
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
[79] Fix | Delete
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
[80] Fix | Delete
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[81] Fix | Delete
*/
[82] Fix | Delete
Object.defineProperty(exports, "__esModule", { value: true });
[83] Fix | Delete
var comment_handler_1 = __webpack_require__(1);
[84] Fix | Delete
var jsx_parser_1 = __webpack_require__(3);
[85] Fix | Delete
var parser_1 = __webpack_require__(8);
[86] Fix | Delete
var tokenizer_1 = __webpack_require__(15);
[87] Fix | Delete
function parse(code, options, delegate) {
[88] Fix | Delete
var commentHandler = null;
[89] Fix | Delete
var proxyDelegate = function (node, metadata) {
[90] Fix | Delete
if (delegate) {
[91] Fix | Delete
delegate(node, metadata);
[92] Fix | Delete
}
[93] Fix | Delete
if (commentHandler) {
[94] Fix | Delete
commentHandler.visit(node, metadata);
[95] Fix | Delete
}
[96] Fix | Delete
};
[97] Fix | Delete
var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null;
[98] Fix | Delete
var collectComment = false;
[99] Fix | Delete
if (options) {
[100] Fix | Delete
collectComment = (typeof options.comment === 'boolean' && options.comment);
[101] Fix | Delete
var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment);
[102] Fix | Delete
if (collectComment || attachComment) {
[103] Fix | Delete
commentHandler = new comment_handler_1.CommentHandler();
[104] Fix | Delete
commentHandler.attach = attachComment;
[105] Fix | Delete
options.comment = true;
[106] Fix | Delete
parserDelegate = proxyDelegate;
[107] Fix | Delete
}
[108] Fix | Delete
}
[109] Fix | Delete
var isModule = false;
[110] Fix | Delete
if (options && typeof options.sourceType === 'string') {
[111] Fix | Delete
isModule = (options.sourceType === 'module');
[112] Fix | Delete
}
[113] Fix | Delete
var parser;
[114] Fix | Delete
if (options && typeof options.jsx === 'boolean' && options.jsx) {
[115] Fix | Delete
parser = new jsx_parser_1.JSXParser(code, options, parserDelegate);
[116] Fix | Delete
}
[117] Fix | Delete
else {
[118] Fix | Delete
parser = new parser_1.Parser(code, options, parserDelegate);
[119] Fix | Delete
}
[120] Fix | Delete
var program = isModule ? parser.parseModule() : parser.parseScript();
[121] Fix | Delete
var ast = program;
[122] Fix | Delete
if (collectComment && commentHandler) {
[123] Fix | Delete
ast.comments = commentHandler.comments;
[124] Fix | Delete
}
[125] Fix | Delete
if (parser.config.tokens) {
[126] Fix | Delete
ast.tokens = parser.tokens;
[127] Fix | Delete
}
[128] Fix | Delete
if (parser.config.tolerant) {
[129] Fix | Delete
ast.errors = parser.errorHandler.errors;
[130] Fix | Delete
}
[131] Fix | Delete
return ast;
[132] Fix | Delete
}
[133] Fix | Delete
exports.parse = parse;
[134] Fix | Delete
function parseModule(code, options, delegate) {
[135] Fix | Delete
var parsingOptions = options || {};
[136] Fix | Delete
parsingOptions.sourceType = 'module';
[137] Fix | Delete
return parse(code, parsingOptions, delegate);
[138] Fix | Delete
}
[139] Fix | Delete
exports.parseModule = parseModule;
[140] Fix | Delete
function parseScript(code, options, delegate) {
[141] Fix | Delete
var parsingOptions = options || {};
[142] Fix | Delete
parsingOptions.sourceType = 'script';
[143] Fix | Delete
return parse(code, parsingOptions, delegate);
[144] Fix | Delete
}
[145] Fix | Delete
exports.parseScript = parseScript;
[146] Fix | Delete
function tokenize(code, options, delegate) {
[147] Fix | Delete
var tokenizer = new tokenizer_1.Tokenizer(code, options);
[148] Fix | Delete
var tokens;
[149] Fix | Delete
tokens = [];
[150] Fix | Delete
try {
[151] Fix | Delete
while (true) {
[152] Fix | Delete
var token = tokenizer.getNextToken();
[153] Fix | Delete
if (!token) {
[154] Fix | Delete
break;
[155] Fix | Delete
}
[156] Fix | Delete
if (delegate) {
[157] Fix | Delete
token = delegate(token);
[158] Fix | Delete
}
[159] Fix | Delete
tokens.push(token);
[160] Fix | Delete
}
[161] Fix | Delete
}
[162] Fix | Delete
catch (e) {
[163] Fix | Delete
tokenizer.errorHandler.tolerate(e);
[164] Fix | Delete
}
[165] Fix | Delete
if (tokenizer.errorHandler.tolerant) {
[166] Fix | Delete
tokens.errors = tokenizer.errors();
[167] Fix | Delete
}
[168] Fix | Delete
return tokens;
[169] Fix | Delete
}
[170] Fix | Delete
exports.tokenize = tokenize;
[171] Fix | Delete
var syntax_1 = __webpack_require__(2);
[172] Fix | Delete
exports.Syntax = syntax_1.Syntax;
[173] Fix | Delete
// Sync with *.json manifests.
[174] Fix | Delete
exports.version = '4.0.0';
[175] Fix | Delete
[176] Fix | Delete
[177] Fix | Delete
/***/ },
[178] Fix | Delete
/* 1 */
[179] Fix | Delete
/***/ function(module, exports, __webpack_require__) {
[180] Fix | Delete
[181] Fix | Delete
"use strict";
[182] Fix | Delete
Object.defineProperty(exports, "__esModule", { value: true });
[183] Fix | Delete
var syntax_1 = __webpack_require__(2);
[184] Fix | Delete
var CommentHandler = (function () {
[185] Fix | Delete
function CommentHandler() {
[186] Fix | Delete
this.attach = false;
[187] Fix | Delete
this.comments = [];
[188] Fix | Delete
this.stack = [];
[189] Fix | Delete
this.leading = [];
[190] Fix | Delete
this.trailing = [];
[191] Fix | Delete
}
[192] Fix | Delete
CommentHandler.prototype.insertInnerComments = function (node, metadata) {
[193] Fix | Delete
// innnerComments for properties empty block
[194] Fix | Delete
// `function a() {/** comments **\/}`
[195] Fix | Delete
if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) {
[196] Fix | Delete
var innerComments = [];
[197] Fix | Delete
for (var i = this.leading.length - 1; i >= 0; --i) {
[198] Fix | Delete
var entry = this.leading[i];
[199] Fix | Delete
if (metadata.end.offset >= entry.start) {
[200] Fix | Delete
innerComments.unshift(entry.comment);
[201] Fix | Delete
this.leading.splice(i, 1);
[202] Fix | Delete
this.trailing.splice(i, 1);
[203] Fix | Delete
}
[204] Fix | Delete
}
[205] Fix | Delete
if (innerComments.length) {
[206] Fix | Delete
node.innerComments = innerComments;
[207] Fix | Delete
}
[208] Fix | Delete
}
[209] Fix | Delete
};
[210] Fix | Delete
CommentHandler.prototype.findTrailingComments = function (metadata) {
[211] Fix | Delete
var trailingComments = [];
[212] Fix | Delete
if (this.trailing.length > 0) {
[213] Fix | Delete
for (var i = this.trailing.length - 1; i >= 0; --i) {
[214] Fix | Delete
var entry_1 = this.trailing[i];
[215] Fix | Delete
if (entry_1.start >= metadata.end.offset) {
[216] Fix | Delete
trailingComments.unshift(entry_1.comment);
[217] Fix | Delete
}
[218] Fix | Delete
}
[219] Fix | Delete
this.trailing.length = 0;
[220] Fix | Delete
return trailingComments;
[221] Fix | Delete
}
[222] Fix | Delete
var entry = this.stack[this.stack.length - 1];
[223] Fix | Delete
if (entry && entry.node.trailingComments) {
[224] Fix | Delete
var firstComment = entry.node.trailingComments[0];
[225] Fix | Delete
if (firstComment && firstComment.range[0] >= metadata.end.offset) {
[226] Fix | Delete
trailingComments = entry.node.trailingComments;
[227] Fix | Delete
delete entry.node.trailingComments;
[228] Fix | Delete
}
[229] Fix | Delete
}
[230] Fix | Delete
return trailingComments;
[231] Fix | Delete
};
[232] Fix | Delete
CommentHandler.prototype.findLeadingComments = function (metadata) {
[233] Fix | Delete
var leadingComments = [];
[234] Fix | Delete
var target;
[235] Fix | Delete
while (this.stack.length > 0) {
[236] Fix | Delete
var entry = this.stack[this.stack.length - 1];
[237] Fix | Delete
if (entry && entry.start >= metadata.start.offset) {
[238] Fix | Delete
target = entry.node;
[239] Fix | Delete
this.stack.pop();
[240] Fix | Delete
}
[241] Fix | Delete
else {
[242] Fix | Delete
break;
[243] Fix | Delete
}
[244] Fix | Delete
}
[245] Fix | Delete
if (target) {
[246] Fix | Delete
var count = target.leadingComments ? target.leadingComments.length : 0;
[247] Fix | Delete
for (var i = count - 1; i >= 0; --i) {
[248] Fix | Delete
var comment = target.leadingComments[i];
[249] Fix | Delete
if (comment.range[1] <= metadata.start.offset) {
[250] Fix | Delete
leadingComments.unshift(comment);
[251] Fix | Delete
target.leadingComments.splice(i, 1);
[252] Fix | Delete
}
[253] Fix | Delete
}
[254] Fix | Delete
if (target.leadingComments && target.leadingComments.length === 0) {
[255] Fix | Delete
delete target.leadingComments;
[256] Fix | Delete
}
[257] Fix | Delete
return leadingComments;
[258] Fix | Delete
}
[259] Fix | Delete
for (var i = this.leading.length - 1; i >= 0; --i) {
[260] Fix | Delete
var entry = this.leading[i];
[261] Fix | Delete
if (entry.start <= metadata.start.offset) {
[262] Fix | Delete
leadingComments.unshift(entry.comment);
[263] Fix | Delete
this.leading.splice(i, 1);
[264] Fix | Delete
}
[265] Fix | Delete
}
[266] Fix | Delete
return leadingComments;
[267] Fix | Delete
};
[268] Fix | Delete
CommentHandler.prototype.visitNode = function (node, metadata) {
[269] Fix | Delete
if (node.type === syntax_1.Syntax.Program && node.body.length > 0) {
[270] Fix | Delete
return;
[271] Fix | Delete
}
[272] Fix | Delete
this.insertInnerComments(node, metadata);
[273] Fix | Delete
var trailingComments = this.findTrailingComments(metadata);
[274] Fix | Delete
var leadingComments = this.findLeadingComments(metadata);
[275] Fix | Delete
if (leadingComments.length > 0) {
[276] Fix | Delete
node.leadingComments = leadingComments;
[277] Fix | Delete
}
[278] Fix | Delete
if (trailingComments.length > 0) {
[279] Fix | Delete
node.trailingComments = trailingComments;
[280] Fix | Delete
}
[281] Fix | Delete
this.stack.push({
[282] Fix | Delete
node: node,
[283] Fix | Delete
start: metadata.start.offset
[284] Fix | Delete
});
[285] Fix | Delete
};
[286] Fix | Delete
CommentHandler.prototype.visitComment = function (node, metadata) {
[287] Fix | Delete
var type = (node.type[0] === 'L') ? 'Line' : 'Block';
[288] Fix | Delete
var comment = {
[289] Fix | Delete
type: type,
[290] Fix | Delete
value: node.value
[291] Fix | Delete
};
[292] Fix | Delete
if (node.range) {
[293] Fix | Delete
comment.range = node.range;
[294] Fix | Delete
}
[295] Fix | Delete
if (node.loc) {
[296] Fix | Delete
comment.loc = node.loc;
[297] Fix | Delete
}
[298] Fix | Delete
this.comments.push(comment);
[299] Fix | Delete
if (this.attach) {
[300] Fix | Delete
var entry = {
[301] Fix | Delete
comment: {
[302] Fix | Delete
type: type,
[303] Fix | Delete
value: node.value,
[304] Fix | Delete
range: [metadata.start.offset, metadata.end.offset]
[305] Fix | Delete
},
[306] Fix | Delete
start: metadata.start.offset
[307] Fix | Delete
};
[308] Fix | Delete
if (node.loc) {
[309] Fix | Delete
entry.comment.loc = node.loc;
[310] Fix | Delete
}
[311] Fix | Delete
node.type = type;
[312] Fix | Delete
this.leading.push(entry);
[313] Fix | Delete
this.trailing.push(entry);
[314] Fix | Delete
}
[315] Fix | Delete
};
[316] Fix | Delete
CommentHandler.prototype.visit = function (node, metadata) {
[317] Fix | Delete
if (node.type === 'LineComment') {
[318] Fix | Delete
this.visitComment(node, metadata);
[319] Fix | Delete
}
[320] Fix | Delete
else if (node.type === 'BlockComment') {
[321] Fix | Delete
this.visitComment(node, metadata);
[322] Fix | Delete
}
[323] Fix | Delete
else if (this.attach) {
[324] Fix | Delete
this.visitNode(node, metadata);
[325] Fix | Delete
}
[326] Fix | Delete
};
[327] Fix | Delete
return CommentHandler;
[328] Fix | Delete
}());
[329] Fix | Delete
exports.CommentHandler = CommentHandler;
[330] Fix | Delete
[331] Fix | Delete
[332] Fix | Delete
/***/ },
[333] Fix | Delete
/* 2 */
[334] Fix | Delete
/***/ function(module, exports) {
[335] Fix | Delete
[336] Fix | Delete
"use strict";
[337] Fix | Delete
Object.defineProperty(exports, "__esModule", { value: true });
[338] Fix | Delete
exports.Syntax = {
[339] Fix | Delete
AssignmentExpression: 'AssignmentExpression',
[340] Fix | Delete
AssignmentPattern: 'AssignmentPattern',
[341] Fix | Delete
ArrayExpression: 'ArrayExpression',
[342] Fix | Delete
ArrayPattern: 'ArrayPattern',
[343] Fix | Delete
ArrowFunctionExpression: 'ArrowFunctionExpression',
[344] Fix | Delete
AwaitExpression: 'AwaitExpression',
[345] Fix | Delete
BlockStatement: 'BlockStatement',
[346] Fix | Delete
BinaryExpression: 'BinaryExpression',
[347] Fix | Delete
BreakStatement: 'BreakStatement',
[348] Fix | Delete
CallExpression: 'CallExpression',
[349] Fix | Delete
CatchClause: 'CatchClause',
[350] Fix | Delete
ClassBody: 'ClassBody',
[351] Fix | Delete
ClassDeclaration: 'ClassDeclaration',
[352] Fix | Delete
ClassExpression: 'ClassExpression',
[353] Fix | Delete
ConditionalExpression: 'ConditionalExpression',
[354] Fix | Delete
ContinueStatement: 'ContinueStatement',
[355] Fix | Delete
DoWhileStatement: 'DoWhileStatement',
[356] Fix | Delete
DebuggerStatement: 'DebuggerStatement',
[357] Fix | Delete
EmptyStatement: 'EmptyStatement',
[358] Fix | Delete
ExportAllDeclaration: 'ExportAllDeclaration',
[359] Fix | Delete
ExportDefaultDeclaration: 'ExportDefaultDeclaration',
[360] Fix | Delete
ExportNamedDeclaration: 'ExportNamedDeclaration',
[361] Fix | Delete
ExportSpecifier: 'ExportSpecifier',
[362] Fix | Delete
ExpressionStatement: 'ExpressionStatement',
[363] Fix | Delete
ForStatement: 'ForStatement',
[364] Fix | Delete
ForOfStatement: 'ForOfStatement',
[365] Fix | Delete
ForInStatement: 'ForInStatement',
[366] Fix | Delete
FunctionDeclaration: 'FunctionDeclaration',
[367] Fix | Delete
FunctionExpression: 'FunctionExpression',
[368] Fix | Delete
Identifier: 'Identifier',
[369] Fix | Delete
IfStatement: 'IfStatement',
[370] Fix | Delete
ImportDeclaration: 'ImportDeclaration',
[371] Fix | Delete
ImportDefaultSpecifier: 'ImportDefaultSpecifier',
[372] Fix | Delete
ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
[373] Fix | Delete
ImportSpecifier: 'ImportSpecifier',
[374] Fix | Delete
Literal: 'Literal',
[375] Fix | Delete
LabeledStatement: 'LabeledStatement',
[376] Fix | Delete
LogicalExpression: 'LogicalExpression',
[377] Fix | Delete
MemberExpression: 'MemberExpression',
[378] Fix | Delete
MetaProperty: 'MetaProperty',
[379] Fix | Delete
MethodDefinition: 'MethodDefinition',
[380] Fix | Delete
NewExpression: 'NewExpression',
[381] Fix | Delete
ObjectExpression: 'ObjectExpression',
[382] Fix | Delete
ObjectPattern: 'ObjectPattern',
[383] Fix | Delete
Program: 'Program',
[384] Fix | Delete
Property: 'Property',
[385] Fix | Delete
RestElement: 'RestElement',
[386] Fix | Delete
ReturnStatement: 'ReturnStatement',
[387] Fix | Delete
SequenceExpression: 'SequenceExpression',
[388] Fix | Delete
SpreadElement: 'SpreadElement',
[389] Fix | Delete
Super: 'Super',
[390] Fix | Delete
SwitchCase: 'SwitchCase',
[391] Fix | Delete
SwitchStatement: 'SwitchStatement',
[392] Fix | Delete
TaggedTemplateExpression: 'TaggedTemplateExpression',
[393] Fix | Delete
TemplateElement: 'TemplateElement',
[394] Fix | Delete
TemplateLiteral: 'TemplateLiteral',
[395] Fix | Delete
ThisExpression: 'ThisExpression',
[396] Fix | Delete
ThrowStatement: 'ThrowStatement',
[397] Fix | Delete
TryStatement: 'TryStatement',
[398] Fix | Delete
UnaryExpression: 'UnaryExpression',
[399] Fix | Delete
UpdateExpression: 'UpdateExpression',
[400] Fix | Delete
VariableDeclaration: 'VariableDeclaration',
[401] Fix | Delete
VariableDeclarator: 'VariableDeclarator',
[402] Fix | Delete
WhileStatement: 'WhileStatement',
[403] Fix | Delete
WithStatement: 'WithStatement',
[404] Fix | Delete
YieldExpression: 'YieldExpression'
[405] Fix | Delete
};
[406] Fix | Delete
[407] Fix | Delete
[408] Fix | Delete
/***/ },
[409] Fix | Delete
/* 3 */
[410] Fix | Delete
/***/ function(module, exports, __webpack_require__) {
[411] Fix | Delete
[412] Fix | Delete
"use strict";
[413] Fix | Delete
/* istanbul ignore next */
[414] Fix | Delete
var __extends = (this && this.__extends) || (function () {
[415] Fix | Delete
var extendStatics = Object.setPrototypeOf ||
[416] Fix | Delete
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
[417] Fix | Delete
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
[418] Fix | Delete
return function (d, b) {
[419] Fix | Delete
extendStatics(d, b);
[420] Fix | Delete
function __() { this.constructor = d; }
[421] Fix | Delete
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
[422] Fix | Delete
};
[423] Fix | Delete
})();
[424] Fix | Delete
Object.defineProperty(exports, "__esModule", { value: true });
[425] Fix | Delete
var character_1 = __webpack_require__(4);
[426] Fix | Delete
var JSXNode = __webpack_require__(5);
[427] Fix | Delete
var jsx_syntax_1 = __webpack_require__(6);
[428] Fix | Delete
var Node = __webpack_require__(7);
[429] Fix | Delete
var parser_1 = __webpack_require__(8);
[430] Fix | Delete
var token_1 = __webpack_require__(13);
[431] Fix | Delete
var xhtml_entities_1 = __webpack_require__(14);
[432] Fix | Delete
token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier';
[433] Fix | Delete
token_1.TokenName[101 /* Text */] = 'JSXText';
[434] Fix | Delete
// Fully qualified element name, e.g. <svg:path> returns "svg:path"
[435] Fix | Delete
function getQualifiedElementName(elementName) {
[436] Fix | Delete
var qualifiedName;
[437] Fix | Delete
switch (elementName.type) {
[438] Fix | Delete
case jsx_syntax_1.JSXSyntax.JSXIdentifier:
[439] Fix | Delete
var id = elementName;
[440] Fix | Delete
qualifiedName = id.name;
[441] Fix | Delete
break;
[442] Fix | Delete
case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
[443] Fix | Delete
var ns = elementName;
[444] Fix | Delete
qualifiedName = getQualifiedElementName(ns.namespace) + ':' +
[445] Fix | Delete
getQualifiedElementName(ns.name);
[446] Fix | Delete
break;
[447] Fix | Delete
case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
[448] Fix | Delete
var expr = elementName;
[449] Fix | Delete
qualifiedName = getQualifiedElementName(expr.object) + '.' +
[450] Fix | Delete
getQualifiedElementName(expr.property);
[451] Fix | Delete
break;
[452] Fix | Delete
/* istanbul ignore next */
[453] Fix | Delete
default:
[454] Fix | Delete
break;
[455] Fix | Delete
}
[456] Fix | Delete
return qualifiedName;
[457] Fix | Delete
}
[458] Fix | Delete
var JSXParser = (function (_super) {
[459] Fix | Delete
__extends(JSXParser, _super);
[460] Fix | Delete
function JSXParser(code, options, delegate) {
[461] Fix | Delete
return _super.call(this, code, options, delegate) || this;
[462] Fix | Delete
}
[463] Fix | Delete
JSXParser.prototype.parsePrimaryExpression = function () {
[464] Fix | Delete
return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
[465] Fix | Delete
};
[466] Fix | Delete
JSXParser.prototype.startJSX = function () {
[467] Fix | Delete
// Unwind the scanner before the lookahead token.
[468] Fix | Delete
this.scanner.index = this.startMarker.index;
[469] Fix | Delete
this.scanner.lineNumber = this.startMarker.line;
[470] Fix | Delete
this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
[471] Fix | Delete
};
[472] Fix | Delete
JSXParser.prototype.finishJSX = function () {
[473] Fix | Delete
// Prime the next lookahead.
[474] Fix | Delete
this.nextToken();
[475] Fix | Delete
};
[476] Fix | Delete
JSXParser.prototype.reenterJSX = function () {
[477] Fix | Delete
this.startJSX();
[478] Fix | Delete
this.expectJSX('}');
[479] Fix | Delete
// Pop the closing '}' added from the lookahead.
[480] Fix | Delete
if (this.config.tokens) {
[481] Fix | Delete
this.tokens.pop();
[482] Fix | Delete
}
[483] Fix | Delete
};
[484] Fix | Delete
JSXParser.prototype.createJSXNode = function () {
[485] Fix | Delete
this.collectComments();
[486] Fix | Delete
return {
[487] Fix | Delete
index: this.scanner.index,
[488] Fix | Delete
line: this.scanner.lineNumber,
[489] Fix | Delete
column: this.scanner.index - this.scanner.lineStart
[490] Fix | Delete
};
[491] Fix | Delete
};
[492] Fix | Delete
JSXParser.prototype.createJSXChildNode = function () {
[493] Fix | Delete
return {
[494] Fix | Delete
index: this.scanner.index,
[495] Fix | Delete
line: this.scanner.lineNumber,
[496] Fix | Delete
column: this.scanner.index - this.scanner.lineStart
[497] Fix | Delete
};
[498] Fix | Delete
};
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function