check expr in arg array
This commit is contained in:
1 parent
4d666d6592
commit
4ac8a01c62
6 files changed
+77
-28
No files matched your search
+10
-1
@@ -325,8 +325,17 @@ export const checkNodeData = (data: NodeModel | null | undefined) => {
|
||||
|
||||
if (data.args && conf.args) {
|
||||
for (const arg of conf.args) {
|
||||
const value = data.args?.[arg.name] as string | string[] | undefined;
|
||||
if (isExprType(arg.type)) {
|
||||
for (const v of parseExpr(data.args[arg.name] ?? "")) {
|
||||
const vars: string[] = [];
|
||||
if (typeof value === "string") {
|
||||
vars.push(...parseExpr(value));
|
||||
} else if (Array.isArray(value)) {
|
||||
for (const v of value) {
|
||||
vars.push(...parseExpr(v));
|
||||
}
|
||||
}
|
||||
for (const v of vars) {
|
||||
if (v && !usingVars[v]) {
|
||||
error(data, `expr variable '${arg.name}' is not defined`);
|
||||
hasError = true;
|
||||
|
||||
Reference in new issue
Block a user