-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Far and Remotable do unverified local marking rather than WeakMap #2361
Conversation
c5180e3
to
8b9867f
Compare
8b9867f
to
313a927
Compare
Ready for review! @michaelfig Please look at the changes to the wallet test. If they are correct now, were they not correct before? If so, I'm unclear on why it was not working before this PR. |
They were correct before, modulo the fact that the test was using the fakeVatAdmin. That entailed separate import namespaces for the contract and the test, and hence separate getInterface WeakMaps, but without a marshal boundary between the two of them. So, ZCF's
[Assuming you meant "why it was working".] @dtribble and I had figured out how to test contracts with actual marshal layers between them. I think that would have made the test always behave as you expect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I reviewed all the changes, since I had some familiarity with the plan to proceed with them.
Far and Remotable still splice an object into the inheritance chain, but now that object also contains a symbol-named property marking the object as a remotable. Unlike the WeakMap, this is not a reliable brand, so
passStyleOf
must validate it each time.Corrected for a previous misunderstanding of
Object.entries
. I thought it did all enumerable own properties, like...
. Actually it only does string-named enumerable own properties. I avoid it when that restriction is inappropriate.The marshal package no longer exports
mustPassByRemote
ormustPassByPresence
. Instead, clients should usepassStyleOf
.I limited
Remotable
to the current usage pattern: Theprops
must beundefined
. Theremotable
if provided must inherit fromnull
orObject.prototype
. The inheritance restriction propagates toFar
.