Skip to content

fix: Convert ECMA patterns in Draft 2019-09 unevaluatedProperties - #998

Merged
DannyvdSluijs merged 1 commit into
jsonrainbow:mainfrom
Roman3349:fix/unevaluated-properties-ecma-pattern
Nov 24, 2026
Merged

DannyvdSluijs merged 1 commit into
jsonrainbow:mainfrom
Roman3349:fix/unevaluated-properties-ecma-pattern

Conversation

@Roman3349

@Roman3349 Roman3349 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

#943 introduced EcmaPatternConverter for pattern, patternProperties and additionalProperties. unevaluatedProperties (#931) was merged with its own createPregMatchPattern(), which only maps \p{digit} and \p{Letter} and compiles the pattern with /u. As a result, \d, \w and similar classes match non-ASCII characters there.

When it decides which properties patternProperties has already evaluated, unevaluatedProperties can therefore disagree with patternProperties itself. With {"patternProperties": {"^\\d+$": …}, "unevaluatedProperties": false}, the property "٣" (an Arabic-Indic digit) is not matched by patternProperties, yet unevaluatedProperties treats it as evaluated, so the instance passes.

This replaces createPregMatchPattern() with EcmaPatternConverter::toPcre(), which also covers both \p{…} aliases, and adds the case to EcmaPatternTest.

@Roman3349 Roman3349 mentioned this pull request Nov 15, 2026
7 of 12 tasks
Signed-off-by: Roman Ondráček <mail@romanondracek.cz>
@DannyvdSluijs
DannyvdSluijs force-pushed the fix/unevaluated-properties-ecma-pattern branch from 47f67f5 to 12fea9b Compare November 24, 2026 20:12
@DannyvdSluijs
DannyvdSluijs merged commit d62e59e into jsonrainbow:main Nov 24, 2026
18 checks passed
github-actions Bot added a commit that referenced this pull request Nov 24, 2026
@Roman3349
Roman3349 deleted the fix/unevaluated-properties-ecma-pattern branch November 25, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants