Fixed a bug with functions accepting rolled arguments

This commit is contained in:
Stefan Zermatten
2021-04-22 15:59:12 +02:00
parent 9f3c8bef34
commit 1f633621b7

View File

@@ -20,7 +20,6 @@ export default class CallNode extends ParseNode {
// Resolve the arguments
let resolvedArgs = this.args.map(node => node[fn](scope, context));
// Check that the arguments match what is expected
let checkFailed = this.checkArugments({
fn,
@@ -30,7 +29,7 @@ export default class CallNode extends ParseNode {
});
if (checkFailed){
if (fn !== 'reduce'){
if (fn === 'reduce'){
return new ErrorNode({
node: this,
error: `Invalid arguments to ${this.functionName} function`,