Skip to content

fix: preserve pattern property helper scope - #46

Merged
mertcanaltin merged 1 commit into
ata-core:masterfrom
jdalton:fix/pattern-properties-helper-scope
Sep 17, 2026
Merged

mertcanaltin merged 1 commit into
ata-core:masterfrom
jdalton:fix/pattern-properties-helper-scope

Conversation

@jdalton

@jdalton jdalton commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Nested patternProperties validators can reference regex or format helpers from their child schemas. The runtime compiler constructed those children with new Function, which discarded the helper scope and caused a ReferenceError.

The fix - child checks execute inside the parent validator

The generated child checks now remain inside the parent validator. They can use the same regex, set, and format helper bindings as other generated checks.

This behavior also applies to an additionalProperties schema when the compiler combines it with patternProperties.

Validation - runtime and schema suites pass

The regression test covers helper bindings in both generated child paths.

Ran npm test. The complete test command passed.

Ran npm run test:suite. All 3,365 official cases passed.

Ran npm run release:check. All release checks passed.

@mertcanaltin
mertcanaltin merged commit 1cf6920 into ata-core:master Sep 17, 2026
9 checks passed
@mertcanaltin

Copy link
Copy Markdown
Member

Thank you for contributing. Ships in the next release ❤️

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.

2 participants