Generalize verify integers check

Fixes #1416
This commit is contained in:
Daniel Imms
2019-10-07 10:28:51 -07:00
parent e14b1f75fe
commit 724bcc3766
+2 -2
View File
@@ -178,8 +178,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');
}
});
}