Merge pull request #2451 from Tyriar/1416_fit_infinity

Generalize verify integers check
This commit is contained in:
Daniel Imms
2019-10-07 10:46:07 -07:00
committed by GitHub
+2 -2
View File
@@ -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');
}
});
}