Linus Groh
11138f5c1f
LibJS: Throw RangeError on BigInt division/modulo by zero
...
https://tc39.es/ecma262/#sec-numeric-types-bigint-divide
https://tc39.es/ecma262/#sec-numeric-types-bigint-remainder
2021-03-16 21:54:51 +01:00
Linus Groh
585123127e
LibJS: Support @@toPrimitive in ToPrimitive abstract operation
...
Fixes #3961 .
2021-03-03 11:04:06 +01:00
Linus Groh
e7ef729db3
LibJS: Use Value::get_method() a bunch
2021-03-02 19:20:29 +01:00
Linus Groh
1b43a6ef2d
LibJS: Implement the GetMethod abstract operation
...
https://tc39.es/ecma262/#sec-getmethod
We have bunch of duplicated on-demand versions of this, let's do it
properly.
2021-03-02 19:20:29 +01:00
Andreas Kling
5d180d1f99
Everywhere: Rename ASSERT => VERIFY
...
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)
Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.
We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Andreas Kling
ee1b58bf41
LibJS: Use all_of() in JS::Value's BigInt validation
2021-02-17 15:22:21 +01:00
Andreas Kling
9efd80f100
LibJS: Use fabs() instead of abs() in JS::Value
...
abs() takes an int, so this would only work correctly for numbers
smaller than INT_MAX.
2021-02-15 13:58:24 +01:00
Andreas Kling
16a0e7a66d
LibJS: Improve correctness of rounding and bitwise operations
...
Patch from Anonymous
2021-02-05 09:38:45 +01:00
Linus Groh
50957ec78e
LibJS: Fix variable name coding style int{Part => _part}
...
...and rename intpart_end to int_part_end for consistency.
2021-02-02 16:52:55 +01:00
Linus Groh
cab3049dcc
LibJS: Rename ErrorType::ToObjectNullOr{Undef => Undefined}
...
This seems like an unnecessary and uncommon abbreviation.
2021-01-14 08:13:32 +01:00
Andreas Kling
13d7c09125
Libraries: Move to Userland/Libraries/
2021-01-12 12:17:46 +01:00