Age | Commit message (Collapse) | Author |
|
When the bytecode interpreter was converted to ThrowCompletionOr<Value>
it then also cleared the vm.exception() making it seem like no exception
was thrown.
Also removed the TRY_OR_DISCARD as that would skip the error handling
parts.
|
|
This is a normative change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/664f02d
Note that the tests are not comprehensive.
|
|
|
|
Turns out the only difference between our existing implementation and
the ECMA-402 implementation is we weren't passing the locales and
options list to each element.toLocaleString invocation.
This also adds spec comments to the definition.
|
|
|
|
Caught by ENABLE_ALL_THE_DEBUG_MACROS.
|
|
This isn't a complete conversion to ErrorOr<void>, but a good chunk.
The end goal here is to propagate buffer allocation failures to the
caller, and allow the use of TRY() with formatting functions.
|
|
These will allow us to start using TRY() with StringBuilder operations.
|
|
|
|
Also add slightly richer parse errors now that we can include a string
literal with returned errors.
This will allow us to use TRY() when working with JSON data.
|
|
We have no way of writing changes to memory-mapped files back to disk,
and software relying on this functionality for output would fail
miserably. Let's just return ENOTSUP instead to allow callers to fall
back to standard file IO instead of silently discarding writes.
This makes the LLD port work, which uses memory-mapped files to write
its output by default.
|
|
|
|
The units data is in another CLDR package, cldr-units.
|
|
As noted at the top of this method, this is a naive implementation of
the Unicode plurality specification. But for now, we should tweak the
defintion of "many" to be "more than 2" (which is what I had in mind
when I wrote this, but forgot about fractions).
|
|
Noticed this while implementing multiple identifier support. We were
errantly parsing U+200F as a lone identifier in some Hebrew formats.
|
|
This wasn't the case for compact patterns, but unit patterns can contain
multiple (up to 2, really) identifiers that must each be recognized by
LibJS.
Each generated NumberFormat object now stores an array of identifiers
parsed. The format pattern itself is encoded with the index into this
array for that identifier, e.g. the compact format string "0K" will
become "{number}{compactIdentifier:0}".
|
|
This field is currently used to store the StringView into the compact
name/symbol in the format string. Units will need to store a similar
field, so rename the field to be more generic, and extract the parser
for it.
|
|
Instead of currency pattern lookups within select_currency_unit_pattern,
rename the method to select_pattern_with_plurality and accept any list
of patterns. This method will be needed for units.
|
|
Maintenance to stabilize the font.
- Added glyph FFFD
- Adjusted multiple glyphs for improved consistency
- Added a few glyphs to current ranges
- Added range Mende Kikakui 1E800-1E8DF (incomplete, I continued my work
in Katica)
|
|
These all would return incorrect results for negative time values.
Also adds a missing floor() in sec_from_time().
|
|
Fixes #10803.
|
|
Currently, we get the following results
-1 - -2 = -1
-2 - -1 = 1
Correct would be:
-1 - -2 = 1
-2 - -1 = -1
This was already attempted to be fixed in 7ed8970, but that change was
incorrect. This directly translates to LibJS BigInts having the same
incorrect behavior - it even was tested.
|
|
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/3dd2397
|
|
... and bring it back to try_load_from_file().
Prior to this change, changing the scaling option to x2 in the Display
Settings resulted in the following crash:
WindowServer(15:15): ASSERTION FAILED: bitmap->width() % scale_factor
== 0 ./Userland/Libraries/LibGfx/Bitmap.cpp:126
That was caused by two minor overlooked yaks:
- First, Bitmap::try_load_from_fd_and_close() tried to respect your
scale factor.
While requesting a bitmap from file can make a switcheroo to give you
a higher resolution bitmap, doing the same when you already have an fd
might violate the unveil agreement.
... but, it didn't do that.
It read bitmaps from requested fds, but also pretended all system
bitmaps in /res/ are the HiDPI ones when you enabled that mode.
- d85d741c59 used this function to deduplicate try_load_from_file().
It actually made this bug a lot easier to replicate!
Closes #10920
|
|
Prior this change, the app crashed if the first file in alphabetical
order in /res/wallpapers couldn't be decoded.
|
|
|
|
|
|
|
|
All possible patterns generated by LibUnicode are now handled. We have a
similar VERIFY_NOT_REACHED in PartitionNumberPattern.
|
|
|
|
Finding the best number format to use for compact notation involves
creating a Vector of all compact formats for the locale and looking for
the one that best matches the number's magnitude. ECMA-402 wants this
number format to be found multiple times, so cache the result for future
use.
|
|
The compact scale of each formatting rule was precomputed in commit:
be69eae651abf0cc3e9cd0906f9586fdfbfb68ef
Using the formula: compact scale = magnitude - pattern scale
This computation was off-by-one.
For example, consider the format key "10000-count-one", which maps to
"00 thousand" in en-US. What we are really after is the exponent that
best represents the string "thousand" for values greater than 10000
and less than 100000 (the next format key). We were previously doing:
log10(10000) - "00 thousand".count("0") = 2
Which clearly isn't what we want. Instead, if we do:
log10(10000) + 1 - "00 thousand".count("0") = 3
We get the correct exponent for each format key for each locale.
This commit also renames the generated variable from "compact_scale" to
"exponent" to match the terminology used in ECMA-402.
|
|
For example, in en-US, the decimal, long compact pattern for numbers
between 10,000 and 100,000 is "00 thousand". In that pattern, "thousand"
is the compact identifier, and the generated format pattern is now
"{number} {compactIdentifier}". This also generates that identifier as
its own field in the NumberFormat structure.
|
|
|
|
|
|
|
|
481f7d6afa89d tried to use `modulo()` here, but missed that the
code used `<=` instead of `<`.
Keep using `modulo()` and add an explicit conditional, which is
arguably clearer.
|
|
These widgets attach to a processor parameter and keep the two sides in
sync. They will become very useful for smart processor interfaces.
|
|
No behavior change.
|
|
Add a check to `Parser::consume_eol` to ensure that there is more data
to read before actually consuming any data. Not checking if there is
data left leads to failing an assertion in case of e.g., a truncated
pdf file.
|
|
This feels like it was a refactor transition kind of conversion. The
places that were relying on it can easily be changed to explicitly ask
for the ptr() or a new vaddr() method on Userspace<T*>.
FlatPtr can still implicitly convert to Userspace<T> because the
constructor is not explicit, but there's quite a few more places that
are relying on that conversion.
|
|
Some calls of copy_to_user were converting Userspace<T*> to
Userspace<U*> via the implicit conversion to FlatPtr. Change them to use
the static_ptr_cast overload that is designed to express this conversion
|
|
A series of refactors changed Threads to always have a name, and to
store their name as a KString. Before the refactors a StringBuilder was
used to format the default thread name for a non-main thread, but it is
since unused. Remove it and the AK/String related header includes from
the thread syscall implementation file.
|
|
The processor parameter values are displayed with two decimal places by
default. However, when these values become very large and exceed about 7
text symbols, the text is too long to fit the label and it'll simply not
show up. This commit fixes that by disabling the decimal place for such
large values, which allows us to show values up to 9,999,999, be it
only at integer precision.
|
|
Some nuances in the FLAC loading code can do well with an explanation,
as these non-obvious insights are often the result of long and painful
debugging and nobody should touch the affected code without careful
deliberation.
(Of course, secretly I just want people to maintain my loader code.)
:^)
|
|
This fixes all current code smells, bugs and issues reported by
SonarCloud static analysis. Other issues are almost exclusively false
positives. This makes much code clearer, and some minor benefits in
performance or bug evasion may be gained.
|
|
When the resulting week is in the previous year, we need to check if the
previous year is a leap year and can potentially have 53 weeks, instead
of the given year.
Also added a comment to briefly explain what's going on, as it took me a
while to figure out.
|
|
Since the Beginner difficulty has a 9x9 playing field, it is expected
that a Custom Game should allow to create a field with that size.
|
|
This change makes it easier to generate a new field. Instead of using
hard-coded values everywhere, we now just need to keep track of
the Difficulty enum value.
|
|
This change makes use of checkable actions to specify the current
selected difficulty for the game.
|