Incorrect mkNumericExpr implementation
@CaelmBleidd is already working on this.
Since May 22, 2025.
Assessment
This issue has not been assessed yet.
Description
There are several rules for variables transformation into a number. For now, only few of them are supported.
7.1.4 ToNumber ( argument )
1. If argument is a Number, return argument.
**2. If argument is either a Symbol or a BigInt, throw a TypeError exception.**
3. If argument is undefined, return NaN.
4. If argument is either null or false, return +0𝔽.
5. If argument is true, return 1𝔽.
**6. If argument is a String, return StringToNumber(argument).**
7. Assert: argument is an Object.
**8. Let primValue be ToPrimitive(argument, "number").**
**9. Assert: primValue is not an Object.**
**10. Return ToNumber(primValue).**
Now for objects it always returns NaN which is incorrect, for example, for [0] or objects with toString returning a string with a number inside.
- Dominant language
- Kotlin
- Stars
- 33
- Forks
- 27
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 15
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from UnitTestBot/usvm
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
UnitTestBot/usvm#388 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
UnitTestBot/usvm#384 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
UnitTestBot/usvm#382 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
UnitTestBot/usvm#379 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
UnitTestBot/usvm#373 ·
All issues in UnitTestBot/usvm
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
johanhaleby/occurrent#1120 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
2 rename bugs Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ankidroid/Anki-Android#21999 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
openwallet-foundation/multipaz#2028 ·