Division and remainder operator#290
Merged
Merged
Conversation
f1e1a50 to
05b3d09
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the TypeScript division (/) and remainder (%) operators across the interpreter, sample code, and tests.
- Introduces
Division.tsandRemainder.tssamples in the TypeScript test resources - Extends
TsBinaryOperator(andTsExprResolver) withDivandRemcases - Enhances
mkNumericExprinExprUtil.ktto handle “fake” JS objects
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| usvm-ts/src/test/resources/samples/operators/Remainder.ts | New TS sample for % operator with various operand types |
| usvm-ts/src/test/resources/samples/operators/Division.ts | New TS sample for / operator with various operand types |
| usvm-ts/src/test/kotlin/org/usvm/util/TsMethodTestRunner.kt | Added solverType = SolverType.YICES to test runner defaults |
| usvm-ts/src/test/kotlin/org/usvm/samples/operators/Remainder.kt | Kotlin tests for %, some cases still disabled |
| usvm-ts/src/test/kotlin/org/usvm/samples/operators/Division.kt | Kotlin tests for / |
| usvm-ts/src/main/kotlin/org/usvm/machine/operator/TsBinaryOperator.kt | Added Div and Rem operator implementations |
| usvm-ts/src/main/kotlin/org/usvm/machine/expr/TsExprResolver.kt | Wire up EtsDivExpr/EtsRemExpr to new operators |
| usvm-ts/src/main/kotlin/org/usvm/machine/expr/ExprUtil.kt | Enhanced mkNumericExpr for fake-object branching |
Comments suppressed due to low confidence (2)
usvm-ts/src/test/resources/samples/operators/Remainder.ts:3
- The variable
resis used without declaration, which creates a global. Please declare it (e.g.const res = a % b;).
res = a % b;
usvm-ts/src/test/resources/samples/operators/Division.ts:3
- The variable
resis undeclared, causing a global leak. Useconst res = a / b;orlet res.
res = a / b;
Lipen
approved these changes
Jun 18, 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.