fix: allow plain local reference rebinding in source paint
Verify Tessera GUI / verify (push) Failing after 7m30s
Verify Tessera GUI / verify (push) Failing after 7m30s
This commit is contained in:
@@ -801,6 +801,28 @@ mod tests {
|
||||
const EXAMPLE: &str = include_str!("../examples/hello.endor");
|
||||
const PAGE: &str = include_str!("../examples/page.endor");
|
||||
|
||||
#[test]
|
||||
fn source_paint_can_rebind_old_plain_reference_to_new_result_without_mutating_it() {
|
||||
let source = r##"class ReboundRect: RectBlock {
|
||||
previous: ObjectList
|
||||
function paint(self: ReboundRect, mount: Mount, geometry: Bounds): DisplayList {
|
||||
drawing = self.previous
|
||||
drawing = RectBlock.paint(self, mount, geometry)
|
||||
return drawing
|
||||
}
|
||||
}
|
||||
previous = ObjectList()
|
||||
rect = ReboundRect(80, 40, 0, "#DDEEFF", previous)
|
||||
page = Page()
|
||||
page.render(rect)"##;
|
||||
let (mut session, document) = ReplSession::load(source, "app.main", 75, 1).unwrap();
|
||||
assert_eq!(document.frame.commands.len(), 1);
|
||||
assert_eq!(
|
||||
session.execute("previous.count", "app.main").unwrap().value,
|
||||
"0"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn source_paint_overrides_native_commands_and_reacts_to_heap_field_writes() {
|
||||
let (mut session, initial) = ReplSession::load(
|
||||
|
||||
Reference in New Issue
Block a user