Skip to content

Commit

Permalink
fix returns
Browse files Browse the repository at this point in the history
  • Loading branch information
holenyt committed Oct 15, 2024
1 parent 3d16fc0 commit 034546b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions rpgsaga/saga/src/Employee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,18 @@ export class Employee {
return this.ageC;
}
public set age(age: number) {
if (age >= 0) {
this.ageC = age;
return;
if (age < 0) {
throw new Error('Возраст не может быть отрицательным.');

Check failure on line 23 in rpgsaga/saga/src/Employee.ts

View workflow job for this annotation

GitHub Actions / saga-ci

Delete `··`
}
throw new Error('Возраст не может быть отрицательным.');
this.ageC = age;
}
public get salary(): number {
return this.salaryC;
}
public set salary(salary: number) {
if (salary >= 0) {
this.salaryC = salary;
return;
throw new Error('Зарплата не может быть отрицательной.');
}
throw new Error('Заплата не может быть отрицательной.');
this.salaryC = salary;
}
}

0 comments on commit 034546b

Please sign in to comment.