Skip to content

Conversation

@char0n
Copy link
Member

@char0n char0n commented Jan 23, 2026

BREAKING CHANGE: evalute can now throw either JSONPointerParseError or busclasses of JSONPointerEvaluateError.

BREAKING CHANGE: evalute can now throw either JSONPointerParseError
or busclasses of JSONPointerEvaluateError.
@char0n char0n requested a review from Copilot January 23, 2026 14:32
@char0n char0n self-assigned this Jan 23, 2026
@char0n char0n added the enhancement New feature or request label Jan 23, 2026
@char0n char0n merged commit 2e46b8f into main Jan 23, 2026
8 checks passed
@char0n char0n deleted the char0n/evaluate-parse-error branch January 23, 2026 14:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 JSONPointerParseError for syntax errors
  • Parse error handling moved before TraceBuilder instantiation, 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"
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Copilot uses AI. Check for mistakes.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants