Fix hot reloading spreads (#2750)
This commit is contained in:
1 parent
1b0d089d19
commit
74e51b7e0d
2 files changed
+24
-2
No files matched your search
@@ -76,7 +76,7 @@ impl Parse for Element {
|
|||||||
// Assemble the new element from the contents of the block
|
// Assemble the new element from the contents of the block
|
||||||
let mut element = Element {
|
let mut element = Element {
|
||||||
brace,
|
brace,
|
||||||
name,
|
name: name.clone(),
|
||||||
raw_attributes: block.attributes,
|
raw_attributes: block.attributes,
|
||||||
children: block.children,
|
children: block.children,
|
||||||
diagnostics: block.diagnostics,
|
diagnostics: block.diagnostics,
|
||||||
@@ -98,7 +98,7 @@ impl Parse for Element {
|
|||||||
value: AttributeValue::AttrExpr(PartialExpr::from_expr(&spread.expr)),
|
value: AttributeValue::AttrExpr(PartialExpr::from_expr(&spread.expr)),
|
||||||
comma: spread.comma,
|
comma: spread.comma,
|
||||||
dyn_idx: spread.dyn_idx.clone(),
|
dyn_idx: spread.dyn_idx.clone(),
|
||||||
el_name: None,
|
el_name: Some(name.clone()),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1125,3 +1125,25 @@ fn valid_fill_empty() {
|
|||||||
|
|
||||||
assert!(valid);
|
assert!(valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We should be able to hot reload spreads
|
||||||
|
#[test]
|
||||||
|
fn valid_spread() {
|
||||||
|
let valid = can_hotreload(
|
||||||
|
quote! {
|
||||||
|
div {
|
||||||
|
..spread
|
||||||
|
}
|
||||||
|
},
|
||||||
|
quote! {
|
||||||
|
div {
|
||||||
|
"hello world"
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
..spread
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
assert!(valid);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user