Improve BigInt support (#4118)

This patch adds several small features:
- Support right shift with negative numbers
- Support exponentation operator
- BigInts can be enabled in ES5.1 mode
- Remove dead code from ecma_deref_bigint
- Support longer BigInt literals in the parser
- Fix various BigInt comparison issues
- Do not discard unary plus for BigInt constants

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-08-11 11:25:01 +02:00
committed by GitHub
parent 286e515f9f
commit f761427a3e
13 changed files with 409 additions and 138 deletions
+10
View File
@@ -227,6 +227,16 @@ check_result16(BigInt("0x8fef5fcfffef5fcfffef5fcfffef5fcff") >> BigInt("51"), "1
check_result16(BigInt("0x8fef5fcfffef5fcfffef5fcfffef5fcff") >> BigInt("63"), "11fdebf9fffdebf9ff")
check_result16(BigInt("0x8fef5fcfffef5fcfffef5fcfffef5fcff") >> BigInt("64"), "8fef5fcfffef5fcff")
check_result16(-BigInt("0xff") >> BigInt("8"), "-1")
check_result16(-BigInt("0xff") >> BigInt("1000"), "-1")
check_result16(-BigInt("0xff") >> BigInt("7"), "-2")
check_result16(-BigInt("0xff00000000") >> BigInt("32"), "-ff")
check_result16(-BigInt("0xff80000000") >> BigInt("32"), "-100")
check_result16(-BigInt("0xff00000000000000000000000000000000") >> BigInt("128"), "-ff")
check_result16(-BigInt("0xff80000000000000000000000000000000") >> BigInt("128"), "-100")
check_result16(-BigInt("0xfe00000000000000000000000000000000") >> BigInt("129"), "-7f")
check_result16(-BigInt("0xff00000000000000000000000000000000") >> BigInt("129"), "-80")
check_result16(BigInt("0x8fef5fcfffef5fcfffef5fcfffef5fcff") >> BigInt("10000000000000000000000000"), "0")
try {