feat(evaluate): emit parse error on invalid JSONPointer#185
Merged
Conversation
BREAKING CHANGE: evalute can now throw either JSONPointerParseError or busclasses of JSONPointerEvaluateError.
There was a problem hiding this comment.
Pull request overview
This PR introduces a breaking change that separates parse-time errors from evaluation-time errors by introducing the JSONPointerParseError type for invalid JSON Pointer syntax. Previously, both parse and evaluation failures threw JSONPointerEvaluateError.
Changes:
- Parse validation now happens before evaluation begins and throws
JSONPointerParseErrorfor syntax errors - Parse error handling moved before
TraceBuilderinstantiation, so trace objects are not populated when parse errors occur - Updated apg-lite dependency from ^1.0.4 to ^1.0.5
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/evaluate/index.js | Moved parse error checking before TraceBuilder instantiation; changed error type from JSONPointerEvaluateError to JSONPointerParseError for parse failures |
| test/evaluate/trace.js | Updated tests to expect JSONPointerParseError for invalid pointers; added comment explaining trace is not populated for parse errors |
| test/evaluate/realms/minim.js | Updated import and test assertion to use JSONPointerParseError |
| test/evaluate/realms/map-set.js | Updated import and test assertion to use JSONPointerParseError |
| test/evaluate/realms/immutable.js | Updated import and test assertion to use JSONPointerParseError |
| test/evaluate/realms/apidom/index.js | Updated import and test assertion to use JSONPointerParseError |
| test/evaluate/realms/apidom/evaluate.js | Updated import and test assertion to use JSONPointerParseError |
| test/evaluate/index.js | Added JSONPointerParseError import and updated test assertion |
| package.json | Updated apg-lite dependency version to ^1.0.5 |
| package-lock.json | Updated apg-lite dependency lockfile entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -73,7 +73,7 @@ | |||
| "SECURITY.md" | |||
There was a problem hiding this comment.
The PR description contains a typo: "busclasses" should be "subclasses". The description should read: "BREAKING CHANGE: evaluate can now throw either JSONPointerParseError or subclasses of JSONPointerEvaluateError."
char0n
pushed a commit
that referenced
this pull request
Jan 23, 2026
# [3.0.0](v2.10.2...v3.0.0) (2026-01-23) ### Features * **evaluate:** divide realms into core and contrib ([#186](#186)) ([3292bc2](3292bc2)), closes [#65](#65) [#33](#33) * **evaluate:** emit parse error on invalid JSONPointer ([#185](#185)) ([2e46b8f](2e46b8f)) ### BREAKING CHANGES * **evaluate:** only json and map-set realms and still part of the package. apidom, minim and immutable are no longer part of npm distributions but live in contrib directory in the GitHub repo. * **evaluate:** evalute can now throw either JSONPointerParseError or busclasses of JSONPointerEvaluateError.
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.
BREAKING CHANGE: evalute can now throw either JSONPointerParseError or busclasses of JSONPointerEvaluateError.