Skip to content

Commit

Permalink
Merge pull request #2451 from Tyriar/1416_fit_infinity
Browse files Browse the repository at this point in the history
Generalize verify integers check
  • Loading branch information
Tyriar committed Oct 7, 2019
2 parents 4fde8db + 724bcc3 commit cad9477
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/public/Terminal.ts
Expand Up @@ -181,8 +181,8 @@ export class Terminal implements ITerminalApi {

private _verifyIntegers(...values: number[]): void {
values.forEach(value => {
if (value % 1 !== 0) {
throw new Error('This API does not accept floating point numbers');
if (value === Infinity || value === NaN || value % 1 !== 0) {
throw new Error('This API only accepts integers');
}
});
}
Expand Down

0 comments on commit cad9477

Please sign in to comment.