Skip to content

Commit

Permalink
Cast value into String before calling String methods
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 18, 2022
1 parent b6813ca commit e8dae84
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class IdentElement extends Element {
class NumberElement extends Element {
constructor(value, startPos, endPos, line, error = null) {
super('number', value, startPos, endPos, line, error);
value = String(value);
this.isFloat = value.indexOf('.') !== -1;
this.isNegative = value.startsWith('-');
}
Expand Down

0 comments on commit e8dae84

Please sign in to comment.