mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #2451 from Tyriar/1416_fit_infinity
Generalize verify integers check
This commit is contained in:
@@ -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');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user