Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect invalid escape for ecmascript #1049

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

justin-tay
Copy link
Contributor

This fixes the test failure from the JSON Schema Test Suite in optional/ecmascript-regex.json as joni does not detect invalid escapes.

This makes the following changes

  • The regex format has been changed to also follow the configuration of whether to use ecma-262 compliant regex. Previously it always used the jdk regex.
  • The JoniRegularExpression implementation uses a regex to detect if an invalid escape is used as joni doesn't detect invalid escapes. In actuality it's upstream Oniguruma doesn't actually support ecma as a syntax.
  • The latest tests from the JSON Schema Test Suite for optional/ecmascript-regex.json has been updated. In actuality it doesn't change anything but it is clearer that "format": "regex" is used in the test
  • The test harness now enables format assertions when running the optional/ecmascript-regex.json test

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.74%. Comparing base (48ca3c2) to head (e11488a).
Report is 19 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1049      +/-   ##
============================================
- Coverage     78.90%   78.74%   -0.16%     
- Complexity     1965     2033      +68     
============================================
  Files           172      191      +19     
  Lines          6352     6596     +244     
  Branches       1255     1260       +5     
============================================
+ Hits           5012     5194     +182     
- Misses          867      927      +60     
- Partials        473      475       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stevehu stevehu merged commit 11c0df2 into networknt:master Jun 8, 2024
4 checks passed
@justin-tay justin-tay deleted the ecmascript branch June 13, 2024 06:21
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.

3 participants