fix(compiler): diagnose inline object component props

This commit is contained in:
2026-08-09 12:58:02 +05:30
parent 64bb0e366a
commit de8d792e37
2 changed files with 20 additions and 0 deletions
+7
View File
@@ -742,6 +742,13 @@ function renderNestedComponentInvocation(
return ` ${attr.name}`;
}
if (/^\s*\{\{[\s\S]*\}\}\s*$/.test(attr.value)) {
throw new Error(
`WRN-PROP-INLINE-OBJECT: '${attr.name}' uses an inline object or array prop. ` +
`Hoist it to state and pass ${attr.name}={yourState} instead.`,
);
}
const wholeExpression = wholeAttributeExpression(attr.value);
const compiledValue = wholeExpression