fix: var safety
This commit is contained in:
parent
a8702b190c
commit
69a2c613c9
|
@ -58,7 +58,12 @@ export function descriptionFromSteps(context, steps) {
|
||||||
let variable;
|
let variable;
|
||||||
for (let i = 0; i < keyStepsCount; ++i) {
|
for (let i = 0; i < keyStepsCount; ++i) {
|
||||||
const {key} = steps[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(
|
const lookupDesc = Context.typeDescription(
|
||||||
description[key].type,
|
description[key].type,
|
||||||
(isInvocation && keyStepsCount - 1 === i) ? undefined : variable,
|
(isInvocation && keyStepsCount - 1 === i) ? undefined : variable,
|
||||||
|
@ -83,7 +88,12 @@ export function stepsOptions(context, steps, type) {
|
||||||
let variable;
|
let variable;
|
||||||
for (let j = 0; j < i; ++j) {
|
for (let j = 0; j < i; ++j) {
|
||||||
const {key} = steps[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);
|
description = Context.typeDescription(description[key].type, variable);
|
||||||
}
|
}
|
||||||
const options = 'any' === type
|
const options = 'any' === type
|
||||||
|
|
Loading…
Reference in New Issue
Block a user