diff --git a/src/functions.js b/src/functions.js index 219a3904..d493c946 100644 --- a/src/functions.js +++ b/src/functions.js @@ -1658,7 +1658,7 @@ const functions = (() => { }); }); result = keys(merge); - } else if (arg !== null && typeof arg === 'object' && !(isLambda(arg))) { + } else if (arg !== null && typeof arg === 'object' && !isFunction(arg)) { Object.keys(arg).forEach(key => result.push(key)); } return result; @@ -1685,7 +1685,7 @@ const functions = (() => { } } } - } else if (input !== null && typeof input === 'object') { + } else if (input !== null && typeof input === 'object' && !isFunction(input)) { result = input[key]; } return result; diff --git a/test/test-suite/groups/lambdas/case013.json b/test/test-suite/groups/lambdas/case013.json new file mode 100644 index 00000000..01ef8677 --- /dev/null +++ b/test/test-suite/groups/lambdas/case013.json @@ -0,0 +1,6 @@ +{ + "expr": "( $f := function(){1}; $f.environment )", + "dataset": null, + "bindings": {}, + "undefinedResult": true +} \ No newline at end of file