Skip to content

Commit 0eeecc3

Browse files
Merge pull request #407 from GuillaumeGomez/fix-error
Cast `value` into String before calling String methods
2 parents f2fea75 + e8dae84 commit 0eeecc3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/parser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ class IdentElement extends Element {
260260
class NumberElement extends Element {
261261
constructor(value, startPos, endPos, line, error = null) {
262262
super('number', value, startPos, endPos, line, error);
263+
value = String(value);
263264
this.isFloat = value.indexOf('.') !== -1;
264265
this.isNegative = value.startsWith('-');
265266
}

0 commit comments

Comments
 (0)