Fixed a bug with functions accepting rolled arguments
This commit is contained in:
@@ -20,7 +20,6 @@ export default class CallNode extends ParseNode {
|
|||||||
|
|
||||||
// Resolve the arguments
|
// Resolve the arguments
|
||||||
let resolvedArgs = this.args.map(node => node[fn](scope, context));
|
let resolvedArgs = this.args.map(node => node[fn](scope, context));
|
||||||
|
|
||||||
// Check that the arguments match what is expected
|
// Check that the arguments match what is expected
|
||||||
let checkFailed = this.checkArugments({
|
let checkFailed = this.checkArugments({
|
||||||
fn,
|
fn,
|
||||||
@@ -30,7 +29,7 @@ export default class CallNode extends ParseNode {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (checkFailed){
|
if (checkFailed){
|
||||||
if (fn !== 'reduce'){
|
if (fn === 'reduce'){
|
||||||
return new ErrorNode({
|
return new ErrorNode({
|
||||||
node: this,
|
node: this,
|
||||||
error: `Invalid arguments to ${this.functionName} function`,
|
error: `Invalid arguments to ${this.functionName} function`,
|
||||||
|
|||||||
Reference in New Issue
Block a user