From e8dae849ab84edf4acfcb7428b91eea277c706fd Mon Sep 17 00:00:00 2001 From: Guillaume Gomez <guillaume1.gomez@gmail.com> Date: Sat, 19 Nov 2022 00:24:22 +0100 Subject: [PATCH] Cast `value` into String before calling String methods --- src/parser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/parser.js b/src/parser.js index 6c872365..ec1d0313 100644 --- a/src/parser.js +++ b/src/parser.js @@ -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('-'); }