* @param {object[]} scopes * @param {string[]} names * @param {function|object} context * @param {string[]} [prefixes] * @return {object}
(scopes, names, context, prefixes = [''])
| 349 | * @return {object} |
| 350 | */ |
| 351 | resolveNamedOptions(scopes, names, context, prefixes = ['']) { |
| 352 | const result = {$shared: true}; |
| 353 | const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes); |
| 354 | let options = resolver; |
| 355 | if (needContext(resolver, names)) { |
| 356 | result.$shared = false; |
| 357 | context = isFunction(context) ? context() : context; |
| 358 | // subResolver is passed to scriptable options. It should not resolve to hover options. |
| 359 | const subResolver = this.createResolver(scopes, context, subPrefixes); |
| 360 | options = _attachContext(resolver, context, subResolver); |
| 361 | } |
| 362 | |
| 363 | for (const prop of names) { |
| 364 | result[prop] = options[prop]; |
| 365 | } |
| 366 | return result; |
| 367 | } |
| 368 | |
| 369 | /** |
| 370 | * @param {object[]} scopes |
no test coverage detected