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
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/codemirr.../mode/javascri...
File: javascript.js
// CodeMirror, copyright (c) by Marijn Haverbeke and others
[0] Fix | Delete
// Distributed under an MIT license: http://codemirror.net/LICENSE
[1] Fix | Delete
[2] Fix | Delete
(function(mod) {
[3] Fix | Delete
if (typeof exports == "object" && typeof module == "object") // CommonJS
[4] Fix | Delete
mod(require("../../lib/codemirror"));
[5] Fix | Delete
else if (typeof define == "function" && define.amd) // AMD
[6] Fix | Delete
define(["../../lib/codemirror"], mod);
[7] Fix | Delete
else // Plain browser env
[8] Fix | Delete
mod(CodeMirror);
[9] Fix | Delete
})(function(CodeMirror) {
[10] Fix | Delete
"use strict";
[11] Fix | Delete
[12] Fix | Delete
function expressionAllowed(stream, state, backUp) {
[13] Fix | Delete
return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
[14] Fix | Delete
(state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
CodeMirror.defineMode("javascript", function(config, parserConfig) {
[18] Fix | Delete
var indentUnit = config.indentUnit;
[19] Fix | Delete
var statementIndent = parserConfig.statementIndent;
[20] Fix | Delete
var jsonldMode = parserConfig.jsonld;
[21] Fix | Delete
var jsonMode = parserConfig.json || jsonldMode;
[22] Fix | Delete
var isTS = parserConfig.typescript;
[23] Fix | Delete
var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
[24] Fix | Delete
[25] Fix | Delete
// Tokenizer
[26] Fix | Delete
[27] Fix | Delete
var keywords = function(){
[28] Fix | Delete
function kw(type) {return {type: type, style: "keyword"};}
[29] Fix | Delete
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
[30] Fix | Delete
var operator = kw("operator"), atom = {type: "atom", style: "atom"};
[31] Fix | Delete
[32] Fix | Delete
var jsKeywords = {
[33] Fix | Delete
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
[34] Fix | Delete
"return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
[35] Fix | Delete
"var": kw("var"), "const": kw("var"), "let": kw("var"),
[36] Fix | Delete
"function": kw("function"), "catch": kw("catch"),
[37] Fix | Delete
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
[38] Fix | Delete
"in": operator, "typeof": operator, "instanceof": operator,
[39] Fix | Delete
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
[40] Fix | Delete
"this": kw("this"), "class": kw("class"), "super": kw("atom"),
[41] Fix | Delete
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
[42] Fix | Delete
"await": C, "async": kw("async")
[43] Fix | Delete
};
[44] Fix | Delete
[45] Fix | Delete
// Extend the 'normal' keywords with the TypeScript language extensions
[46] Fix | Delete
if (isTS) {
[47] Fix | Delete
var type = {type: "variable", style: "variable-3"};
[48] Fix | Delete
var tsKeywords = {
[49] Fix | Delete
// object-like things
[50] Fix | Delete
"interface": kw("class"),
[51] Fix | Delete
"implements": C,
[52] Fix | Delete
"namespace": C,
[53] Fix | Delete
"module": kw("module"),
[54] Fix | Delete
"enum": kw("module"),
[55] Fix | Delete
[56] Fix | Delete
// scope modifiers
[57] Fix | Delete
"public": kw("modifier"),
[58] Fix | Delete
"private": kw("modifier"),
[59] Fix | Delete
"protected": kw("modifier"),
[60] Fix | Delete
"abstract": kw("modifier"),
[61] Fix | Delete
[62] Fix | Delete
// operators
[63] Fix | Delete
"as": operator,
[64] Fix | Delete
[65] Fix | Delete
// types
[66] Fix | Delete
"string": type, "number": type, "boolean": type, "any": type
[67] Fix | Delete
};
[68] Fix | Delete
[69] Fix | Delete
for (var attr in tsKeywords) {
[70] Fix | Delete
jsKeywords[attr] = tsKeywords[attr];
[71] Fix | Delete
}
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
return jsKeywords;
[75] Fix | Delete
}();
[76] Fix | Delete
[77] Fix | Delete
var isOperatorChar = /[+\-*&%=<>!?|~^]/;
[78] Fix | Delete
var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
[79] Fix | Delete
[80] Fix | Delete
function readRegexp(stream) {
[81] Fix | Delete
var escaped = false, next, inSet = false;
[82] Fix | Delete
while ((next = stream.next()) != null) {
[83] Fix | Delete
if (!escaped) {
[84] Fix | Delete
if (next == "/" && !inSet) return;
[85] Fix | Delete
if (next == "[") inSet = true;
[86] Fix | Delete
else if (inSet && next == "]") inSet = false;
[87] Fix | Delete
}
[88] Fix | Delete
escaped = !escaped && next == "\\";
[89] Fix | Delete
}
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
// Used as scratch variables to communicate multiple values without
[93] Fix | Delete
// consing up tons of objects.
[94] Fix | Delete
var type, content;
[95] Fix | Delete
function ret(tp, style, cont) {
[96] Fix | Delete
type = tp; content = cont;
[97] Fix | Delete
return style;
[98] Fix | Delete
}
[99] Fix | Delete
function tokenBase(stream, state) {
[100] Fix | Delete
var ch = stream.next();
[101] Fix | Delete
if (ch == '"' || ch == "'") {
[102] Fix | Delete
state.tokenize = tokenString(ch);
[103] Fix | Delete
return state.tokenize(stream, state);
[104] Fix | Delete
} else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {
[105] Fix | Delete
return ret("number", "number");
[106] Fix | Delete
} else if (ch == "." && stream.match("..")) {
[107] Fix | Delete
return ret("spread", "meta");
[108] Fix | Delete
} else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
[109] Fix | Delete
return ret(ch);
[110] Fix | Delete
} else if (ch == "=" && stream.eat(">")) {
[111] Fix | Delete
return ret("=>", "operator");
[112] Fix | Delete
} else if (ch == "0" && stream.eat(/x/i)) {
[113] Fix | Delete
stream.eatWhile(/[\da-f]/i);
[114] Fix | Delete
return ret("number", "number");
[115] Fix | Delete
} else if (ch == "0" && stream.eat(/o/i)) {
[116] Fix | Delete
stream.eatWhile(/[0-7]/i);
[117] Fix | Delete
return ret("number", "number");
[118] Fix | Delete
} else if (ch == "0" && stream.eat(/b/i)) {
[119] Fix | Delete
stream.eatWhile(/[01]/i);
[120] Fix | Delete
return ret("number", "number");
[121] Fix | Delete
} else if (/\d/.test(ch)) {
[122] Fix | Delete
stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
[123] Fix | Delete
return ret("number", "number");
[124] Fix | Delete
} else if (ch == "/") {
[125] Fix | Delete
if (stream.eat("*")) {
[126] Fix | Delete
state.tokenize = tokenComment;
[127] Fix | Delete
return tokenComment(stream, state);
[128] Fix | Delete
} else if (stream.eat("/")) {
[129] Fix | Delete
stream.skipToEnd();
[130] Fix | Delete
return ret("comment", "comment");
[131] Fix | Delete
} else if (expressionAllowed(stream, state, 1)) {
[132] Fix | Delete
readRegexp(stream);
[133] Fix | Delete
stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
[134] Fix | Delete
return ret("regexp", "string-2");
[135] Fix | Delete
} else {
[136] Fix | Delete
stream.eatWhile(isOperatorChar);
[137] Fix | Delete
return ret("operator", "operator", stream.current());
[138] Fix | Delete
}
[139] Fix | Delete
} else if (ch == "`") {
[140] Fix | Delete
state.tokenize = tokenQuasi;
[141] Fix | Delete
return tokenQuasi(stream, state);
[142] Fix | Delete
} else if (ch == "#") {
[143] Fix | Delete
stream.skipToEnd();
[144] Fix | Delete
return ret("error", "error");
[145] Fix | Delete
} else if (isOperatorChar.test(ch)) {
[146] Fix | Delete
stream.eatWhile(isOperatorChar);
[147] Fix | Delete
return ret("operator", "operator", stream.current());
[148] Fix | Delete
} else if (wordRE.test(ch)) {
[149] Fix | Delete
stream.eatWhile(wordRE);
[150] Fix | Delete
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
[151] Fix | Delete
return (known && state.lastType != ".") ? ret(known.type, known.style, word) :
[152] Fix | Delete
ret("variable", "variable", word);
[153] Fix | Delete
}
[154] Fix | Delete
}
[155] Fix | Delete
[156] Fix | Delete
function tokenString(quote) {
[157] Fix | Delete
return function(stream, state) {
[158] Fix | Delete
var escaped = false, next;
[159] Fix | Delete
if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
[160] Fix | Delete
state.tokenize = tokenBase;
[161] Fix | Delete
return ret("jsonld-keyword", "meta");
[162] Fix | Delete
}
[163] Fix | Delete
while ((next = stream.next()) != null) {
[164] Fix | Delete
if (next == quote && !escaped) break;
[165] Fix | Delete
escaped = !escaped && next == "\\";
[166] Fix | Delete
}
[167] Fix | Delete
if (!escaped) state.tokenize = tokenBase;
[168] Fix | Delete
return ret("string", "string");
[169] Fix | Delete
};
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
function tokenComment(stream, state) {
[173] Fix | Delete
var maybeEnd = false, ch;
[174] Fix | Delete
while (ch = stream.next()) {
[175] Fix | Delete
if (ch == "/" && maybeEnd) {
[176] Fix | Delete
state.tokenize = tokenBase;
[177] Fix | Delete
break;
[178] Fix | Delete
}
[179] Fix | Delete
maybeEnd = (ch == "*");
[180] Fix | Delete
}
[181] Fix | Delete
return ret("comment", "comment");
[182] Fix | Delete
}
[183] Fix | Delete
[184] Fix | Delete
function tokenQuasi(stream, state) {
[185] Fix | Delete
var escaped = false, next;
[186] Fix | Delete
while ((next = stream.next()) != null) {
[187] Fix | Delete
if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
[188] Fix | Delete
state.tokenize = tokenBase;
[189] Fix | Delete
break;
[190] Fix | Delete
}
[191] Fix | Delete
escaped = !escaped && next == "\\";
[192] Fix | Delete
}
[193] Fix | Delete
return ret("quasi", "string-2", stream.current());
[194] Fix | Delete
}
[195] Fix | Delete
[196] Fix | Delete
var brackets = "([{}])";
[197] Fix | Delete
// This is a crude lookahead trick to try and notice that we're
[198] Fix | Delete
// parsing the argument patterns for a fat-arrow function before we
[199] Fix | Delete
// actually hit the arrow token. It only works if the arrow is on
[200] Fix | Delete
// the same line as the arguments and there's no strange noise
[201] Fix | Delete
// (comments) in between. Fallback is to only notice when we hit the
[202] Fix | Delete
// arrow, and not declare the arguments as locals for the arrow
[203] Fix | Delete
// body.
[204] Fix | Delete
function findFatArrow(stream, state) {
[205] Fix | Delete
if (state.fatArrowAt) state.fatArrowAt = null;
[206] Fix | Delete
var arrow = stream.string.indexOf("=>", stream.start);
[207] Fix | Delete
if (arrow < 0) return;
[208] Fix | Delete
[209] Fix | Delete
var depth = 0, sawSomething = false;
[210] Fix | Delete
for (var pos = arrow - 1; pos >= 0; --pos) {
[211] Fix | Delete
var ch = stream.string.charAt(pos);
[212] Fix | Delete
var bracket = brackets.indexOf(ch);
[213] Fix | Delete
if (bracket >= 0 && bracket < 3) {
[214] Fix | Delete
if (!depth) { ++pos; break; }
[215] Fix | Delete
if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
[216] Fix | Delete
} else if (bracket >= 3 && bracket < 6) {
[217] Fix | Delete
++depth;
[218] Fix | Delete
} else if (wordRE.test(ch)) {
[219] Fix | Delete
sawSomething = true;
[220] Fix | Delete
} else if (/["'\/]/.test(ch)) {
[221] Fix | Delete
return;
[222] Fix | Delete
} else if (sawSomething && !depth) {
[223] Fix | Delete
++pos;
[224] Fix | Delete
break;
[225] Fix | Delete
}
[226] Fix | Delete
}
[227] Fix | Delete
if (sawSomething && !depth) state.fatArrowAt = pos;
[228] Fix | Delete
}
[229] Fix | Delete
[230] Fix | Delete
// Parser
[231] Fix | Delete
[232] Fix | Delete
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
[233] Fix | Delete
[234] Fix | Delete
function JSLexical(indented, column, type, align, prev, info) {
[235] Fix | Delete
this.indented = indented;
[236] Fix | Delete
this.column = column;
[237] Fix | Delete
this.type = type;
[238] Fix | Delete
this.prev = prev;
[239] Fix | Delete
this.info = info;
[240] Fix | Delete
if (align != null) this.align = align;
[241] Fix | Delete
}
[242] Fix | Delete
[243] Fix | Delete
function inScope(state, varname) {
[244] Fix | Delete
for (var v = state.localVars; v; v = v.next)
[245] Fix | Delete
if (v.name == varname) return true;
[246] Fix | Delete
for (var cx = state.context; cx; cx = cx.prev) {
[247] Fix | Delete
for (var v = cx.vars; v; v = v.next)
[248] Fix | Delete
if (v.name == varname) return true;
[249] Fix | Delete
}
[250] Fix | Delete
}
[251] Fix | Delete
[252] Fix | Delete
function parseJS(state, style, type, content, stream) {
[253] Fix | Delete
var cc = state.cc;
[254] Fix | Delete
// Communicate our context to the combinators.
[255] Fix | Delete
// (Less wasteful than consing up a hundred closures on every call.)
[256] Fix | Delete
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;
[257] Fix | Delete
[258] Fix | Delete
if (!state.lexical.hasOwnProperty("align"))
[259] Fix | Delete
state.lexical.align = true;
[260] Fix | Delete
[261] Fix | Delete
while(true) {
[262] Fix | Delete
var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
[263] Fix | Delete
if (combinator(type, content)) {
[264] Fix | Delete
while(cc.length && cc[cc.length - 1].lex)
[265] Fix | Delete
cc.pop()();
[266] Fix | Delete
if (cx.marked) return cx.marked;
[267] Fix | Delete
if (type == "variable" && inScope(state, content)) return "variable-2";
[268] Fix | Delete
return style;
[269] Fix | Delete
}
[270] Fix | Delete
}
[271] Fix | Delete
}
[272] Fix | Delete
[273] Fix | Delete
// Combinator utils
[274] Fix | Delete
[275] Fix | Delete
var cx = {state: null, column: null, marked: null, cc: null};
[276] Fix | Delete
function pass() {
[277] Fix | Delete
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
[278] Fix | Delete
}
[279] Fix | Delete
function cont() {
[280] Fix | Delete
pass.apply(null, arguments);
[281] Fix | Delete
return true;
[282] Fix | Delete
}
[283] Fix | Delete
function register(varname) {
[284] Fix | Delete
function inList(list) {
[285] Fix | Delete
for (var v = list; v; v = v.next)
[286] Fix | Delete
if (v.name == varname) return true;
[287] Fix | Delete
return false;
[288] Fix | Delete
}
[289] Fix | Delete
var state = cx.state;
[290] Fix | Delete
cx.marked = "def";
[291] Fix | Delete
if (state.context) {
[292] Fix | Delete
if (inList(state.localVars)) return;
[293] Fix | Delete
state.localVars = {name: varname, next: state.localVars};
[294] Fix | Delete
} else {
[295] Fix | Delete
if (inList(state.globalVars)) return;
[296] Fix | Delete
if (parserConfig.globalVars)
[297] Fix | Delete
state.globalVars = {name: varname, next: state.globalVars};
[298] Fix | Delete
}
[299] Fix | Delete
}
[300] Fix | Delete
[301] Fix | Delete
// Combinators
[302] Fix | Delete
[303] Fix | Delete
var defaultVars = {name: "this", next: {name: "arguments"}};
[304] Fix | Delete
function pushcontext() {
[305] Fix | Delete
cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
[306] Fix | Delete
cx.state.localVars = defaultVars;
[307] Fix | Delete
}
[308] Fix | Delete
function popcontext() {
[309] Fix | Delete
cx.state.localVars = cx.state.context.vars;
[310] Fix | Delete
cx.state.context = cx.state.context.prev;
[311] Fix | Delete
}
[312] Fix | Delete
function pushlex(type, info) {
[313] Fix | Delete
var result = function() {
[314] Fix | Delete
var state = cx.state, indent = state.indented;
[315] Fix | Delete
if (state.lexical.type == "stat") indent = state.lexical.indented;
[316] Fix | Delete
else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
[317] Fix | Delete
indent = outer.indented;
[318] Fix | Delete
state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
[319] Fix | Delete
};
[320] Fix | Delete
result.lex = true;
[321] Fix | Delete
return result;
[322] Fix | Delete
}
[323] Fix | Delete
function poplex() {
[324] Fix | Delete
var state = cx.state;
[325] Fix | Delete
if (state.lexical.prev) {
[326] Fix | Delete
if (state.lexical.type == ")")
[327] Fix | Delete
state.indented = state.lexical.indented;
[328] Fix | Delete
state.lexical = state.lexical.prev;
[329] Fix | Delete
}
[330] Fix | Delete
}
[331] Fix | Delete
poplex.lex = true;
[332] Fix | Delete
[333] Fix | Delete
function expect(wanted) {
[334] Fix | Delete
function exp(type) {
[335] Fix | Delete
if (type == wanted) return cont();
[336] Fix | Delete
else if (wanted == ";") return pass();
[337] Fix | Delete
else return cont(exp);
[338] Fix | Delete
};
[339] Fix | Delete
return exp;
[340] Fix | Delete
}
[341] Fix | Delete
[342] Fix | Delete
function statement(type, value) {
[343] Fix | Delete
if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);
[344] Fix | Delete
if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
[345] Fix | Delete
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
[346] Fix | Delete
if (type == "{") return cont(pushlex("}"), block, poplex);
[347] Fix | Delete
if (type == ";") return cont();
[348] Fix | Delete
if (type == "if") {
[349] Fix | Delete
if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
[350] Fix | Delete
cx.state.cc.pop()();
[351] Fix | Delete
return cont(pushlex("form"), expression, statement, poplex, maybeelse);
[352] Fix | Delete
}
[353] Fix | Delete
if (type == "function") return cont(functiondef);
[354] Fix | Delete
if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
[355] Fix | Delete
if (type == "variable") return cont(pushlex("stat"), maybelabel);
[356] Fix | Delete
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
[357] Fix | Delete
block, poplex, poplex);
[358] Fix | Delete
if (type == "case") return cont(expression, expect(":"));
[359] Fix | Delete
if (type == "default") return cont(expect(":"));
[360] Fix | Delete
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
[361] Fix | Delete
statement, poplex, popcontext);
[362] Fix | Delete
if (type == "class") return cont(pushlex("form"), className, poplex);
[363] Fix | Delete
if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
[364] Fix | Delete
if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
[365] Fix | Delete
if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
[366] Fix | Delete
if (type == "async") return cont(statement)
[367] Fix | Delete
return pass(pushlex("stat"), expression, expect(";"), poplex);
[368] Fix | Delete
}
[369] Fix | Delete
function expression(type) {
[370] Fix | Delete
return expressionInner(type, false);
[371] Fix | Delete
}
[372] Fix | Delete
function expressionNoComma(type) {
[373] Fix | Delete
return expressionInner(type, true);
[374] Fix | Delete
}
[375] Fix | Delete
function expressionInner(type, noComma) {
[376] Fix | Delete
if (cx.state.fatArrowAt == cx.stream.start) {
[377] Fix | Delete
var body = noComma ? arrowBodyNoComma : arrowBody;
[378] Fix | Delete
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);
[379] Fix | Delete
else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
[380] Fix | Delete
}
[381] Fix | Delete
[382] Fix | Delete
var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
[383] Fix | Delete
if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
[384] Fix | Delete
if (type == "function") return cont(functiondef, maybeop);
[385] Fix | Delete
if (type == "keyword c" || type == "async") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
[386] Fix | Delete
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
[387] Fix | Delete
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
[388] Fix | Delete
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
[389] Fix | Delete
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
[390] Fix | Delete
if (type == "quasi") return pass(quasi, maybeop);
[391] Fix | Delete
if (type == "new") return cont(maybeTarget(noComma));
[392] Fix | Delete
return cont();
[393] Fix | Delete
}
[394] Fix | Delete
function maybeexpression(type) {
[395] Fix | Delete
if (type.match(/[;\}\)\],]/)) return pass();
[396] Fix | Delete
return pass(expression);
[397] Fix | Delete
}
[398] Fix | Delete
function maybeexpressionNoComma(type) {
[399] Fix | Delete
if (type.match(/[;\}\)\],]/)) return pass();
[400] Fix | Delete
return pass(expressionNoComma);
[401] Fix | Delete
}
[402] Fix | Delete
[403] Fix | Delete
function maybeoperatorComma(type, value) {
[404] Fix | Delete
if (type == ",") return cont(expression);
[405] Fix | Delete
return maybeoperatorNoComma(type, value, false);
[406] Fix | Delete
}
[407] Fix | Delete
function maybeoperatorNoComma(type, value, noComma) {
[408] Fix | Delete
var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
[409] Fix | Delete
var expr = noComma == false ? expression : expressionNoComma;
[410] Fix | Delete
if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
[411] Fix | Delete
if (type == "operator") {
[412] Fix | Delete
if (/\+\+|--/.test(value)) return cont(me);
[413] Fix | Delete
if (value == "?") return cont(expression, expect(":"), expr);
[414] Fix | Delete
return cont(expr);
[415] Fix | Delete
}
[416] Fix | Delete
if (type == "quasi") { return pass(quasi, me); }
[417] Fix | Delete
if (type == ";") return;
[418] Fix | Delete
if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
[419] Fix | Delete
if (type == ".") return cont(property, me);
[420] Fix | Delete
if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
[421] Fix | Delete
}
[422] Fix | Delete
function quasi(type, value) {
[423] Fix | Delete
if (type != "quasi") return pass();
[424] Fix | Delete
if (value.slice(value.length - 2) != "${") return cont(quasi);
[425] Fix | Delete
return cont(expression, continueQuasi);
[426] Fix | Delete
}
[427] Fix | Delete
function continueQuasi(type) {
[428] Fix | Delete
if (type == "}") {
[429] Fix | Delete
cx.marked = "string-2";
[430] Fix | Delete
cx.state.tokenize = tokenQuasi;
[431] Fix | Delete
return cont(quasi);
[432] Fix | Delete
}
[433] Fix | Delete
}
[434] Fix | Delete
function arrowBody(type) {
[435] Fix | Delete
findFatArrow(cx.stream, cx.state);
[436] Fix | Delete
return pass(type == "{" ? statement : expression);
[437] Fix | Delete
}
[438] Fix | Delete
function arrowBodyNoComma(type) {
[439] Fix | Delete
findFatArrow(cx.stream, cx.state);
[440] Fix | Delete
return pass(type == "{" ? statement : expressionNoComma);
[441] Fix | Delete
}
[442] Fix | Delete
function maybeTarget(noComma) {
[443] Fix | Delete
return function(type) {
[444] Fix | Delete
if (type == ".") return cont(noComma ? targetNoComma : target);
[445] Fix | Delete
else return pass(noComma ? expressionNoComma : expression);
[446] Fix | Delete
};
[447] Fix | Delete
}
[448] Fix | Delete
function target(_, value) {
[449] Fix | Delete
if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
[450] Fix | Delete
}
[451] Fix | Delete
function targetNoComma(_, value) {
[452] Fix | Delete
if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
[453] Fix | Delete
}
[454] Fix | Delete
function maybelabel(type) {
[455] Fix | Delete
if (type == ":") return cont(poplex, statement);
[456] Fix | Delete
return pass(maybeoperatorComma, expect(";"), poplex);
[457] Fix | Delete
}
[458] Fix | Delete
function property(type) {
[459] Fix | Delete
if (type == "variable") {cx.marked = "property"; return cont();}
[460] Fix | Delete
}
[461] Fix | Delete
function objprop(type, value) {
[462] Fix | Delete
if (type == "async") {
[463] Fix | Delete
cx.marked = "property";
[464] Fix | Delete
return cont(objprop);
[465] Fix | Delete
} else if (type == "variable" || cx.style == "keyword") {
[466] Fix | Delete
cx.marked = "property";
[467] Fix | Delete
if (value == "get" || value == "set") return cont(getterSetter);
[468] Fix | Delete
return cont(afterprop);
[469] Fix | Delete
} else if (type == "number" || type == "string") {
[470] Fix | Delete
cx.marked = jsonldMode ? "property" : (cx.style + " property");
[471] Fix | Delete
return cont(afterprop);
[472] Fix | Delete
} else if (type == "jsonld-keyword") {
[473] Fix | Delete
return cont(afterprop);
[474] Fix | Delete
} else if (type == "modifier") {
[475] Fix | Delete
return cont(objprop)
[476] Fix | Delete
} else if (type == "[") {
[477] Fix | Delete
return cont(expression, expect("]"), afterprop);
[478] Fix | Delete
} else if (type == "spread") {
[479] Fix | Delete
return cont(expression);
[480] Fix | Delete
} else if (type == ":") {
[481] Fix | Delete
return pass(afterprop)
[482] Fix | Delete
}
[483] Fix | Delete
}
[484] Fix | Delete
function getterSetter(type) {
[485] Fix | Delete
if (type != "variable") return pass(afterprop);
[486] Fix | Delete
cx.marked = "property";
[487] Fix | Delete
return cont(functiondef);
[488] Fix | Delete
}
[489] Fix | Delete
function afterprop(type) {
[490] Fix | Delete
if (type == ":") return cont(expressionNoComma);
[491] Fix | Delete
if (type == "(") return pass(functiondef);
[492] Fix | Delete
}
[493] Fix | Delete
function commasep(what, end) {
[494] Fix | Delete
function proceed(type, value) {
[495] Fix | Delete
if (type == ",") {
[496] Fix | Delete
var lex = cx.state.lexical;
[497] Fix | Delete
if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
[498] Fix | Delete
return cont(function(type, value) {
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function