diff --git a/src/client/types/typing.js b/src/client/types/typing.js index 7883422..e0432c2 100644 --- a/src/client/types/typing.js +++ b/src/client/types/typing.js @@ -58,7 +58,12 @@ export function descriptionFromSteps(context, steps) { let variable; for (let i = 0; i < keyStepsCount; ++i) { const {key} = steps[i]; - variable = 0 === i ? context.get(key)[0] : variable[key]; + if (0 === i) { + [variable] = context.get(key); + } + else { + variable = 'object' === typeof variable ? variable[key] : undefined; + } const lookupDesc = Context.typeDescription( description[key].type, (isInvocation && keyStepsCount - 1 === i) ? undefined : variable, @@ -83,7 +88,12 @@ export function stepsOptions(context, steps, type) { let variable; for (let j = 0; j < i; ++j) { const {key} = steps[j]; - variable = 0 === j ? context.get(key)[0] : variable[key]; + if (0 === i) { + [variable] = context.get(key); + } + else { + variable = 'object' === typeof variable ? variable[key] : undefined; + } description = Context.typeDescription(description[key].type, variable); } const options = 'any' === type