[FIX] compiler: do not pass dynamic props object as is

The child receiving the props can observe changes made to the passed
t-props object which is not desirable.
This commit is contained in:
Samuel Degueldre
2022-01-27 12:58:04 +01:00
committed by Aaron Bohy
parent bb6479f44f
commit a221411938
4 changed files with 48 additions and 6 deletions
+1 -1
View File
@@ -1104,7 +1104,7 @@ export class CodeGenerator {
let propString = propStr;
if (ast.dynamicProps) {
if (!props.length) {
propString = `${compileExpr(ast.dynamicProps)}`;
propString = `Object.assign({}, ${compileExpr(ast.dynamicProps)})`;
} else {
propString = `Object.assign({}, ${compileExpr(ast.dynamicProps)}, ${propStr})`;
}