From 724bcc37661c5af1e6f24ab5aeaf847a4d5d2951 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 7 Oct 2019 10:28:51 -0700 Subject: [PATCH] Generalize verify integers check Fixes #1416 --- src/public/Terminal.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/public/Terminal.ts b/src/public/Terminal.ts index b8a70ff7e9..c177343a50 100644 --- a/src/public/Terminal.ts +++ b/src/public/Terminal.ts @@ -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'); } }); }