Scripts: compound path pathItems.index(n) reads the members

`PathItems.index()` with a number went straight to `items_doc`, which
refuses every compound-path-scoped `PathItems` so that creating paths
there stays unavailable. Its siblings (`[n]`, `getByName`, `length`,
`removeAll`) already dispatch scoped collections to the layer handlers
first, but `index` did not, so `compoundPathItems[0].pathItems.index(0)`
threw "creating paths in a compound path is not available yet". Route a
scoped `index` to `scoped_index` like the other lookups; the guard now
only stops real creation.
This commit is contained in:
dotCooCoo committed 2026-12-02 12:56:24 -08:00
1 parent cd3a0da644
commit 1576aac89f
1 file changed
+3
+3
View File
@@ -477,6 +477,9 @@ fn items_named(h: &super::Host, doc: Doc, name: &str) -> Answer {
}
fn items_index(h: &super::Host, a: &[Data]) -> Answer {
if super::layers::is_scoped(a, "PathItems") {
return super::layers::scoped_index(h, a);
}
match arg(a, 1) {
Data::String(_) => items_by_name(h, a),
Data::Number(n) => {