( prop: string, getValue: (ctx: AnyObject, sub: AnyObject) => unknown, target: ContextCache, receiver: AnyObject )
| 253 | } |
| 254 | |
| 255 | function _resolveScriptable( |
| 256 | prop: string, |
| 257 | getValue: (ctx: AnyObject, sub: AnyObject) => unknown, |
| 258 | target: ContextCache, |
| 259 | receiver: AnyObject |
| 260 | ) { |
| 261 | const {_proxy, _context, _subProxy, _stack} = target; |
| 262 | if (_stack.has(prop)) { |
| 263 | throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop); |
| 264 | } |
| 265 | _stack.add(prop); |
| 266 | let value = getValue(_context, _subProxy || receiver); |
| 267 | _stack.delete(prop); |
| 268 | if (needsSubResolver(prop, value)) { |
| 269 | // When scriptable option returns an object, create a resolver on that. |
| 270 | value = createSubResolver(_proxy._scopes, _proxy, prop, value); |
| 271 | } |
| 272 | return value; |
| 273 | } |
| 274 | |
| 275 | function _resolveArray( |
| 276 | prop: string, |
no test coverage detected