Fixed incorrect use of parser toString in places
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user