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
this.nextToken();
[3500] Fix | Delete
var expr = this.parseAssignmentExpression();
[3501] Fix | Delete
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr));
[3502] Fix | Delete
}
[3503] Fix | Delete
else if (!this.match(':')) {
[3504] Fix | Delete
params.push(keyToken);
[3505] Fix | Delete
shorthand = true;
[3506] Fix | Delete
value = init;
[3507] Fix | Delete
}
[3508] Fix | Delete
else {
[3509] Fix | Delete
this.expect(':');
[3510] Fix | Delete
value = this.parsePatternWithDefault(params, kind);
[3511] Fix | Delete
}
[3512] Fix | Delete
}
[3513] Fix | Delete
else {
[3514] Fix | Delete
computed = this.match('[');
[3515] Fix | Delete
key = this.parseObjectPropertyKey();
[3516] Fix | Delete
this.expect(':');
[3517] Fix | Delete
value = this.parsePatternWithDefault(params, kind);
[3518] Fix | Delete
}
[3519] Fix | Delete
return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand));
[3520] Fix | Delete
};
[3521] Fix | Delete
Parser.prototype.parseObjectPattern = function (params, kind) {
[3522] Fix | Delete
var node = this.createNode();
[3523] Fix | Delete
var properties = [];
[3524] Fix | Delete
this.expect('{');
[3525] Fix | Delete
while (!this.match('}')) {
[3526] Fix | Delete
properties.push(this.parsePropertyPattern(params, kind));
[3527] Fix | Delete
if (!this.match('}')) {
[3528] Fix | Delete
this.expect(',');
[3529] Fix | Delete
}
[3530] Fix | Delete
}
[3531] Fix | Delete
this.expect('}');
[3532] Fix | Delete
return this.finalize(node, new Node.ObjectPattern(properties));
[3533] Fix | Delete
};
[3534] Fix | Delete
Parser.prototype.parsePattern = function (params, kind) {
[3535] Fix | Delete
var pattern;
[3536] Fix | Delete
if (this.match('[')) {
[3537] Fix | Delete
pattern = this.parseArrayPattern(params, kind);
[3538] Fix | Delete
}
[3539] Fix | Delete
else if (this.match('{')) {
[3540] Fix | Delete
pattern = this.parseObjectPattern(params, kind);
[3541] Fix | Delete
}
[3542] Fix | Delete
else {
[3543] Fix | Delete
if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) {
[3544] Fix | Delete
this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding);
[3545] Fix | Delete
}
[3546] Fix | Delete
params.push(this.lookahead);
[3547] Fix | Delete
pattern = this.parseVariableIdentifier(kind);
[3548] Fix | Delete
}
[3549] Fix | Delete
return pattern;
[3550] Fix | Delete
};
[3551] Fix | Delete
Parser.prototype.parsePatternWithDefault = function (params, kind) {
[3552] Fix | Delete
var startToken = this.lookahead;
[3553] Fix | Delete
var pattern = this.parsePattern(params, kind);
[3554] Fix | Delete
if (this.match('=')) {
[3555] Fix | Delete
this.nextToken();
[3556] Fix | Delete
var previousAllowYield = this.context.allowYield;
[3557] Fix | Delete
this.context.allowYield = true;
[3558] Fix | Delete
var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
[3559] Fix | Delete
this.context.allowYield = previousAllowYield;
[3560] Fix | Delete
pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right));
[3561] Fix | Delete
}
[3562] Fix | Delete
return pattern;
[3563] Fix | Delete
};
[3564] Fix | Delete
// https://tc39.github.io/ecma262/#sec-variable-statement
[3565] Fix | Delete
Parser.prototype.parseVariableIdentifier = function (kind) {
[3566] Fix | Delete
var node = this.createNode();
[3567] Fix | Delete
var token = this.nextToken();
[3568] Fix | Delete
if (token.type === 4 /* Keyword */ && token.value === 'yield') {
[3569] Fix | Delete
if (this.context.strict) {
[3570] Fix | Delete
this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
[3571] Fix | Delete
}
[3572] Fix | Delete
else if (!this.context.allowYield) {
[3573] Fix | Delete
this.throwUnexpectedToken(token);
[3574] Fix | Delete
}
[3575] Fix | Delete
}
[3576] Fix | Delete
else if (token.type !== 3 /* Identifier */) {
[3577] Fix | Delete
if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) {
[3578] Fix | Delete
this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
[3579] Fix | Delete
}
[3580] Fix | Delete
else {
[3581] Fix | Delete
if (this.context.strict || token.value !== 'let' || kind !== 'var') {
[3582] Fix | Delete
this.throwUnexpectedToken(token);
[3583] Fix | Delete
}
[3584] Fix | Delete
}
[3585] Fix | Delete
}
[3586] Fix | Delete
else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') {
[3587] Fix | Delete
this.tolerateUnexpectedToken(token);
[3588] Fix | Delete
}
[3589] Fix | Delete
return this.finalize(node, new Node.Identifier(token.value));
[3590] Fix | Delete
};
[3591] Fix | Delete
Parser.prototype.parseVariableDeclaration = function (options) {
[3592] Fix | Delete
var node = this.createNode();
[3593] Fix | Delete
var params = [];
[3594] Fix | Delete
var id = this.parsePattern(params, 'var');
[3595] Fix | Delete
if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
[3596] Fix | Delete
if (this.scanner.isRestrictedWord(id.name)) {
[3597] Fix | Delete
this.tolerateError(messages_1.Messages.StrictVarName);
[3598] Fix | Delete
}
[3599] Fix | Delete
}
[3600] Fix | Delete
var init = null;
[3601] Fix | Delete
if (this.match('=')) {
[3602] Fix | Delete
this.nextToken();
[3603] Fix | Delete
init = this.isolateCoverGrammar(this.parseAssignmentExpression);
[3604] Fix | Delete
}
[3605] Fix | Delete
else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
[3606] Fix | Delete
this.expect('=');
[3607] Fix | Delete
}
[3608] Fix | Delete
return this.finalize(node, new Node.VariableDeclarator(id, init));
[3609] Fix | Delete
};
[3610] Fix | Delete
Parser.prototype.parseVariableDeclarationList = function (options) {
[3611] Fix | Delete
var opt = { inFor: options.inFor };
[3612] Fix | Delete
var list = [];
[3613] Fix | Delete
list.push(this.parseVariableDeclaration(opt));
[3614] Fix | Delete
while (this.match(',')) {
[3615] Fix | Delete
this.nextToken();
[3616] Fix | Delete
list.push(this.parseVariableDeclaration(opt));
[3617] Fix | Delete
}
[3618] Fix | Delete
return list;
[3619] Fix | Delete
};
[3620] Fix | Delete
Parser.prototype.parseVariableStatement = function () {
[3621] Fix | Delete
var node = this.createNode();
[3622] Fix | Delete
this.expectKeyword('var');
[3623] Fix | Delete
var declarations = this.parseVariableDeclarationList({ inFor: false });
[3624] Fix | Delete
this.consumeSemicolon();
[3625] Fix | Delete
return this.finalize(node, new Node.VariableDeclaration(declarations, 'var'));
[3626] Fix | Delete
};
[3627] Fix | Delete
// https://tc39.github.io/ecma262/#sec-empty-statement
[3628] Fix | Delete
Parser.prototype.parseEmptyStatement = function () {
[3629] Fix | Delete
var node = this.createNode();
[3630] Fix | Delete
this.expect(';');
[3631] Fix | Delete
return this.finalize(node, new Node.EmptyStatement());
[3632] Fix | Delete
};
[3633] Fix | Delete
// https://tc39.github.io/ecma262/#sec-expression-statement
[3634] Fix | Delete
Parser.prototype.parseExpressionStatement = function () {
[3635] Fix | Delete
var node = this.createNode();
[3636] Fix | Delete
var expr = this.parseExpression();
[3637] Fix | Delete
this.consumeSemicolon();
[3638] Fix | Delete
return this.finalize(node, new Node.ExpressionStatement(expr));
[3639] Fix | Delete
};
[3640] Fix | Delete
// https://tc39.github.io/ecma262/#sec-if-statement
[3641] Fix | Delete
Parser.prototype.parseIfClause = function () {
[3642] Fix | Delete
if (this.context.strict && this.matchKeyword('function')) {
[3643] Fix | Delete
this.tolerateError(messages_1.Messages.StrictFunction);
[3644] Fix | Delete
}
[3645] Fix | Delete
return this.parseStatement();
[3646] Fix | Delete
};
[3647] Fix | Delete
Parser.prototype.parseIfStatement = function () {
[3648] Fix | Delete
var node = this.createNode();
[3649] Fix | Delete
var consequent;
[3650] Fix | Delete
var alternate = null;
[3651] Fix | Delete
this.expectKeyword('if');
[3652] Fix | Delete
this.expect('(');
[3653] Fix | Delete
var test = this.parseExpression();
[3654] Fix | Delete
if (!this.match(')') && this.config.tolerant) {
[3655] Fix | Delete
this.tolerateUnexpectedToken(this.nextToken());
[3656] Fix | Delete
consequent = this.finalize(this.createNode(), new Node.EmptyStatement());
[3657] Fix | Delete
}
[3658] Fix | Delete
else {
[3659] Fix | Delete
this.expect(')');
[3660] Fix | Delete
consequent = this.parseIfClause();
[3661] Fix | Delete
if (this.matchKeyword('else')) {
[3662] Fix | Delete
this.nextToken();
[3663] Fix | Delete
alternate = this.parseIfClause();
[3664] Fix | Delete
}
[3665] Fix | Delete
}
[3666] Fix | Delete
return this.finalize(node, new Node.IfStatement(test, consequent, alternate));
[3667] Fix | Delete
};
[3668] Fix | Delete
// https://tc39.github.io/ecma262/#sec-do-while-statement
[3669] Fix | Delete
Parser.prototype.parseDoWhileStatement = function () {
[3670] Fix | Delete
var node = this.createNode();
[3671] Fix | Delete
this.expectKeyword('do');
[3672] Fix | Delete
var previousInIteration = this.context.inIteration;
[3673] Fix | Delete
this.context.inIteration = true;
[3674] Fix | Delete
var body = this.parseStatement();
[3675] Fix | Delete
this.context.inIteration = previousInIteration;
[3676] Fix | Delete
this.expectKeyword('while');
[3677] Fix | Delete
this.expect('(');
[3678] Fix | Delete
var test = this.parseExpression();
[3679] Fix | Delete
if (!this.match(')') && this.config.tolerant) {
[3680] Fix | Delete
this.tolerateUnexpectedToken(this.nextToken());
[3681] Fix | Delete
}
[3682] Fix | Delete
else {
[3683] Fix | Delete
this.expect(')');
[3684] Fix | Delete
if (this.match(';')) {
[3685] Fix | Delete
this.nextToken();
[3686] Fix | Delete
}
[3687] Fix | Delete
}
[3688] Fix | Delete
return this.finalize(node, new Node.DoWhileStatement(body, test));
[3689] Fix | Delete
};
[3690] Fix | Delete
// https://tc39.github.io/ecma262/#sec-while-statement
[3691] Fix | Delete
Parser.prototype.parseWhileStatement = function () {
[3692] Fix | Delete
var node = this.createNode();
[3693] Fix | Delete
var body;
[3694] Fix | Delete
this.expectKeyword('while');
[3695] Fix | Delete
this.expect('(');
[3696] Fix | Delete
var test = this.parseExpression();
[3697] Fix | Delete
if (!this.match(')') && this.config.tolerant) {
[3698] Fix | Delete
this.tolerateUnexpectedToken(this.nextToken());
[3699] Fix | Delete
body = this.finalize(this.createNode(), new Node.EmptyStatement());
[3700] Fix | Delete
}
[3701] Fix | Delete
else {
[3702] Fix | Delete
this.expect(')');
[3703] Fix | Delete
var previousInIteration = this.context.inIteration;
[3704] Fix | Delete
this.context.inIteration = true;
[3705] Fix | Delete
body = this.parseStatement();
[3706] Fix | Delete
this.context.inIteration = previousInIteration;
[3707] Fix | Delete
}
[3708] Fix | Delete
return this.finalize(node, new Node.WhileStatement(test, body));
[3709] Fix | Delete
};
[3710] Fix | Delete
// https://tc39.github.io/ecma262/#sec-for-statement
[3711] Fix | Delete
// https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements
[3712] Fix | Delete
Parser.prototype.parseForStatement = function () {
[3713] Fix | Delete
var init = null;
[3714] Fix | Delete
var test = null;
[3715] Fix | Delete
var update = null;
[3716] Fix | Delete
var forIn = true;
[3717] Fix | Delete
var left, right;
[3718] Fix | Delete
var node = this.createNode();
[3719] Fix | Delete
this.expectKeyword('for');
[3720] Fix | Delete
this.expect('(');
[3721] Fix | Delete
if (this.match(';')) {
[3722] Fix | Delete
this.nextToken();
[3723] Fix | Delete
}
[3724] Fix | Delete
else {
[3725] Fix | Delete
if (this.matchKeyword('var')) {
[3726] Fix | Delete
init = this.createNode();
[3727] Fix | Delete
this.nextToken();
[3728] Fix | Delete
var previousAllowIn = this.context.allowIn;
[3729] Fix | Delete
this.context.allowIn = false;
[3730] Fix | Delete
var declarations = this.parseVariableDeclarationList({ inFor: true });
[3731] Fix | Delete
this.context.allowIn = previousAllowIn;
[3732] Fix | Delete
if (declarations.length === 1 && this.matchKeyword('in')) {
[3733] Fix | Delete
var decl = declarations[0];
[3734] Fix | Delete
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
[3735] Fix | Delete
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in');
[3736] Fix | Delete
}
[3737] Fix | Delete
init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
[3738] Fix | Delete
this.nextToken();
[3739] Fix | Delete
left = init;
[3740] Fix | Delete
right = this.parseExpression();
[3741] Fix | Delete
init = null;
[3742] Fix | Delete
}
[3743] Fix | Delete
else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
[3744] Fix | Delete
init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
[3745] Fix | Delete
this.nextToken();
[3746] Fix | Delete
left = init;
[3747] Fix | Delete
right = this.parseAssignmentExpression();
[3748] Fix | Delete
init = null;
[3749] Fix | Delete
forIn = false;
[3750] Fix | Delete
}
[3751] Fix | Delete
else {
[3752] Fix | Delete
init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
[3753] Fix | Delete
this.expect(';');
[3754] Fix | Delete
}
[3755] Fix | Delete
}
[3756] Fix | Delete
else if (this.matchKeyword('const') || this.matchKeyword('let')) {
[3757] Fix | Delete
init = this.createNode();
[3758] Fix | Delete
var kind = this.nextToken().value;
[3759] Fix | Delete
if (!this.context.strict && this.lookahead.value === 'in') {
[3760] Fix | Delete
init = this.finalize(init, new Node.Identifier(kind));
[3761] Fix | Delete
this.nextToken();
[3762] Fix | Delete
left = init;
[3763] Fix | Delete
right = this.parseExpression();
[3764] Fix | Delete
init = null;
[3765] Fix | Delete
}
[3766] Fix | Delete
else {
[3767] Fix | Delete
var previousAllowIn = this.context.allowIn;
[3768] Fix | Delete
this.context.allowIn = false;
[3769] Fix | Delete
var declarations = this.parseBindingList(kind, { inFor: true });
[3770] Fix | Delete
this.context.allowIn = previousAllowIn;
[3771] Fix | Delete
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) {
[3772] Fix | Delete
init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
[3773] Fix | Delete
this.nextToken();
[3774] Fix | Delete
left = init;
[3775] Fix | Delete
right = this.parseExpression();
[3776] Fix | Delete
init = null;
[3777] Fix | Delete
}
[3778] Fix | Delete
else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
[3779] Fix | Delete
init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
[3780] Fix | Delete
this.nextToken();
[3781] Fix | Delete
left = init;
[3782] Fix | Delete
right = this.parseAssignmentExpression();
[3783] Fix | Delete
init = null;
[3784] Fix | Delete
forIn = false;
[3785] Fix | Delete
}
[3786] Fix | Delete
else {
[3787] Fix | Delete
this.consumeSemicolon();
[3788] Fix | Delete
init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
[3789] Fix | Delete
}
[3790] Fix | Delete
}
[3791] Fix | Delete
}
[3792] Fix | Delete
else {
[3793] Fix | Delete
var initStartToken = this.lookahead;
[3794] Fix | Delete
var previousAllowIn = this.context.allowIn;
[3795] Fix | Delete
this.context.allowIn = false;
[3796] Fix | Delete
init = this.inheritCoverGrammar(this.parseAssignmentExpression);
[3797] Fix | Delete
this.context.allowIn = previousAllowIn;
[3798] Fix | Delete
if (this.matchKeyword('in')) {
[3799] Fix | Delete
if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
[3800] Fix | Delete
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
[3801] Fix | Delete
}
[3802] Fix | Delete
this.nextToken();
[3803] Fix | Delete
this.reinterpretExpressionAsPattern(init);
[3804] Fix | Delete
left = init;
[3805] Fix | Delete
right = this.parseExpression();
[3806] Fix | Delete
init = null;
[3807] Fix | Delete
}
[3808] Fix | Delete
else if (this.matchContextualKeyword('of')) {
[3809] Fix | Delete
if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
[3810] Fix | Delete
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
[3811] Fix | Delete
}
[3812] Fix | Delete
this.nextToken();
[3813] Fix | Delete
this.reinterpretExpressionAsPattern(init);
[3814] Fix | Delete
left = init;
[3815] Fix | Delete
right = this.parseAssignmentExpression();
[3816] Fix | Delete
init = null;
[3817] Fix | Delete
forIn = false;
[3818] Fix | Delete
}
[3819] Fix | Delete
else {
[3820] Fix | Delete
if (this.match(',')) {
[3821] Fix | Delete
var initSeq = [init];
[3822] Fix | Delete
while (this.match(',')) {
[3823] Fix | Delete
this.nextToken();
[3824] Fix | Delete
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
[3825] Fix | Delete
}
[3826] Fix | Delete
init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
[3827] Fix | Delete
}
[3828] Fix | Delete
this.expect(';');
[3829] Fix | Delete
}
[3830] Fix | Delete
}
[3831] Fix | Delete
}
[3832] Fix | Delete
if (typeof left === 'undefined') {
[3833] Fix | Delete
if (!this.match(';')) {
[3834] Fix | Delete
test = this.parseExpression();
[3835] Fix | Delete
}
[3836] Fix | Delete
this.expect(';');
[3837] Fix | Delete
if (!this.match(')')) {
[3838] Fix | Delete
update = this.parseExpression();
[3839] Fix | Delete
}
[3840] Fix | Delete
}
[3841] Fix | Delete
var body;
[3842] Fix | Delete
if (!this.match(')') && this.config.tolerant) {
[3843] Fix | Delete
this.tolerateUnexpectedToken(this.nextToken());
[3844] Fix | Delete
body = this.finalize(this.createNode(), new Node.EmptyStatement());
[3845] Fix | Delete
}
[3846] Fix | Delete
else {
[3847] Fix | Delete
this.expect(')');
[3848] Fix | Delete
var previousInIteration = this.context.inIteration;
[3849] Fix | Delete
this.context.inIteration = true;
[3850] Fix | Delete
body = this.isolateCoverGrammar(this.parseStatement);
[3851] Fix | Delete
this.context.inIteration = previousInIteration;
[3852] Fix | Delete
}
[3853] Fix | Delete
return (typeof left === 'undefined') ?
[3854] Fix | Delete
this.finalize(node, new Node.ForStatement(init, test, update, body)) :
[3855] Fix | Delete
forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) :
[3856] Fix | Delete
this.finalize(node, new Node.ForOfStatement(left, right, body));
[3857] Fix | Delete
};
[3858] Fix | Delete
// https://tc39.github.io/ecma262/#sec-continue-statement
[3859] Fix | Delete
Parser.prototype.parseContinueStatement = function () {
[3860] Fix | Delete
var node = this.createNode();
[3861] Fix | Delete
this.expectKeyword('continue');
[3862] Fix | Delete
var label = null;
[3863] Fix | Delete
if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
[3864] Fix | Delete
var id = this.parseVariableIdentifier();
[3865] Fix | Delete
label = id;
[3866] Fix | Delete
var key = '$' + id.name;
[3867] Fix | Delete
if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
[3868] Fix | Delete
this.throwError(messages_1.Messages.UnknownLabel, id.name);
[3869] Fix | Delete
}
[3870] Fix | Delete
}
[3871] Fix | Delete
this.consumeSemicolon();
[3872] Fix | Delete
if (label === null && !this.context.inIteration) {
[3873] Fix | Delete
this.throwError(messages_1.Messages.IllegalContinue);
[3874] Fix | Delete
}
[3875] Fix | Delete
return this.finalize(node, new Node.ContinueStatement(label));
[3876] Fix | Delete
};
[3877] Fix | Delete
// https://tc39.github.io/ecma262/#sec-break-statement
[3878] Fix | Delete
Parser.prototype.parseBreakStatement = function () {
[3879] Fix | Delete
var node = this.createNode();
[3880] Fix | Delete
this.expectKeyword('break');
[3881] Fix | Delete
var label = null;
[3882] Fix | Delete
if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
[3883] Fix | Delete
var id = this.parseVariableIdentifier();
[3884] Fix | Delete
var key = '$' + id.name;
[3885] Fix | Delete
if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
[3886] Fix | Delete
this.throwError(messages_1.Messages.UnknownLabel, id.name);
[3887] Fix | Delete
}
[3888] Fix | Delete
label = id;
[3889] Fix | Delete
}
[3890] Fix | Delete
this.consumeSemicolon();
[3891] Fix | Delete
if (label === null && !this.context.inIteration && !this.context.inSwitch) {
[3892] Fix | Delete
this.throwError(messages_1.Messages.IllegalBreak);
[3893] Fix | Delete
}
[3894] Fix | Delete
return this.finalize(node, new Node.BreakStatement(label));
[3895] Fix | Delete
};
[3896] Fix | Delete
// https://tc39.github.io/ecma262/#sec-return-statement
[3897] Fix | Delete
Parser.prototype.parseReturnStatement = function () {
[3898] Fix | Delete
if (!this.context.inFunctionBody) {
[3899] Fix | Delete
this.tolerateError(messages_1.Messages.IllegalReturn);
[3900] Fix | Delete
}
[3901] Fix | Delete
var node = this.createNode();
[3902] Fix | Delete
this.expectKeyword('return');
[3903] Fix | Delete
var hasArgument = !this.match(';') && !this.match('}') &&
[3904] Fix | Delete
!this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */;
[3905] Fix | Delete
var argument = hasArgument ? this.parseExpression() : null;
[3906] Fix | Delete
this.consumeSemicolon();
[3907] Fix | Delete
return this.finalize(node, new Node.ReturnStatement(argument));
[3908] Fix | Delete
};
[3909] Fix | Delete
// https://tc39.github.io/ecma262/#sec-with-statement
[3910] Fix | Delete
Parser.prototype.parseWithStatement = function () {
[3911] Fix | Delete
if (this.context.strict) {
[3912] Fix | Delete
this.tolerateError(messages_1.Messages.StrictModeWith);
[3913] Fix | Delete
}
[3914] Fix | Delete
var node = this.createNode();
[3915] Fix | Delete
var body;
[3916] Fix | Delete
this.expectKeyword('with');
[3917] Fix | Delete
this.expect('(');
[3918] Fix | Delete
var object = this.parseExpression();
[3919] Fix | Delete
if (!this.match(')') && this.config.tolerant) {
[3920] Fix | Delete
this.tolerateUnexpectedToken(this.nextToken());
[3921] Fix | Delete
body = this.finalize(this.createNode(), new Node.EmptyStatement());
[3922] Fix | Delete
}
[3923] Fix | Delete
else {
[3924] Fix | Delete
this.expect(')');
[3925] Fix | Delete
body = this.parseStatement();
[3926] Fix | Delete
}
[3927] Fix | Delete
return this.finalize(node, new Node.WithStatement(object, body));
[3928] Fix | Delete
};
[3929] Fix | Delete
// https://tc39.github.io/ecma262/#sec-switch-statement
[3930] Fix | Delete
Parser.prototype.parseSwitchCase = function () {
[3931] Fix | Delete
var node = this.createNode();
[3932] Fix | Delete
var test;
[3933] Fix | Delete
if (this.matchKeyword('default')) {
[3934] Fix | Delete
this.nextToken();
[3935] Fix | Delete
test = null;
[3936] Fix | Delete
}
[3937] Fix | Delete
else {
[3938] Fix | Delete
this.expectKeyword('case');
[3939] Fix | Delete
test = this.parseExpression();
[3940] Fix | Delete
}
[3941] Fix | Delete
this.expect(':');
[3942] Fix | Delete
var consequent = [];
[3943] Fix | Delete
while (true) {
[3944] Fix | Delete
if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) {
[3945] Fix | Delete
break;
[3946] Fix | Delete
}
[3947] Fix | Delete
consequent.push(this.parseStatementListItem());
[3948] Fix | Delete
}
[3949] Fix | Delete
return this.finalize(node, new Node.SwitchCase(test, consequent));
[3950] Fix | Delete
};
[3951] Fix | Delete
Parser.prototype.parseSwitchStatement = function () {
[3952] Fix | Delete
var node = this.createNode();
[3953] Fix | Delete
this.expectKeyword('switch');
[3954] Fix | Delete
this.expect('(');
[3955] Fix | Delete
var discriminant = this.parseExpression();
[3956] Fix | Delete
this.expect(')');
[3957] Fix | Delete
var previousInSwitch = this.context.inSwitch;
[3958] Fix | Delete
this.context.inSwitch = true;
[3959] Fix | Delete
var cases = [];
[3960] Fix | Delete
var defaultFound = false;
[3961] Fix | Delete
this.expect('{');
[3962] Fix | Delete
while (true) {
[3963] Fix | Delete
if (this.match('}')) {
[3964] Fix | Delete
break;
[3965] Fix | Delete
}
[3966] Fix | Delete
var clause = this.parseSwitchCase();
[3967] Fix | Delete
if (clause.test === null) {
[3968] Fix | Delete
if (defaultFound) {
[3969] Fix | Delete
this.throwError(messages_1.Messages.MultipleDefaultsInSwitch);
[3970] Fix | Delete
}
[3971] Fix | Delete
defaultFound = true;
[3972] Fix | Delete
}
[3973] Fix | Delete
cases.push(clause);
[3974] Fix | Delete
}
[3975] Fix | Delete
this.expect('}');
[3976] Fix | Delete
this.context.inSwitch = previousInSwitch;
[3977] Fix | Delete
return this.finalize(node, new Node.SwitchStatement(discriminant, cases));
[3978] Fix | Delete
};
[3979] Fix | Delete
// https://tc39.github.io/ecma262/#sec-labelled-statements
[3980] Fix | Delete
Parser.prototype.parseLabelledStatement = function () {
[3981] Fix | Delete
var node = this.createNode();
[3982] Fix | Delete
var expr = this.parseExpression();
[3983] Fix | Delete
var statement;
[3984] Fix | Delete
if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) {
[3985] Fix | Delete
this.nextToken();
[3986] Fix | Delete
var id = expr;
[3987] Fix | Delete
var key = '$' + id.name;
[3988] Fix | Delete
if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
[3989] Fix | Delete
this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name);
[3990] Fix | Delete
}
[3991] Fix | Delete
this.context.labelSet[key] = true;
[3992] Fix | Delete
var body = void 0;
[3993] Fix | Delete
if (this.matchKeyword('class')) {
[3994] Fix | Delete
this.tolerateUnexpectedToken(this.lookahead);
[3995] Fix | Delete
body = this.parseClassDeclaration();
[3996] Fix | Delete
}
[3997] Fix | Delete
else if (this.matchKeyword('function')) {
[3998] Fix | Delete
var token = this.lookahead;
[3999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function