Skip to content

Commit

Permalink
cc
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Oct 12, 2021
1 parent 5c367f9 commit 147a10c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/core.config.js
Expand Up @@ -371,7 +371,8 @@ function getResolver(resolverCache, scopes, prefixes) {
return cached;
}

const hasFunction = obj => Object.keys(obj).reduce((acc, key) => acc || isFunction(obj[key]), false);
const hasFunction = value => isObject(value)
&& Object.keys(value).reduce((acc, key) => acc || isFunction(value[key]), false);

function needContext(proxy, names) {
const {isScriptable, isIndexable} = _descriptors(proxy);
Expand All @@ -380,7 +381,7 @@ function needContext(proxy, names) {
const scriptable = isScriptable(prop);
const indexable = isIndexable(prop);
const value = (indexable || scriptable) && proxy[prop];
if ((scriptable && (isFunction(value) || (isObject(value) && hasFunction(value))))
if ((scriptable && (isFunction(value) || hasFunction(value)))
|| (indexable && isArray(value))) {
return true;
}
Expand Down

0 comments on commit 147a10c

Please sign in to comment.