Skip to content

Commit

Permalink
Merge pull request #457 from jvalue/bugfix/Infinity-parsing-error
Browse files Browse the repository at this point in the history
Infinity number parsing fix
  • Loading branch information
georg-schwarz authored Oct 18, 2023
2 parents 4a40a97 + 39a95bc commit 9f685e6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class TextRangeSelectorExecutor extends AbstractBlockExecutor<

context.logger.logDebug(
`Selecting lines from ${lineFrom} to ${
lineTo === Number.POSITIVE_INFINITY || lineTo >= numberOfLines
lineTo === Number.MAX_SAFE_INTEGER || lineTo >= numberOfLines
? 'the end'
: `${lineTo}`
}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class TextRangeSelectorMetaInformation extends BlockMetaInformation {
},
lineTo: {
type: PrimitiveValuetypes.Integer,
defaultValue: Number.POSITIVE_INFINITY,
defaultValue: Number.MAX_SAFE_INTEGER,
validation: greaterThanZeroValidation,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
columnIndexAsCharacters,
} from './util/column-id-util';

export const LAST_INDEX = Number.POSITIVE_INFINITY;
export const LAST_INDEX = Number.MAX_SAFE_INTEGER;

export class CellIndex {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class LengthConstraintMetaInformation extends ConstraintMetaInformation {
},
maxLength: {
type: PrimitiveValuetypes.Integer,
defaultValue: Number.POSITIVE_INFINITY,
defaultValue: Number.MAX_SAFE_INTEGER,
validation: nonNegativeValidation,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export class RangeConstraintMetaInformation extends ConstraintMetaInformation {
{
lowerBound: {
type: PrimitiveValuetypes.Decimal,
defaultValue: Number.NEGATIVE_INFINITY,
defaultValue: Number.MIN_SAFE_INTEGER,
},
lowerBoundInclusive: {
type: PrimitiveValuetypes.Boolean,
defaultValue: true,
},
upperBound: {
type: PrimitiveValuetypes.Decimal,
defaultValue: Number.POSITIVE_INFINITY,
defaultValue: Number.MAX_SAFE_INTEGER,
},
upperBoundInclusive: {
type: PrimitiveValuetypes.Boolean,
Expand Down

0 comments on commit 9f685e6

Please sign in to comment.