Skip to content

[REF] owl-core: model validation context as a class#1906

Open
ged-odoo wants to merge 1 commit into
masterfrom
master-validation-context-class
Open

[REF] owl-core: model validation context as a class#1906
ged-odoo wants to merge 1 commit into
masterfrom
master-validation-context-class

Conversation

@ged-odoo
Copy link
Copy Markdown
Contributor

Replace the per-descent closure-bag built by createContext with a single ValidationContext class threaded through the whole run: validateKey descends and restores in place (no child-context allocation, path snapshotted only when an issue is recorded) and runIsolated runs a validator against a throwaway issue list for unions.

This drops the issueDepth/parent side-channel; a union now reports the branch that failed below its own level by comparing issue paths against its base path directly. In types.ts, a small validator() helper centralizes the phantom-type casts that were spread across every factory as 'as any'.

Replace the per-descent closure-bag built by createContext with a single
ValidationContext class threaded through the whole run: validateKey descends
and restores in place (no child-context allocation, path snapshotted only when
an issue is recorded) and runIsolated runs a validator against a throwaway
issue list for unions.

This drops the issueDepth/parent side-channel; a union now reports the branch
that failed below its own level by comparing issue paths against its base path
directly. In types.ts, a small validator() helper centralizes the phantom-type
casts that were spread across every factory as 'as any'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant