When we look up a property in the shape tree, we return the property's Shape. This has a number of problems:
- It makes it hard to change the shape representation (bug 1704430).
- It returns too much information (only a few Shape fields are relevant and valid for property shapes) and it's easy for the caller to confuse the two shapes (object's shape and the property shape).
If we change shape property lookups to return a small struct (initially this could just be a wrapper around the property's shape), we can start decoupling properties and shapes.
Similarly, in a few places we walk over all properties in the shape lineage. We could probably add an iterator class to use instead.