Javascript: fix errors from upcoming rules_java update#20811
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates Boolean comparisons throughout the JavaScript extractor codebase to use .equals() instead of == operator, addressing errors from an upcoming rules_java update that enforces proper object comparison methods.
- Replaces identity comparisons (
==/!=) with.equals()calls for Boolean object comparisons - Adds
@SuppressWarnings("ReturnValueIgnored")annotations to methods that intentionally ignore return values - Affects AST node constructors and parser logic across multiple files
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| Quantifier.java | Updates greedy flag comparison in regexp quantifier constructor |
| CharacterClass.java | Updates inverted flag comparison in regexp character class constructor |
| UnaryTypeConstructor.java | Updates prefix flag comparison in JSDoc type constructor |
| FunctionType.java | Updates _new flag comparison in JSDoc function type constructor |
| YieldExpression.java | Updates delegating flag comparison in yield expression constructor |
| UpdateExpression.java | Updates prefix flag comparison in update expression constructor |
| UnaryExpression.java | Updates prefix flag comparison in unary expression constructor |
| TemplateElement.java | Updates tail flag comparison in template element constructor |
| Property.java | Updates computed and method flag comparisons in property constructor |
| MemberExpression.java | Updates computed, optional, and onOptionalChain flag comparisons |
| Literal.java | Updates value comparison in isFalsy() method |
| InvokeExpression.java | Updates optional and onOptionalChain flag comparisons |
| ForInStatement.java | Updates each flag comparison in for-in statement constructor |
| ComprehensionExpression.java | Updates generator flag comparison in comprehension expression |
| ComprehensionBlock.java | Updates of flag comparison in comprehension block constructor |
| AFunctionExpression.java | Updates generator and async flag comparisons when creating function info |
| FlowParser.java | Adds suppression annotation for intentionally ignored return value |
| Parser.java | Updates oldStrict comparison and adds suppression annotation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
javascript/extractor/src/com/semmle/js/ast/jsdoc/UnaryTypeConstructor.java
Outdated
Show resolved
Hide resolved
javascript/extractor/src/com/semmle/js/ast/jsdoc/FunctionType.java
Outdated
Show resolved
Hide resolved
javascript/extractor/src/com/semmle/js/ast/UpdateExpression.java
Outdated
Show resolved
Hide resolved
javascript/extractor/src/com/semmle/js/ast/YieldExpression.java
Outdated
Show resolved
Hide resolved
javascript/extractor/src/com/semmle/js/ast/UnaryExpression.java
Outdated
Show resolved
Hide resolved
javascript/extractor/src/com/semmle/js/ast/regexp/Quantifier.java
Outdated
Show resolved
Hide resolved
javascript/extractor/src/com/semmle/js/ast/TemplateElement.java
Outdated
Show resolved
Hide resolved
javascript/extractor/src/com/semmle/js/ast/MemberExpression.java
Outdated
Show resolved
Hide resolved
javascript/extractor/src/com/semmle/js/ast/ComprehensionExpression.java
Outdated
Show resolved
Hide resolved
asgerf
approved these changes
Nov 14, 2025
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.
No description provided.