From 80460ceaed79dd245f491e48e7d5a2bd2db17008 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Tue, 22 Feb 2022 18:02:57 +0200 Subject: [PATCH] Fixed `not found` calculation warnings showing [object Object] They were using the wrong "toString" method --- app/imports/parser/parseTree/accessor.js | 3 ++- app/imports/parser/parseTree/symbol.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/imports/parser/parseTree/accessor.js b/app/imports/parser/parseTree/accessor.js index 855f9044..64ef1ba9 100644 --- a/app/imports/parser/parseTree/accessor.js +++ b/app/imports/parser/parseTree/accessor.js @@ -1,4 +1,5 @@ import constant from './constant.js'; +import { toString } from '../resolve.js'; const accessor = { create({name, path}) { @@ -53,7 +54,7 @@ const accessor = { reduce(node, scope, context){ let { result } = accessor.compile(node, scope, context); if (result.parseType === 'accessor'){ - context.error(`${accessor.toString(result)} not found, set to 0`); + context.error(`${toString(result)} not found, set to 0`); return { result: constant.create({ value: 0, diff --git a/app/imports/parser/parseTree/symbol.js b/app/imports/parser/parseTree/symbol.js index 208baa66..16ec486b 100644 --- a/app/imports/parser/parseTree/symbol.js +++ b/app/imports/parser/parseTree/symbol.js @@ -1,4 +1,4 @@ -import resolve from '../resolve.js'; +import resolve, { toString } from '../resolve.js'; import constant from './constant.js'; const symbol = { @@ -46,7 +46,7 @@ const symbol = { if (result.parseType === 'symbol'){ context.error({ type: 'info', - message: `${result.toString()} not found, set to 0` + message: `${toString(result)} not found, set to 0` }); return { result: constant.create({value: 0}),