Commit graph

29095 commits

Author SHA1 Message Date
Daniel Bertalan
018c4e0e7e AK+Kernel: Format DistinctNumeric using the underlying type's formatter
Forcing the formatting to go through `Formatter<FormatString>` is
completely unnecessary, increases code size, performs a String
allocation and prevents us from using the formatting options available
on that type.

This commit also removes explicit formatters from
`BlockBasedFileSystem::BlockIndex` and `Kernel::InodeIndex`, as those
are already covered by the blanket implementation for all
`DistinctNumeric` types.
2021-10-21 22:19:50 +02:00
Ben Wiederhake
9bf6d51aec LibGUI: Make links only clickable where the text is 2021-10-21 20:23:04 +01:00
Nico Weber
ef1d247d79 Documentation: Tweak RunningOnRaspberryPi a bit 2021-10-21 20:01:34 +01:00
Timothy Flynn
1e1cd07549 CI: Add a cache for the CLDR on the test262 runner 2021-10-21 17:41:13 +01:00
Timothy Flynn
cff39734f1 CI: Use correct CLDR cache path on GitHub Actions 2021-10-21 17:41:13 +01:00
xSlendiX
bf80dea39c LoginServer: Capitalize username and password fields
This commit changes the TextBox's placeholders for the username and
password fields to be capitalized.
2021-10-21 16:08:13 +01:00
Andreas Kling
d621534511 LibGUI: Move GUI::FocusPolicy to its own header & add explainer comment 2021-10-21 16:48:24 +02:00
Andreas Kling
c1ba9c66b5 LibWeb: Use is_single_line() and add spec comments to FFC step 8 2021-10-21 16:48:24 +02:00
Andreas Kling
e2dbaa6ceb LibWeb: Include flex-direction in layout tree dumps 2021-10-21 16:48:24 +02:00
Ben Wiederhake
3371a27018 adjtime: Drop unnecessary privileges unconditionally
Furthermore, this simplifies the control flow.
2021-10-21 15:41:22 +01:00
Timothy Flynn
4e4db65e26 LibJS: Remove now-redundant TemporaryClearException from Promise methods
IteratorClose now handles exceptions itself before invoking VM::call(),
so outside callers doubling that work isn't helpful.
2021-10-21 14:57:43 +01:00
Jelle Raaijmakers
28e0aa59a8 Ports: Register all dependencies of ports
Previously, only `manual` installs would register dependencies of an
installed port package. Since in the future we might want to check all
dependents, not only those for manually installed packages, we should
take care to register dependencies for `auto` installs as well.

Additionally, this surpresses some unnecessary verbose output from the
package management and fixes warnings when the package DB directory did
not yet exist.
2021-10-21 14:48:21 +01:00
Jelle Raaijmakers
7ff99cb516 Ports: Return early in parse_arguments() in .port_include.sh 2021-10-21 14:48:21 +01:00
Timothy Flynn
f8e46ec296 LibJS: Convert all four PerformPromise* AOs to ThrowCompletionOr 2021-10-21 14:46:14 +01:00
Timothy Flynn
4fb948d8e7 LibJS: Convert IfAbruptRejectPromise AO to a GNU statement expression
GNU statement expressions fit the definition of IfAbruptRejectPromise
rather nicely, where we need to reject the failed promise (and return
the failed promise itself) on failure, and otherwise store a value on
success.
2021-10-21 14:46:14 +01:00
Timothy Flynn
9064491a47 LibJS: Convert GetPromiseResolve AO to ThrowCompletionOr
This is a bit ugly because, rather than simply wrapping the invocation
to GetPromiseResolve with TRY(), we have to invoke the promise's reject
method with any error. But this will be a bit cleaner in a subsequent
commit to change how IfAbruptRejectPromise is invoked.
2021-10-21 14:46:14 +01:00
Timothy Flynn
6d6cd87b7b LoginServer: Mark the login window as non-closeable and non-minimizable
Previously, you could close the window and be permanently logged out.
2021-10-21 14:45:30 +01:00
Timothy Flynn
176155c695 LibGUI+WindowServer: Add option to hide a widow's close button
This allows windows to be closed only programatically, and not from e.g.
the user clicking the X button on the window frame.
2021-10-21 14:45:30 +01:00
Timothy Flynn
8a57885494 Meta: Enable ccache for Lagom by default 2021-10-21 04:35:10 -07:00
Linus Groh
5832de62fe LibJS: Convert NativeFunction::{call,construct}() to ThrowCompletionOr
Both at the same time because many of them call construct() in call()
and I'm not keen on adding a bunch of temporary plumbing to turn
exceptions into throw completions.
Also changes the return value of construct() to Object* instead of Value
as it always needs to return an object; allowing an arbitrary Value is a
massive foot gun.
2021-10-21 09:02:23 +01:00
Linus Groh
0881f8160f LibJS: Use implicit ThrowCompletionOr<T> constructor where possible
Luckily this is not very widespread yet as most of it would happen in
the various JS functions instead of AOs.
2021-10-21 09:02:23 +01:00
Linus Groh
894834b5d5 LibJS: Allow construction of ThrowCompletionOr<Value> from non-Value
TL;DR: Instead of this:

    return { TRY(my_object()) };

we can now do:

    return TRY(my_object());

just like we mostly did for Value return types before ThrowCompletionOr.
2021-10-21 09:02:23 +01:00
Linus Groh
805f8496be AK: Add IsPOD<T> template to StdLibExtras 2021-10-21 09:02:23 +01:00
Timothy Flynn
03b251a704 LibJS: Convert IterableToList AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00
Timothy Flynn
ec54a7b5b0 LibJS: Implement IteratorClose with Completions and align to the spec 2021-10-21 00:26:45 +01:00
Timothy Flynn
04b4307b3d LibJS: Convert get_iterator_values helper to ThrowCompletionOr
This one is a bit unusual, so to clarify:

Previously, callers of get_iterator_values() would supply a callback
that would return an IterationDecision, and an enum to indicate whether
iterator_close() should be invoked upon IterationDecision::Break.

Now, use of both those enums is removed, and callers must return an
Optional<Completion>. If a Completion is provided, the iterator will be
closed, and that completion will be returned from get_iterator_values.
Otherwise, once the iterator is exhausted, a default-initialized
Completion will be returned.
2021-10-21 00:26:45 +01:00
Timothy Flynn
7b4814f74c LibJS: Convert IteratorValue AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00
Timothy Flynn
a64752cd34 LibJS: Convert IteratorComplete AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00
Timothy Flynn
8be1caa05d LibJS: Convert IteratorStep AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00
Timothy Flynn
c981d7b9bd LibJS: Convert IteratorNext AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00
Timothy Flynn
f4c8f2102f LibJS: Retrieve GetIterator's optional 'method' function using GetMethod
This is in alignment with the spec.
2021-10-21 00:26:45 +01:00
Timothy Flynn
860a37640b LibJS: Convert GetIterator AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00
Valtteri Koskivuori
a3b3800cd4 Userland: Teach the file utility more about ELF files
It now shows some useful at-a-glance information about ELF files, like
it does on other *nix systems.
2021-10-21 01:14:09 +02:00
Valtteri Koskivuori
efbcfe0498 LibELF: Rename the x86_64 machine type string to be less verbose
It looked a bit unsightly in the `readelf` output, this is much neater
while still remaining very unambiguous.
2021-10-21 01:14:09 +02:00
Valtteri Koskivuori
d1adf5bc5e LibELF+Userland: Move a few functions to Elf::Image
These were originally in `readelf`, but they became useful in
`file` as well, so they are now available in Elf::Image with a slightly
revised API.
2021-10-21 01:14:09 +02:00
Karol Kosek
097902bd06 LibGUI: Convert ItemListModel's Display Role to string during search
Previously, you could get crashes when you tried to search for a font
size in the Font Picker or a screen resolution in Display Settings.

This is because their list models aren't made of strings
and Variant::as_string() only accepts strings.
2021-10-21 01:10:36 +02:00
Ben Wiederhake
c55527944c LibWeb: Convert const pointer to nonnull into a reference 2021-10-21 01:08:14 +02:00
Karol Kosek
a36d13e36c LoginServer: Mark this component as REQUIRED
Prior to this change, there was no requirement to build this server.

If you build serenity without -DBUILD_EVERYTHING flag, or just play
around with your build configuration[1], it left you with a blank
screen and this debug line:

  SystemServer(6:6): LoginServer: binary "/bin/LoginServer" does not
  exist, skipping service.

[1]: Documentation/AdvancedBuildInstructions.md#component-configuration
2021-10-21 00:25:21 +02:00
davidot
2d48529073 LibJS: Implement private identifiers in optional chains 2021-10-20 23:19:17 +01:00
davidot
4c8090a45d LibJS: Use ClassFieldInitializerStatement for class fields
This is necessary as we might have to perform named evaluation with the
field name.
Ideally we would also skip some setup parts of the function like
function_declaration_instantiation however this would require bigger
changes to ECMAScriptFunctionObject.
2021-10-20 23:19:17 +01:00
davidot
7e8724db71 LibJS: Add support for the '#privateName in obj' expression 2021-10-20 23:19:17 +01:00
davidot
16cc82460f LibJS: Add parsing and evaluation of private fields and methods 2021-10-20 23:19:17 +01:00
davidot
c7a6572789 LibJS: Add private references 2021-10-20 23:19:17 +01:00
davidot
d94b5e511f LibJS: Add slot [[PrivateElements]] and related methods to Object 2021-10-20 23:19:17 +01:00
davidot
13ead80ee6 LibJS: Add PrivateEnvironment 2021-10-20 23:19:17 +01:00
davidot
eeb42c21d1 LibJS: Lex private identifiers, identifiers prefixed with a '#' 2021-10-20 23:19:17 +01:00
davidot
6b2accce31 LibJS: Add static initializers to classes 2021-10-20 23:19:17 +01:00
davidot
1245512c50 LibJS: Make class definition evaluation more spec like in ordering 2021-10-20 23:19:17 +01:00
Linus Groh
d3ef08217b LibJS: Remove ErrorType::FixmeAddAnErrorString
Just add a proper ErrorType the first time, it's not that hard. We can
always iterate on the message later.
2021-10-20 18:46:24 +01:00
Linus Groh
cf109533de LibJS: Add ErrorTypes for Promise ownKeys trap invariant violations 2021-10-20 18:46:24 +01:00