[AIT-1138] Deprecate RTPO8d: PathObject#instance wraps primitives (RTPO8f)#504
Open
sacOO7 wants to merge 1 commit into
Open
[AIT-1138] Deprecate RTPO8d: PathObject#instance wraps primitives (RTPO8f)#504sacOO7 wants to merge 1 commit into
PathObject#instance wraps primitives (RTPO8f)#504sacOO7 wants to merge 1 commit into
Conversation
Previously PathObject#instance returned undefined/null when the path resolved to a primitive (RTPO8d). This is inconsistent with the Instance model itself: RTINS1 defines Instance as a view of "a LiveObject or primitive value", and primitives already surface as Instances via Instance#get (RTINS5c). Replace RTPO8d with RTPO8f: a primitive resolution returns a new Instance wrapping the primitive value. Resolution failure (RTPO8e) still returns undefined/null. Update the corresponding UTS test spec: the RTPO8c primitive-null test becomes RTPO8f/instance-primitive-wrapped-0, asserting the returned Instance has no object id (RTINS3b) and exposes the primitive via Instance#value (RTINS4c).
PathObject#instance wraps primitives (RTPO8f)PathObject#instance wraps primitives (RTPO8f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PathObject#instancepreviously returned undefined/null when the path resolved to a primitive value (RTPO8d). This PR deprecates that clause and replaces it withRTPO8f: a primitive resolution now returns a newInstancewrapping the primitive value. The corresponding UTS test spec is updated to match.Why
The primitive-null behaviour was the odd one out in the
Instancemodel:RTINS1already definesInstanceas "a direct-reference view of aLiveObjector primitive value".Instances throughInstance#get(RTINS5c), so a map entry read via anInstanceproduced a primitiveInstance, while the same entry read viaPathObject#instanceproduced nothing.RTINS3b(primitives have no object id) andRTINS4c(Instance#valuereturns the primitive directly) already specify how a primitive-wrappingInstancebehaves —RTPO8dwas just blocking the one entry point.Making
instance()total over resolved values gives callers a single, uniform way to capture a point-in-time reference to whatever sits at a path.Changes
specifications/objects-features.mdRTPO8d— marked as replaced byRTPO8f, following the existing deprecation convention.RTPO8f(new) — a primitive resolution returns a newInstance(RTINS1) wrapping the primitive value.RTPO8c(LiveObject →Instance) andRTPO8e(resolution failure → undefined/null) are unchanged.uts/objects/unit/path_object.mdobjects/unit/RTPO8c/instance-primitive-null-0becomesobjects/unit/RTPO8f/instance-primitive-wrapped-0: asserts the returnedInstanceexists, has no object id (RTINS3b), and exposes the primitive viavalue()(RTINS4c).SDK adoption
Both SDK implementations and their derived UTS tests have been updated to this behaviour and are pending on their respective branches:
_resolveInstancewraps any resolved value;batch()retains its explicit LiveObject check so the 92007 non-LiveObject error is unaffected.DefaultPathObject.instance()returns the typedInstancefor any resolved value; primitive instances remain anonymous (noidmember) per the typed-SDK contract.Follow-up (separate PR)
The typed-SDK spec section (
RTTS6e/RTTS3b, #491) still states thatinstance()on primitivePathObjectsub-classes returns null or throws 92007 — that premise is removed by this change and will be reconciled in an individual PR against that branch.