Skip to content

Commit

Permalink
Re-added the return to prevent lint error on select case missing break
Browse files Browse the repository at this point in the history
  • Loading branch information
lvcabral committed May 1, 2024
1 parent cfaffc8 commit baff017
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/interpreter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,15 +608,15 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
) {
return left.leftShift(right);
} else if (isBrsNumber(left) && isBrsNumber(right)) {
this.addError(
return this.addError(
new RuntimeError(
RuntimeErrorCode.BadBitShift,
"",
expression.right.location
)
);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "<<" can't be applied to`,
left: {
Expand All @@ -640,15 +640,15 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
) {
return left.rightShift(right);
} else if (isBrsNumber(left) && isBrsNumber(right)) {
this.addError(
return this.addError(
new RuntimeError(
RuntimeErrorCode.BadBitShift,
"",
expression.right.location
)
);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator ">>" can't be applied to`,
left: {
Expand All @@ -667,7 +667,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsNumber(left) && isBrsNumber(right)) {
return left.subtract(right);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "-" can't be applied to`,
left: {
Expand All @@ -686,7 +686,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsNumber(left) && isBrsNumber(right)) {
return left.multiply(right);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "*" can't be applied to`,
left: {
Expand All @@ -704,7 +704,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsNumber(left) && isBrsNumber(right)) {
return left.pow(right);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "^" can't be applied to`,
left: {
Expand All @@ -723,7 +723,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsNumber(left) && isBrsNumber(right)) {
return left.divide(right);
}
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "/" can't be applied to`,
left: {
Expand All @@ -740,7 +740,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsNumber(left) && isBrsNumber(right)) {
return left.modulo(right);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "mod" can't be applied to`,
left: {
Expand All @@ -759,7 +759,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsNumber(left) && isBrsNumber(right)) {
return left.intDivide(right);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "\\" can't be applied to`,
left: {
Expand All @@ -780,7 +780,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
} else if (isStringComp(left) && isStringComp(right)) {
return left.concat(right);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "+" can't be applied to`,
left: {
Expand All @@ -802,7 +802,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return left.greaterThan(right);
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator ">" can't be applied to`,
left: {
Expand All @@ -824,7 +824,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return left.greaterThan(right).or(left.equalTo(right));
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator ">=" can't be applied to`,
left: {
Expand All @@ -846,7 +846,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return left.lessThan(right);
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "<" can't be applied to`,
left: {
Expand All @@ -867,7 +867,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return left.lessThan(right).or(left.equalTo(right));
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "<=" can't be applied to`,
left: {
Expand All @@ -885,7 +885,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return left.equalTo(right);
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "=" can't be applied to`,
left: {
Expand All @@ -903,7 +903,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return left.equalTo(right).not();
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "<>" can't be applied to`,
left: {
Expand All @@ -926,7 +926,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return (left as BrsBoolean).and(right);
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "and" can't be applied to`,
left: {
Expand All @@ -946,7 +946,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return left.and(right);
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "and" can't be applied to`,
left: {
Expand All @@ -960,7 +960,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
})
);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "and" can't be applied to`,
left: {
Expand All @@ -983,7 +983,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsBoolean(right) || isBrsNumber(right)) {
return (left as BrsBoolean).or(right);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "or" can't be applied to`,
left: {
Expand All @@ -1003,7 +1003,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
return left.or(right);
}

this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "or" can't be applied to`,
left: {
Expand All @@ -1017,7 +1017,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
})
);
} else {
this.addError(
return this.addError(
new TypeMismatch({
message: `Operator "or" can't be applied to`,
left: {
Expand Down Expand Up @@ -1668,7 +1668,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsNumber(right)) {
return right.multiply(new Int32(-1));
} else {
this.addError(
return this.addError(
new BrsError(
`Attempting to negate non-numeric value.
value type: ${ValueKind.toString(right.kind)}`,
Expand All @@ -1680,7 +1680,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsNumber(right)) {
return right;
} else {
this.addError(
return this.addError(
new BrsError(
`Attempting to apply unary positive operator to non-numeric value.
value type: ${ValueKind.toString(right.kind)}`,
Expand All @@ -1692,7 +1692,7 @@ export class Interpreter implements Expr.Visitor<BrsType>, Stmt.Visitor<BrsType>
if (isBrsBoolean(right) || isBrsNumber(right)) {
return right.not();
} else {
this.addError(
return this.addError(
new BrsError(
`Type Mismatch. Operator "not" can't be applied to "${ValueKind.toString(
right.kind
Expand Down

0 comments on commit baff017

Please sign in to comment.