Fixed incorrect use of parser toString in places

This commit is contained in:
Stefan Zermatten
2022-02-23 11:07:02 +02:00
parent 90b277e181
commit 78c67a4fd6
2 changed files with 3 additions and 3 deletions

View File

@@ -186,7 +186,7 @@ const logRoll = new ValidatedMethod({
let {result: rolled} = resolve('roll', compiled, creature.variables, context);
let rolledString = toString(rolled);
if (rolledString !== compiledString) logContent.push({
value: rolled.toString()
value: rolledString
});
let {result} = resolve('reduce', rolled, creature.variables, context);
let resultString = toString(result);

View File

@@ -31,7 +31,7 @@ const indexNode = {
}
} else if (fn === 'reduce'){
if (array.parseType !== 'array'){
const message = `Can not get the index of a non-array node: ${node.array.toString()} = ${array.toString()}`
const message = `Can not get the index of a non-array node: ${toString(node.array)} = ${toString(array)}`
context.error(message);
return {
result: error.create({
@@ -41,7 +41,7 @@ const indexNode = {
context,
};
} else if (!index.isInteger){
const message = `${array.toString()} is not an integer index of the array`
const message = `${toString(array)} is not an integer index of the array`
context.error(message);
return {
result: error.create({