1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibJS/Bytecode: Perform ToNumeric on accumulator before postfix inc/dec

This ensures we get the expected behavior of code like:

    let a = []
    let b = a++

(Where b should be 0, not [], because JavaScript.)
This commit is contained in:
Andreas Kling 2023-06-16 10:51:40 +02:00
parent c9bd324369
commit d364d99cb8
4 changed files with 26 additions and 0 deletions

View file

@ -88,6 +88,7 @@
O(SuperCall) \
O(Throw) \
O(ThrowIfNotObject) \
O(ToNumeric) \
O(Typeof) \
O(TypeofVariable) \
O(UnaryMinus) \