Skip to content

JavaScript: handle propertyAssignment.modifiers being empty - #8799

Merged
greg-at-moderne merged 1 commit into
mainfrom
greg-js-autoformat-whitespace
Sep 7, 2026
Merged

JavaScript: handle propertyAssignment.modifiers being empty#8799
greg-at-moderne merged 1 commit into
mainfrom
greg-js-autoformat-whitespace

Conversation

@greg-at-moderne

@greg-at-moderne greg-at-moderne commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What's changed?

Adding a null-safety guard for propertyAssignment.modifiers in JavaScript's visitor logic.

What's your motivation?

Otherwise this tends to be observed, for instance in the auto formatter:

java.util.concurrent.CompletionException: io.moderne.jsonrpc.JsonRpcException: {code=-32603, message='Request Visit failed with message: TypeError: Cannot read properties of undefined (reading 'length')
    at mapAsync (/opt/moderne/cli/recipes/npm/bundled/8.91.5/node_modules/@openrewrite/rewrite/src/util.ts:19:29)
    at NormalizeWhitespaceVisitor.visitPropertyAssignment (/opt/moderne/cli/recipes/npm/bundled/8.91.5/node_modules/@openrewrite/rewrite/src/javascript/visitor.ts:554:38)

@greg-at-moderne greg-at-moderne self-assigned this Sep 7, 2026
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Sep 7, 2026
@greg-at-moderne
greg-at-moderne marked this pull request as ready for review September 7, 2026 14:24
@greg-at-moderne
greg-at-moderne merged commit e9dc13d into main Sep 7, 2026
1 check passed
@greg-at-moderne
greg-at-moderne deleted the greg-js-autoformat-whitespace branch September 7, 2026 14:24
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant