Skip to content

Commit

Permalink
Merge pull request #407 from GuillaumeGomez/fix-error
Browse files Browse the repository at this point in the history
Cast `value` into String before calling String methods
  • Loading branch information
GuillaumeGomez authored Nov 18, 2022
2 parents f2fea75 + e8dae84 commit 0eeecc3
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 0eeecc3

Please sign in to comment.