Commit Graph

4057 Commits

Author SHA1 Message Date
Timothy Flynn
2692db8699 LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errors
Note that as of this commit, there aren't any such throwers, and the
call site in Heap::allocate will drop exceptions on the floor. This
commit only serves to change the declaration of the overrides, make sure
they return an empty value, and to propagate OOM errors frm their base
initialize invocations.
2023-01-29 00:02:45 +00:00
Timothy Flynn
1c1b902a6a LibJS+LibWeb: Move headers around to allow including Value from Cell
The goal here is to allow Cell::initialize to return a ThrowCompletion,
to handle OOM for example. Cell.h will then need to include Completion.h
which must include Value.h. This currently can't happen because Value.h
includes BigInt.h, which in turn includes Cell.h. So we would have an
include cycle.

This removes BigInt.h from Value.h, as it is forward-declarable (it is
only referred to with a reference or pointer). Then the Value overload
for Cell::Visitor::visit is moved to Cell.h, and missing BigInt.h
includes as peppered as needed.
2023-01-29 00:02:45 +00:00
Timothy Flynn
b0a4df76de LibJS: Define Date constants such that translation units don't copy them
Variables that are constexpr must be delcared inline in the global
namespace to prevent copying them.

The static keyword is meaningless on variables in headers in the global
namespace. Declare the static bigint as extern and define it out-of-line
instead.
2023-01-29 00:02:45 +00:00
Linus Groh
e4158d8555 LibJS: Replace some deprecated_string() with utf8_string() in Temporal
The remaining ones are needed for PropertyKey, which is not yet String
compatible.
2023-01-28 22:58:03 +00:00
Linus Groh
b41e7b7e86 LibJS: Replace to_deprecated_string() with to_string() in Temporal
Turns out all of these can already be replaced with no further changes!
2023-01-28 22:54:44 +00:00
Linus Groh
0f4bbfdfb7 LibJS: Add spec comments to FunctionPrototype 2023-01-28 00:41:18 +00:00
Linus Groh
6d6ea1fffe LibJS: Add spec comments to FinalizationRegistryPrototype 2023-01-28 00:41:18 +00:00
Linus Groh
2473940526 LibJS: Add spec comments to FinalizationRegistryConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
39301cce70 LibJS: Add spec comments to DataViewPrototype 2023-01-28 00:41:18 +00:00
Linus Groh
814e7260f3 LibJS: Add spec comments to DataViewConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
0f3899b24a LibJS: Add spec comments to Completion 2023-01-28 00:41:18 +00:00
Linus Groh
e32265c896 LibJS: Add spec comments to BooleanConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
02808948ec LibJS: Add spec comments to BigIntPrototype 2023-01-28 00:41:18 +00:00
Linus Groh
7b139c6982 LibJS: Add spec comments to ArrayConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
eefb73add2 LibJS: Add spec comments to ArrayBufferConstructor 2023-01-28 00:41:18 +00:00
Linus Groh
039cd353f1 LibJS: Implement the thisBooleanValue AO and use it in BooleanPrototype 2023-01-28 00:41:18 +00:00
Timothy Flynn
8dc4e05ecf LibJS: Port Intl.DurationFormat to String 2023-01-28 00:13:59 +00:00
Timothy Flynn
4c8f7d76c4 LibJS: Port Intl.RelativeTimeFormat to String 2023-01-28 00:13:59 +00:00
Timothy Flynn
a824e1ac6a LibJS: Remove last use of DeprecatedString from Intl.MathematicalValue 2023-01-28 00:13:59 +00:00
Timothy Flynn
9e4dbea0ee LibJS: Use String::join and String::trim in Temporal AOs 2023-01-28 00:13:46 +00:00
Linus Groh
6e7459322d AK: Remove StringBuilder::build() in favor of to_deprecated_string()
Having an alias function that only wraps another one is silly, and
keeping the more obvious name should flush out more uses of deprecated
strings.
No behavior change.
2023-01-27 20:38:49 +00:00
Sam Atkins
a39ac5a312 LibJS: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
Sam Atkins
df07c5be3a AK: Remove unused DateTimeLexer class 2023-01-27 20:33:18 +00:00
Timothy Flynn
5e29e04122 LibJS+LibLocale: Propagate errors from find_regional_values_for_locale
This had quite the footprint.
2023-01-27 18:00:17 +00:00
Timothy Flynn
b2097f4059 LibJS+LibLocale: Port Intl.DateTimeFormat to String 2023-01-27 18:00:17 +00:00
Evan Smal
3226ce3d83 LibJS: Remove some usage of DeprecatedString usage from Lexer
This changes the filename member from DeprecatedString to String. Parser
has also been updated to meet the updated Lexer interface.
2023-01-26 20:25:25 +00:00
Evan Smal
cfa6b4d815 LibJS: Remove DeprecatedString usage from Token 2023-01-26 20:25:25 +00:00
Evan Smal
93674e4383 LibJS: Remove DeprecatedString usage from SourceCode
This change also requires updates to some users of the SourceCode
interface since it no longer use DeprecatedString.
2023-01-26 20:25:25 +00:00
Linus Groh
959a891df0 LibJS: Port parse_iso_date_time() to String 2023-01-26 20:20:54 +00:00
Linus Groh
6c8c650a55 LibJS: Port temporal_zoned_date_time_to_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
70e8a9bc8b LibJS: Remove unused is_valid_time_zone_numeric_utc_offset_syntax()
...as well as the underlying function:
parse_time_zone_numeric_utc_offset_syntax()
2023-01-26 20:20:54 +00:00
Linus Groh
bb0362ec3b LibJS: Port builtin_time_zone_get_offset_string_for() to String 2023-01-26 20:20:54 +00:00
Linus Groh
95becb22ef LibJS: Port format_iso_time_zone_offset_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
c2656f4ee7 LibJS: Port format_time_zone_offset_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
5a2dfc52f8 LibJS: Port create_temporal_time_zone() to String 2023-01-26 20:20:54 +00:00
Linus Groh
ae98eddc9f LibJS: Port temporal_year_month_to_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
cfb4b44691 LibJS: Port temporal_time_to_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
b6e13f451f LibJS: Port temporal_date_time_to_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
921ef7273e LibJS: Port temporal_date_to_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
453d3063f5 LibJS: Port pad_iso_year() to String 2023-01-26 20:20:54 +00:00
Linus Groh
2aa4fcc318 LibJS: Port temporal_month_day_to_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
d2c10f6bea LibJS: Port temporal_instant_to_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
28ee331a93 LibJS: Make parse_temporal_instant() take a StringView
The underlying parse_temporal_instant_string() function already does
this as well.
2023-01-26 20:20:54 +00:00
Linus Groh
f669d2e558 LibJS: Port temporal_duration_to_string() to String 2023-01-26 20:20:54 +00:00
Linus Groh
49b5d55b95 LibJS: Make {un,}balance_duration_relative() take a StringView
This is only used for equality checks.
2023-01-26 20:20:54 +00:00
Linus Groh
b09522312c LibJS: Port iso_month_code() to String 2023-01-26 20:20:54 +00:00
Linus Groh
bcca5efd5a LibJS: Port format_calendar_annotation() to String 2023-01-26 20:20:54 +00:00
Linus Groh
269f3c4105 LibJS: Port maybe_format_calendar_annotation() to String 2023-01-26 20:20:54 +00:00
Linus Groh
627291b075 LibJS: Port calendar_month_code() to String 2023-01-26 20:20:54 +00:00
Linus Groh
46cff34baf LibJS: Port get_builtin_calendar() to String 2023-01-26 20:20:54 +00:00