1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:57:35 +00:00

LibJS: Implement conversion of strings to BigInts according to the spec

The spec defines a StringToBigInt AO which allows for converting binary,
octal, decimal, and hexadecimal strings to a BigInt. Our conversion was
only allowing for decimal strings.
This commit is contained in:
Timothy Flynn 2022-01-31 10:23:51 -05:00 committed by Linus Groh
parent 94a346c9b9
commit 281b0411f2
3 changed files with 141 additions and 4 deletions

View file

@ -333,6 +333,7 @@ public:
ThrowCompletionOr<FunctionObject*> get_method(GlobalObject&, PropertyKey const&) const;
String to_string_without_side_effects() const;
Optional<BigInt*> string_to_bigint(GlobalObject& global_object) const;
Value value_or(Value fallback) const
{