Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/codemirr...
File: esprima.js
id = ch;
[5500] Fix | Delete
}
[5501] Fix | Delete
while (!this.eof()) {
[5502] Fix | Delete
cp = this.codePointAt(this.index);
[5503] Fix | Delete
if (!character_1.Character.isIdentifierPart(cp)) {
[5504] Fix | Delete
break;
[5505] Fix | Delete
}
[5506] Fix | Delete
ch = character_1.Character.fromCodePoint(cp);
[5507] Fix | Delete
id += ch;
[5508] Fix | Delete
this.index += ch.length;
[5509] Fix | Delete
// '\u' (U+005C, U+0075) denotes an escaped character.
[5510] Fix | Delete
if (cp === 0x5C) {
[5511] Fix | Delete
id = id.substr(0, id.length - 1);
[5512] Fix | Delete
if (this.source.charCodeAt(this.index) !== 0x75) {
[5513] Fix | Delete
this.throwUnexpectedToken();
[5514] Fix | Delete
}
[5515] Fix | Delete
++this.index;
[5516] Fix | Delete
if (this.source[this.index] === '{') {
[5517] Fix | Delete
++this.index;
[5518] Fix | Delete
ch = this.scanUnicodeCodePointEscape();
[5519] Fix | Delete
}
[5520] Fix | Delete
else {
[5521] Fix | Delete
ch = this.scanHexEscape('u');
[5522] Fix | Delete
if (ch === null || ch === '\\' || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
[5523] Fix | Delete
this.throwUnexpectedToken();
[5524] Fix | Delete
}
[5525] Fix | Delete
}
[5526] Fix | Delete
id += ch;
[5527] Fix | Delete
}
[5528] Fix | Delete
}
[5529] Fix | Delete
return id;
[5530] Fix | Delete
};
[5531] Fix | Delete
Scanner.prototype.octalToDecimal = function (ch) {
[5532] Fix | Delete
// \0 is not octal escape sequence
[5533] Fix | Delete
var octal = (ch !== '0');
[5534] Fix | Delete
var code = octalValue(ch);
[5535] Fix | Delete
if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
[5536] Fix | Delete
octal = true;
[5537] Fix | Delete
code = code * 8 + octalValue(this.source[this.index++]);
[5538] Fix | Delete
// 3 digits are only allowed when string starts
[5539] Fix | Delete
// with 0, 1, 2, 3
[5540] Fix | Delete
if ('0123'.indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
[5541] Fix | Delete
code = code * 8 + octalValue(this.source[this.index++]);
[5542] Fix | Delete
}
[5543] Fix | Delete
}
[5544] Fix | Delete
return {
[5545] Fix | Delete
code: code,
[5546] Fix | Delete
octal: octal
[5547] Fix | Delete
};
[5548] Fix | Delete
};
[5549] Fix | Delete
// https://tc39.github.io/ecma262/#sec-names-and-keywords
[5550] Fix | Delete
Scanner.prototype.scanIdentifier = function () {
[5551] Fix | Delete
var type;
[5552] Fix | Delete
var start = this.index;
[5553] Fix | Delete
// Backslash (U+005C) starts an escaped character.
[5554] Fix | Delete
var id = (this.source.charCodeAt(start) === 0x5C) ? this.getComplexIdentifier() : this.getIdentifier();
[5555] Fix | Delete
// There is no keyword or literal with only one character.
[5556] Fix | Delete
// Thus, it must be an identifier.
[5557] Fix | Delete
if (id.length === 1) {
[5558] Fix | Delete
type = 3 /* Identifier */;
[5559] Fix | Delete
}
[5560] Fix | Delete
else if (this.isKeyword(id)) {
[5561] Fix | Delete
type = 4 /* Keyword */;
[5562] Fix | Delete
}
[5563] Fix | Delete
else if (id === 'null') {
[5564] Fix | Delete
type = 5 /* NullLiteral */;
[5565] Fix | Delete
}
[5566] Fix | Delete
else if (id === 'true' || id === 'false') {
[5567] Fix | Delete
type = 1 /* BooleanLiteral */;
[5568] Fix | Delete
}
[5569] Fix | Delete
else {
[5570] Fix | Delete
type = 3 /* Identifier */;
[5571] Fix | Delete
}
[5572] Fix | Delete
if (type !== 3 /* Identifier */ && (start + id.length !== this.index)) {
[5573] Fix | Delete
var restore = this.index;
[5574] Fix | Delete
this.index = start;
[5575] Fix | Delete
this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord);
[5576] Fix | Delete
this.index = restore;
[5577] Fix | Delete
}
[5578] Fix | Delete
return {
[5579] Fix | Delete
type: type,
[5580] Fix | Delete
value: id,
[5581] Fix | Delete
lineNumber: this.lineNumber,
[5582] Fix | Delete
lineStart: this.lineStart,
[5583] Fix | Delete
start: start,
[5584] Fix | Delete
end: this.index
[5585] Fix | Delete
};
[5586] Fix | Delete
};
[5587] Fix | Delete
// https://tc39.github.io/ecma262/#sec-punctuators
[5588] Fix | Delete
Scanner.prototype.scanPunctuator = function () {
[5589] Fix | Delete
var start = this.index;
[5590] Fix | Delete
// Check for most common single-character punctuators.
[5591] Fix | Delete
var str = this.source[this.index];
[5592] Fix | Delete
switch (str) {
[5593] Fix | Delete
case '(':
[5594] Fix | Delete
case '{':
[5595] Fix | Delete
if (str === '{') {
[5596] Fix | Delete
this.curlyStack.push('{');
[5597] Fix | Delete
}
[5598] Fix | Delete
++this.index;
[5599] Fix | Delete
break;
[5600] Fix | Delete
case '.':
[5601] Fix | Delete
++this.index;
[5602] Fix | Delete
if (this.source[this.index] === '.' && this.source[this.index + 1] === '.') {
[5603] Fix | Delete
// Spread operator: ...
[5604] Fix | Delete
this.index += 2;
[5605] Fix | Delete
str = '...';
[5606] Fix | Delete
}
[5607] Fix | Delete
break;
[5608] Fix | Delete
case '}':
[5609] Fix | Delete
++this.index;
[5610] Fix | Delete
this.curlyStack.pop();
[5611] Fix | Delete
break;
[5612] Fix | Delete
case ')':
[5613] Fix | Delete
case ';':
[5614] Fix | Delete
case ',':
[5615] Fix | Delete
case '[':
[5616] Fix | Delete
case ']':
[5617] Fix | Delete
case ':':
[5618] Fix | Delete
case '?':
[5619] Fix | Delete
case '~':
[5620] Fix | Delete
++this.index;
[5621] Fix | Delete
break;
[5622] Fix | Delete
default:
[5623] Fix | Delete
// 4-character punctuator.
[5624] Fix | Delete
str = this.source.substr(this.index, 4);
[5625] Fix | Delete
if (str === '>>>=') {
[5626] Fix | Delete
this.index += 4;
[5627] Fix | Delete
}
[5628] Fix | Delete
else {
[5629] Fix | Delete
// 3-character punctuators.
[5630] Fix | Delete
str = str.substr(0, 3);
[5631] Fix | Delete
if (str === '===' || str === '!==' || str === '>>>' ||
[5632] Fix | Delete
str === '<<=' || str === '>>=' || str === '**=') {
[5633] Fix | Delete
this.index += 3;
[5634] Fix | Delete
}
[5635] Fix | Delete
else {
[5636] Fix | Delete
// 2-character punctuators.
[5637] Fix | Delete
str = str.substr(0, 2);
[5638] Fix | Delete
if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
[5639] Fix | Delete
str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
[5640] Fix | Delete
str === '++' || str === '--' || str === '<<' || str === '>>' ||
[5641] Fix | Delete
str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
[5642] Fix | Delete
str === '<=' || str === '>=' || str === '=>' || str === '**') {
[5643] Fix | Delete
this.index += 2;
[5644] Fix | Delete
}
[5645] Fix | Delete
else {
[5646] Fix | Delete
// 1-character punctuators.
[5647] Fix | Delete
str = this.source[this.index];
[5648] Fix | Delete
if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
[5649] Fix | Delete
++this.index;
[5650] Fix | Delete
}
[5651] Fix | Delete
}
[5652] Fix | Delete
}
[5653] Fix | Delete
}
[5654] Fix | Delete
}
[5655] Fix | Delete
if (this.index === start) {
[5656] Fix | Delete
this.throwUnexpectedToken();
[5657] Fix | Delete
}
[5658] Fix | Delete
return {
[5659] Fix | Delete
type: 7 /* Punctuator */,
[5660] Fix | Delete
value: str,
[5661] Fix | Delete
lineNumber: this.lineNumber,
[5662] Fix | Delete
lineStart: this.lineStart,
[5663] Fix | Delete
start: start,
[5664] Fix | Delete
end: this.index
[5665] Fix | Delete
};
[5666] Fix | Delete
};
[5667] Fix | Delete
// https://tc39.github.io/ecma262/#sec-literals-numeric-literals
[5668] Fix | Delete
Scanner.prototype.scanHexLiteral = function (start) {
[5669] Fix | Delete
var num = '';
[5670] Fix | Delete
while (!this.eof()) {
[5671] Fix | Delete
if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
[5672] Fix | Delete
break;
[5673] Fix | Delete
}
[5674] Fix | Delete
num += this.source[this.index++];
[5675] Fix | Delete
}
[5676] Fix | Delete
if (num.length === 0) {
[5677] Fix | Delete
this.throwUnexpectedToken();
[5678] Fix | Delete
}
[5679] Fix | Delete
if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
[5680] Fix | Delete
this.throwUnexpectedToken();
[5681] Fix | Delete
}
[5682] Fix | Delete
return {
[5683] Fix | Delete
type: 6 /* NumericLiteral */,
[5684] Fix | Delete
value: parseInt('0x' + num, 16),
[5685] Fix | Delete
lineNumber: this.lineNumber,
[5686] Fix | Delete
lineStart: this.lineStart,
[5687] Fix | Delete
start: start,
[5688] Fix | Delete
end: this.index
[5689] Fix | Delete
};
[5690] Fix | Delete
};
[5691] Fix | Delete
Scanner.prototype.scanBinaryLiteral = function (start) {
[5692] Fix | Delete
var num = '';
[5693] Fix | Delete
var ch;
[5694] Fix | Delete
while (!this.eof()) {
[5695] Fix | Delete
ch = this.source[this.index];
[5696] Fix | Delete
if (ch !== '0' && ch !== '1') {
[5697] Fix | Delete
break;
[5698] Fix | Delete
}
[5699] Fix | Delete
num += this.source[this.index++];
[5700] Fix | Delete
}
[5701] Fix | Delete
if (num.length === 0) {
[5702] Fix | Delete
// only 0b or 0B
[5703] Fix | Delete
this.throwUnexpectedToken();
[5704] Fix | Delete
}
[5705] Fix | Delete
if (!this.eof()) {
[5706] Fix | Delete
ch = this.source.charCodeAt(this.index);
[5707] Fix | Delete
/* istanbul ignore else */
[5708] Fix | Delete
if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) {
[5709] Fix | Delete
this.throwUnexpectedToken();
[5710] Fix | Delete
}
[5711] Fix | Delete
}
[5712] Fix | Delete
return {
[5713] Fix | Delete
type: 6 /* NumericLiteral */,
[5714] Fix | Delete
value: parseInt(num, 2),
[5715] Fix | Delete
lineNumber: this.lineNumber,
[5716] Fix | Delete
lineStart: this.lineStart,
[5717] Fix | Delete
start: start,
[5718] Fix | Delete
end: this.index
[5719] Fix | Delete
};
[5720] Fix | Delete
};
[5721] Fix | Delete
Scanner.prototype.scanOctalLiteral = function (prefix, start) {
[5722] Fix | Delete
var num = '';
[5723] Fix | Delete
var octal = false;
[5724] Fix | Delete
if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
[5725] Fix | Delete
octal = true;
[5726] Fix | Delete
num = '0' + this.source[this.index++];
[5727] Fix | Delete
}
[5728] Fix | Delete
else {
[5729] Fix | Delete
++this.index;
[5730] Fix | Delete
}
[5731] Fix | Delete
while (!this.eof()) {
[5732] Fix | Delete
if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
[5733] Fix | Delete
break;
[5734] Fix | Delete
}
[5735] Fix | Delete
num += this.source[this.index++];
[5736] Fix | Delete
}
[5737] Fix | Delete
if (!octal && num.length === 0) {
[5738] Fix | Delete
// only 0o or 0O
[5739] Fix | Delete
this.throwUnexpectedToken();
[5740] Fix | Delete
}
[5741] Fix | Delete
if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
[5742] Fix | Delete
this.throwUnexpectedToken();
[5743] Fix | Delete
}
[5744] Fix | Delete
return {
[5745] Fix | Delete
type: 6 /* NumericLiteral */,
[5746] Fix | Delete
value: parseInt(num, 8),
[5747] Fix | Delete
octal: octal,
[5748] Fix | Delete
lineNumber: this.lineNumber,
[5749] Fix | Delete
lineStart: this.lineStart,
[5750] Fix | Delete
start: start,
[5751] Fix | Delete
end: this.index
[5752] Fix | Delete
};
[5753] Fix | Delete
};
[5754] Fix | Delete
Scanner.prototype.isImplicitOctalLiteral = function () {
[5755] Fix | Delete
// Implicit octal, unless there is a non-octal digit.
[5756] Fix | Delete
// (Annex B.1.1 on Numeric Literals)
[5757] Fix | Delete
for (var i = this.index + 1; i < this.length; ++i) {
[5758] Fix | Delete
var ch = this.source[i];
[5759] Fix | Delete
if (ch === '8' || ch === '9') {
[5760] Fix | Delete
return false;
[5761] Fix | Delete
}
[5762] Fix | Delete
if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
[5763] Fix | Delete
return true;
[5764] Fix | Delete
}
[5765] Fix | Delete
}
[5766] Fix | Delete
return true;
[5767] Fix | Delete
};
[5768] Fix | Delete
Scanner.prototype.scanNumericLiteral = function () {
[5769] Fix | Delete
var start = this.index;
[5770] Fix | Delete
var ch = this.source[start];
[5771] Fix | Delete
assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point');
[5772] Fix | Delete
var num = '';
[5773] Fix | Delete
if (ch !== '.') {
[5774] Fix | Delete
num = this.source[this.index++];
[5775] Fix | Delete
ch = this.source[this.index];
[5776] Fix | Delete
// Hex number starts with '0x'.
[5777] Fix | Delete
// Octal number starts with '0'.
[5778] Fix | Delete
// Octal number in ES6 starts with '0o'.
[5779] Fix | Delete
// Binary number in ES6 starts with '0b'.
[5780] Fix | Delete
if (num === '0') {
[5781] Fix | Delete
if (ch === 'x' || ch === 'X') {
[5782] Fix | Delete
++this.index;
[5783] Fix | Delete
return this.scanHexLiteral(start);
[5784] Fix | Delete
}
[5785] Fix | Delete
if (ch === 'b' || ch === 'B') {
[5786] Fix | Delete
++this.index;
[5787] Fix | Delete
return this.scanBinaryLiteral(start);
[5788] Fix | Delete
}
[5789] Fix | Delete
if (ch === 'o' || ch === 'O') {
[5790] Fix | Delete
return this.scanOctalLiteral(ch, start);
[5791] Fix | Delete
}
[5792] Fix | Delete
if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
[5793] Fix | Delete
if (this.isImplicitOctalLiteral()) {
[5794] Fix | Delete
return this.scanOctalLiteral(ch, start);
[5795] Fix | Delete
}
[5796] Fix | Delete
}
[5797] Fix | Delete
}
[5798] Fix | Delete
while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
[5799] Fix | Delete
num += this.source[this.index++];
[5800] Fix | Delete
}
[5801] Fix | Delete
ch = this.source[this.index];
[5802] Fix | Delete
}
[5803] Fix | Delete
if (ch === '.') {
[5804] Fix | Delete
num += this.source[this.index++];
[5805] Fix | Delete
while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
[5806] Fix | Delete
num += this.source[this.index++];
[5807] Fix | Delete
}
[5808] Fix | Delete
ch = this.source[this.index];
[5809] Fix | Delete
}
[5810] Fix | Delete
if (ch === 'e' || ch === 'E') {
[5811] Fix | Delete
num += this.source[this.index++];
[5812] Fix | Delete
ch = this.source[this.index];
[5813] Fix | Delete
if (ch === '+' || ch === '-') {
[5814] Fix | Delete
num += this.source[this.index++];
[5815] Fix | Delete
}
[5816] Fix | Delete
if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
[5817] Fix | Delete
while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
[5818] Fix | Delete
num += this.source[this.index++];
[5819] Fix | Delete
}
[5820] Fix | Delete
}
[5821] Fix | Delete
else {
[5822] Fix | Delete
this.throwUnexpectedToken();
[5823] Fix | Delete
}
[5824] Fix | Delete
}
[5825] Fix | Delete
if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
[5826] Fix | Delete
this.throwUnexpectedToken();
[5827] Fix | Delete
}
[5828] Fix | Delete
return {
[5829] Fix | Delete
type: 6 /* NumericLiteral */,
[5830] Fix | Delete
value: parseFloat(num),
[5831] Fix | Delete
lineNumber: this.lineNumber,
[5832] Fix | Delete
lineStart: this.lineStart,
[5833] Fix | Delete
start: start,
[5834] Fix | Delete
end: this.index
[5835] Fix | Delete
};
[5836] Fix | Delete
};
[5837] Fix | Delete
// https://tc39.github.io/ecma262/#sec-literals-string-literals
[5838] Fix | Delete
Scanner.prototype.scanStringLiteral = function () {
[5839] Fix | Delete
var start = this.index;
[5840] Fix | Delete
var quote = this.source[start];
[5841] Fix | Delete
assert_1.assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote');
[5842] Fix | Delete
++this.index;
[5843] Fix | Delete
var octal = false;
[5844] Fix | Delete
var str = '';
[5845] Fix | Delete
while (!this.eof()) {
[5846] Fix | Delete
var ch = this.source[this.index++];
[5847] Fix | Delete
if (ch === quote) {
[5848] Fix | Delete
quote = '';
[5849] Fix | Delete
break;
[5850] Fix | Delete
}
[5851] Fix | Delete
else if (ch === '\\') {
[5852] Fix | Delete
ch = this.source[this.index++];
[5853] Fix | Delete
if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
[5854] Fix | Delete
switch (ch) {
[5855] Fix | Delete
case 'u':
[5856] Fix | Delete
if (this.source[this.index] === '{') {
[5857] Fix | Delete
++this.index;
[5858] Fix | Delete
str += this.scanUnicodeCodePointEscape();
[5859] Fix | Delete
}
[5860] Fix | Delete
else {
[5861] Fix | Delete
var unescaped_1 = this.scanHexEscape(ch);
[5862] Fix | Delete
if (unescaped_1 === null) {
[5863] Fix | Delete
this.throwUnexpectedToken();
[5864] Fix | Delete
}
[5865] Fix | Delete
str += unescaped_1;
[5866] Fix | Delete
}
[5867] Fix | Delete
break;
[5868] Fix | Delete
case 'x':
[5869] Fix | Delete
var unescaped = this.scanHexEscape(ch);
[5870] Fix | Delete
if (unescaped === null) {
[5871] Fix | Delete
this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
[5872] Fix | Delete
}
[5873] Fix | Delete
str += unescaped;
[5874] Fix | Delete
break;
[5875] Fix | Delete
case 'n':
[5876] Fix | Delete
str += '\n';
[5877] Fix | Delete
break;
[5878] Fix | Delete
case 'r':
[5879] Fix | Delete
str += '\r';
[5880] Fix | Delete
break;
[5881] Fix | Delete
case 't':
[5882] Fix | Delete
str += '\t';
[5883] Fix | Delete
break;
[5884] Fix | Delete
case 'b':
[5885] Fix | Delete
str += '\b';
[5886] Fix | Delete
break;
[5887] Fix | Delete
case 'f':
[5888] Fix | Delete
str += '\f';
[5889] Fix | Delete
break;
[5890] Fix | Delete
case 'v':
[5891] Fix | Delete
str += '\x0B';
[5892] Fix | Delete
break;
[5893] Fix | Delete
case '8':
[5894] Fix | Delete
case '9':
[5895] Fix | Delete
str += ch;
[5896] Fix | Delete
this.tolerateUnexpectedToken();
[5897] Fix | Delete
break;
[5898] Fix | Delete
default:
[5899] Fix | Delete
if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
[5900] Fix | Delete
var octToDec = this.octalToDecimal(ch);
[5901] Fix | Delete
octal = octToDec.octal || octal;
[5902] Fix | Delete
str += String.fromCharCode(octToDec.code);
[5903] Fix | Delete
}
[5904] Fix | Delete
else {
[5905] Fix | Delete
str += ch;
[5906] Fix | Delete
}
[5907] Fix | Delete
break;
[5908] Fix | Delete
}
[5909] Fix | Delete
}
[5910] Fix | Delete
else {
[5911] Fix | Delete
++this.lineNumber;
[5912] Fix | Delete
if (ch === '\r' && this.source[this.index] === '\n') {
[5913] Fix | Delete
++this.index;
[5914] Fix | Delete
}
[5915] Fix | Delete
this.lineStart = this.index;
[5916] Fix | Delete
}
[5917] Fix | Delete
}
[5918] Fix | Delete
else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
[5919] Fix | Delete
break;
[5920] Fix | Delete
}
[5921] Fix | Delete
else {
[5922] Fix | Delete
str += ch;
[5923] Fix | Delete
}
[5924] Fix | Delete
}
[5925] Fix | Delete
if (quote !== '') {
[5926] Fix | Delete
this.index = start;
[5927] Fix | Delete
this.throwUnexpectedToken();
[5928] Fix | Delete
}
[5929] Fix | Delete
return {
[5930] Fix | Delete
type: 8 /* StringLiteral */,
[5931] Fix | Delete
value: str,
[5932] Fix | Delete
octal: octal,
[5933] Fix | Delete
lineNumber: this.lineNumber,
[5934] Fix | Delete
lineStart: this.lineStart,
[5935] Fix | Delete
start: start,
[5936] Fix | Delete
end: this.index
[5937] Fix | Delete
};
[5938] Fix | Delete
};
[5939] Fix | Delete
// https://tc39.github.io/ecma262/#sec-template-literal-lexical-components
[5940] Fix | Delete
Scanner.prototype.scanTemplate = function () {
[5941] Fix | Delete
var cooked = '';
[5942] Fix | Delete
var terminated = false;
[5943] Fix | Delete
var start = this.index;
[5944] Fix | Delete
var head = (this.source[start] === '`');
[5945] Fix | Delete
var tail = false;
[5946] Fix | Delete
var rawOffset = 2;
[5947] Fix | Delete
++this.index;
[5948] Fix | Delete
while (!this.eof()) {
[5949] Fix | Delete
var ch = this.source[this.index++];
[5950] Fix | Delete
if (ch === '`') {
[5951] Fix | Delete
rawOffset = 1;
[5952] Fix | Delete
tail = true;
[5953] Fix | Delete
terminated = true;
[5954] Fix | Delete
break;
[5955] Fix | Delete
}
[5956] Fix | Delete
else if (ch === '$') {
[5957] Fix | Delete
if (this.source[this.index] === '{') {
[5958] Fix | Delete
this.curlyStack.push('${');
[5959] Fix | Delete
++this.index;
[5960] Fix | Delete
terminated = true;
[5961] Fix | Delete
break;
[5962] Fix | Delete
}
[5963] Fix | Delete
cooked += ch;
[5964] Fix | Delete
}
[5965] Fix | Delete
else if (ch === '\\') {
[5966] Fix | Delete
ch = this.source[this.index++];
[5967] Fix | Delete
if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
[5968] Fix | Delete
switch (ch) {
[5969] Fix | Delete
case 'n':
[5970] Fix | Delete
cooked += '\n';
[5971] Fix | Delete
break;
[5972] Fix | Delete
case 'r':
[5973] Fix | Delete
cooked += '\r';
[5974] Fix | Delete
break;
[5975] Fix | Delete
case 't':
[5976] Fix | Delete
cooked += '\t';
[5977] Fix | Delete
break;
[5978] Fix | Delete
case 'u':
[5979] Fix | Delete
if (this.source[this.index] === '{') {
[5980] Fix | Delete
++this.index;
[5981] Fix | Delete
cooked += this.scanUnicodeCodePointEscape();
[5982] Fix | Delete
}
[5983] Fix | Delete
else {
[5984] Fix | Delete
var restore = this.index;
[5985] Fix | Delete
var unescaped_2 = this.scanHexEscape(ch);
[5986] Fix | Delete
if (unescaped_2 !== null) {
[5987] Fix | Delete
cooked += unescaped_2;
[5988] Fix | Delete
}
[5989] Fix | Delete
else {
[5990] Fix | Delete
this.index = restore;
[5991] Fix | Delete
cooked += ch;
[5992] Fix | Delete
}
[5993] Fix | Delete
}
[5994] Fix | Delete
break;
[5995] Fix | Delete
case 'x':
[5996] Fix | Delete
var unescaped = this.scanHexEscape(ch);
[5997] Fix | Delete
if (unescaped === null) {
[5998] Fix | Delete
this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
[5999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function