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 {result: rolled} = resolve('roll', compiled, creature.variables, context);
|
||||||
let rolledString = toString(rolled);
|
let rolledString = toString(rolled);
|
||||||
if (rolledString !== compiledString) logContent.push({
|
if (rolledString !== compiledString) logContent.push({
|
||||||
value: rolled.toString()
|
value: rolledString
|
||||||
});
|
});
|
||||||
let {result} = resolve('reduce', rolled, creature.variables, context);
|
let {result} = resolve('reduce', rolled, creature.variables, context);
|
||||||
let resultString = toString(result);
|
let resultString = toString(result);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const indexNode = {
|
|||||||
}
|
}
|
||||||
} else if (fn === 'reduce'){
|
} else if (fn === 'reduce'){
|
||||||
if (array.parseType !== 'array'){
|
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);
|
context.error(message);
|
||||||
return {
|
return {
|
||||||
result: error.create({
|
result: error.create({
|
||||||
@@ -41,7 +41,7 @@ const indexNode = {
|
|||||||
context,
|
context,
|
||||||
};
|
};
|
||||||
} else if (!index.isInteger){
|
} 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);
|
context.error(message);
|
||||||
return {
|
return {
|
||||||
result: error.create({
|
result: error.create({
|
||||||
|
|||||||
Reference in New Issue
Block a user