Touch ups around local members (#1633)

* Add assertion if ObjectMember key in cachedValues is not local (should never happen)
* Move test to snippet tests
This commit is contained in:
Daniel Chao authored and GitHub committed 2026-06-02 03:47:46 +00:00
1 parent 18af04c2ec
commit c9f3823952
4 files changed
+92 -45

No files matched your search

@@ -158,8 +158,12 @@ public final class VmDynamic extends VmObject {
}
private boolean isHiddenOrLocalProperty(Object key) {
return key instanceof ObjectMember member && member.isLocal()
|| key instanceof Identifier identifier
&& (key == Identifier.DEFAULT || identifier.isLocalProp());
// only local members have the entire `ObjectMember` stored as a key in cachedValues
if (key instanceof ObjectMember member) {
assert member.isLocal();
return true;
}
return key instanceof Identifier identifier
&& (key == Identifier.DEFAULT || identifier.isLocalProp());
}
}