Scripts: visibility variables on embedded images, data sets kept after a no-op import

- variable.setBinding refuses an embedded image only for an image variable,
  so a script can bind an embedded image's visibility.
- A Dataset object stays usable after dataset.import, variable.loadLibrary
  or variable.import leaves the document's data sets as they were, or the
  import is put back; it goes stale only when the data sets change.
- script.check reports a document's exportVariables as filesWritten and
  file.write, and the script host test lists the variable and data set
  names the host adds.

Docs: docs/mcp.md.
This commit is contained in:
dotCooCoo committed 2026-11-21 10:15:47 -08:00
1 parent 90752660ad
commit 6db0f6c1ad
10 files changed
+81 -13

No files matched your search

+1 -1
View File
@@ -500,7 +500,7 @@ fn set_binding(s: &mut Session, p: &Value) -> Result<Value> {
return Err(bad(C, format!("variable `{name}` is a {} variable, and this slot takes a {} variable", have.label(), kind.label())));
}
check_bindable(doc, &[id], kind, C)?;
if matches!(doc.node(id).map(|n| &n.kind), Some(NodeKind::Image(im)) if im.link.is_none()) {
if kind == VariableKind::Image && matches!(doc.node(id).map(|n| &n.kind), Some(NodeKind::Image(im)) if im.link.is_none()) {
return Err(bad(C, format!("node {} is an embedded image, and an image variable drives only a linked image", id.0)));
}
}