Page MenuHomePhabricator

Consider Making Dot Notation into a Smart Accessor for ZWrapper
Open, MediumPublic

Description

Description

In order to ensure that a given member in a ZWrapper is available, it is necessary to call resolve (or resolveKey or resolveKeyEphemeral if the result of resolution is to be persisted). It isn't always obvious which members of a ZObject have already been resolved.

It would be cleaner if the dot notation on ZWrappers were defined as a smart getter: it would attempt to resolve the requested element ephemerally if not already resolved, then return the result of that resolution.

The block beginning if ( evaluator.allowCustomDerializers ) in src/implementation.js is a good place to see where this functionality might be useful: instead of explicitly calling resolveKey everywhere, we could simply use the dot notation directly, and resolveKey would automatically be called on any object that has not yet been resolved.

Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)

  • ...

Remove all the non-applicable tags from the "Tags" field, leave only the tags of the projects/repositories related to this task


Completion checklist