Commit graph

26559 commits

Author SHA1 Message Date
Aliaksandr Kalenik 0daff637e2 LibJS: Add vector of local variables in ExecutionContext
Now ExecutionContext has vector of values that will represent values
of local variables.

This vector is initialized in ECMAScriptFunctionObject::internal_call()
or ECMAScriptFunctionObject::internal_const() using number of local
variables provided to ECMAScriptFunctionObject by the parser.
2023-07-05 21:03:01 +02:00
Aliaksandr Kalenik 7765ebb5f2 LibJS+LibWeb: Plumb local variables names to ECMAScriptFunctionObject
Saving vector of local variables names in ECMAScriptFunctionObject
will allow to get a name by index in case message of ReferenceError
needs to contain a variable name.
2023-07-05 21:03:01 +02:00
Aliaksandr Kalenik 401d97c45c LibJS: Add ScopeNode::for_each_var_declared_identifier()
The same as for_each_var_declared_name but for identifiers.
2023-07-05 21:03:01 +02:00
Aliaksandr Kalenik 7f0074ac23 LibJS: Add for_each_bound_identifier for AST::Declaration
The same as for_each_bound_name but for identifiers.
2023-07-05 21:03:01 +02:00
Aliaksandr Kalenik a6cdb1655b LibJS: Use Identifier to represent name of FunctionNode 2023-07-05 21:03:01 +02:00
Aliaksandr Kalenik 380abddf3c LibJS: Update parser to detect if identifier refer a "local" variable
This modification enables the parser to determine whether an identifier
used within a function refers to a local variable or not. In this
context, a local identifier means that it is not captured by any nested
function declaration which means it modified only from inside a
function.

The information about whether identifier is local is stored inside
Identifier AST node and also contains information about the index of
local variable inside a function and information about total number
of local variables used by a function is stored in function nodes.
2023-07-05 21:03:01 +02:00
Aliaksandr Kalenik c734f2b5e6 LibJS: Use Identifier to represent name of ClassExpression
By using Identifier class to represent the name of a class expression,
it becomes possible to consistently store information within the
identifier object, indicating whether the name refers to a local
variable or not.
2023-07-05 21:03:01 +02:00
Nico Weber 93357a8b70 LibPDF: Fix a typo in a function name
...and while here, a comment typo too.
2023-07-05 18:42:39 +01:00
Andreas Kling 1177308afb LibWeb: Support justify-content: space-evenly in flex layouts
Aligns the cookie banner correctly on https://twitter.com/ :^)
2023-07-05 19:03:20 +02:00
Andreas Kling 4474aa0ae5 LibWeb: Resolve flex item auto cross sizes through aspect ratio
Makes the bird logo show up on https://twitter.com/ :^)
2023-07-05 19:03:20 +02:00
Lucas CHOLLET 243e91f5de LibGfx/JPEG: Don't return an error on empty icc profiles
An empty icc profile shouldn't stop our brave decoder.
2023-07-05 17:41:17 +01:00
kleines Filmröllchen d7a2b5e65b markdown-check: Allow generating a manpage link graph
Using the cross-page links, we can generate a directed graph showing the
topology of which pages refer to other pages. This is not just for fun:
the links show how often a page is linked (since links are not
deduplicated on purpose), which pairs of pages only have links in one
direction (where a link in the other direction may be useful), which
groups of closely-interlinked pages exist, and which pages have few or
no links to other pages.

The EXTRA_MARKDOWN_CHECK_ARGS argument to the check-markdown script can
be used to inject the -g flag for generating the graph on all manpages.
2023-07-05 16:15:42 +01:00
kleines Filmröllchen f53aa959df LibManual: Compare nodes by path
This makes them suited for hash map usage.
2023-07-05 16:15:42 +01:00
kleines Filmröllchen a9053618a8 LibManual: Allow directly obtaining any page's main section number
This has previously been incorrectly handled in a variety of
applications, e.g. subsections were not accounted for.
2023-07-05 16:15:42 +01:00
kleines Filmröllchen b1eacf8801 LibManual: Trim page name correctly when full path is provided
We would previously add an extra "/" at the beginning, since the section
name end points exactly at the found "/".
2023-07-05 16:15:42 +01:00
Andreas Kling dfd0942e41 LibJS/Bytecode: Clear accumulator before entering for body
2 new passes on test262. :^)
2023-07-05 15:39:25 +02:00
Andreas Kling 24b815d4a0 LibJS/Bytecode: Clear accumulator before entering while body
2 new passes on test262. :^)
2023-07-05 15:39:25 +02:00
Andreas Kling b14032bbfa LibJS/Bytecode: Leave for in and for of with right completion value
14 new passes on test262. :^)
2023-07-05 15:39:25 +02:00
Andreas Kling 7430dee5cf LibJS/Bytecode: Make ClassDeclaration not clobber the accumulator
2 new passes on test262. :^)
2023-07-05 15:39:25 +02:00
Andreas Kling e87d84f883 LibJS/Bytecode: Support in binary operator for private fields
11 new passes on test262. :^)
2023-07-05 15:39:25 +02:00
Nicolas Ramz 4805447c22 LibWeb: Support cellspacing attribute on table elements 2023-07-05 12:31:54 +01:00
Daniel 4314ed72e6 FlappyBug: Replace usage of DeprecatedString 2023-07-05 12:13:44 +01:00
Lucas CHOLLET 0ef61ab895 LibGfx/JPEG: Convert some west-consts to east-consts 2023-07-05 12:10:56 +01:00
Lucas CHOLLET af14ed6b2e LibGfx/JPEG: Accept grayscale images with an App14 segment
The adobe specification doesn't even consider JPEG images with a single
component. So let's not consider the content of the App14 segment for
grayscale images.
2023-07-05 12:10:56 +01:00
Andreas Kling 088cc4ea73 LibWeb: Parse CSS :host selector
Let's at least parse it, even if we don't implement matching for it yet.
2023-07-05 12:42:02 +02:00
Karol Kosek bd853de716 Mail: Fix crash caused by migration from NonnullRefPtrVector
When we moved from NonnullRefPtrVector<T> to Vector<NonnullRefPtr<T>>
in commit 8a48246ed1, the `at()` function
started returning a NonnullRefPtr<T>& instead of T&.

The code calling create_index() was not then updated and ended up taking
a pointer to a temporary NonnullRefPtr<>, instead of an actual object,
leading to a crash after logging in.
2023-07-05 11:39:27 +02:00
Shannon Booth c57658fffa diff: Allow configurable context for unified and context diffs
Add the options '-C','--context' and '-U','--unified', which can be used
to ask diff to write a diff in that format with a given number of
context lines surrounding the diff.
2023-07-05 10:26:48 +01:00
Nicolas Ramz 876ad69ea3 LibWeb: Support bgcolor attribute on tr elements 2023-07-05 08:19:55 +01:00
Carwyn Nelson 093cbcd606 LibManual: Error on section_number 0 instead of crashing
Prior to this commit if you tried to access section 0 of the man page
(`man 0 ls`) the application would just crash with an array out of
bounds style error.

This commit just ensures that we return an explicit and helpful error
message when you try to request the 0th section, instead of crashing.
2023-07-05 08:57:39 +02:00
Daniel 0eb09a0b59 BrickGame: Propagate errors 2023-07-05 08:48:10 +02:00
Liav A 83ebd1882f Utilities: Add the memstat utility
This small utility is something we probably needed for a very long
time - a way to print memory statistics in an elegant manner.

This utility opens /sys/kernel/memstat, reads it and decode the values
into human readable entries, possibly even into human-readable sizes.
2023-07-05 08:34:51 +02:00
Liav A b74cb569ec Utilities/allocate: Modernize the code a bit
Use LibCore ArgsParser to parse the parameters instead of using the raw
strings from the argv (Main::Arguments) array.

Also, use indicative names for variables in the code so the utility code
is more understandable.
2023-07-05 08:34:51 +02:00
Aliaksandr Kalenik 75ae368896 LibJS: Propagate "contains await" flag to parent scope in ScopePusher
The flag indicating the presence of an await expression should be
passed up to the parent scope until the nearest function scope is
reached. This resolves several problems related to identifying
top-level awaits, which are currently not recognized correctly
when used within a nested scope.
2023-07-05 06:05:22 +02:00
Nico Weber 5619bb3e04 LibAudio: Stop using and remove LOADER_TRY
It's no longer needed now that this code uses ErrorOr instead of Result.

Ran:

    rg -lw LOADER_TRY Userland/Libraries/LibAudio \
        | xargs sed -i '' 's/LOADER_TRY/TRY/g'

...and then manually fixed up Userland/Libraries/LibAudio/LoaderError.h
to not redefine TRY but instead remove the now-unused LOADER_TRY,
and ran clang-format.
2023-07-04 13:24:17 -06:00
Jelle Raaijmakers eacc0bfa02 AK+LibC: Remove AK/Atomic.h includes from our RefPtrs
We don't seem to be using it there.
2023-07-04 16:30:13 +02:00
Andreas Kling 6b3b056476 LibWeb: Support CSS font shorthand with up to 4 consecutive normal
All of the following properties in the font shorthand can be `normal`:

- font-style
- font-variant
- font-weight
- font-stretch

This means that we must allow up to four consecutive `normal` at the
start of a font shorthand value.
2023-07-04 16:25:23 +02:00
Andreas Kling 793c2ff65a LibWeb: Improve align-items in abspos static position of flex child
Basically, just support more values. And add a test. :^)
2023-07-04 16:25:23 +02:00
Andreas Kling 80a734d42e LibWeb: Improve justify-content in abspos static position of flex child
Also, add a test so we know these actually work correctly now. :^)
2023-07-04 16:25:23 +02:00
Gabriel Dinner-David c9af6c87bf LibWeb: Add ::selection to pseudo elements 2023-07-04 15:53:20 +02:00
Sam Atkins 6d02403e06 FileManager: Restore inline message behavior for inaccessible dirs
Print the correct error from Core::System::chdir() instead of errno, and
display the error in the DirectoryView instead of continuing to show the
previous location's contents.

This regressed in 1dc3ba6ed5.
2023-07-04 12:40:22 +01:00
Andreas Kling 477a96820d LibWeb: Support valign attribute on td elements
This presentational hint maps to the CSS `vertical-align` property.

Fixes #19786.
2023-07-04 13:26:49 +02:00
kleines Filmröllchen a75377d014 LibAudio: Perform seekpoint comparison without subtraction
For very large seekpoint indices, the casts necessary for the "simple"
subtraction comparison will yield wrong and overflowing results.
Therefore, we perform the seekpoint comparison manually instead.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen e82bee86dd LibAudio: Account for 0xFF start byte in FLAC UTF-8 decoder
This specialized UTF-8 decoder is more powerful than a normal UTF-8
decoder anyways, but it couldn't account for the never spec-compliant
0xff start byte. This commit makes that byte behave as expected if
taking UTF-8 to its extreme, even if it is a little silly and likely not
relevant for real applications.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 8bc56c7fb0 LibAudio: Prevent FLAC Rice partitions getting smaller than 1 sample
This would cause an integer underflow leading to us trying to allocate
over 4GB for residual samples.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 952c633a65 LibAudio: Fix 32-bit/64-bit mixup in FLAC sign extend
The bit magic for two's complement sign extension was only sign
extending to 32-bit signed. This issue was exposed by the last commit,
where now we actually use the 64-bit return value.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 59c7ce3d54 LibAudio: Prevent integer overflows in intermediate FLAC calculations
Since we can have up to 32 bits of input data, multiplications may need
up to 63 bits. This was accounted for in some places, but by far not in
all, and oss-fuzz found multiple integer overflows. We now use i64 in
all of the decoding, since we need to rescale samples to float later on
anyways. If a final sample value ends up out of range (and the range can
be a maximum of 32 bits), we may get samples past 1, but that then is a
non-compliant input file, and using over-range samples (and most likely
clipping audio) is considerably less weird than overflowing and
glitching audio.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 9bece0d0da LibAudio: Prevent multiple kinds of buffer overruns in FLAC picture load
The fuzzer found one heap buffer overflow here due to confusion between
u32* and u8* (the given size is for bytes, but we used it for 32-bit
elements, quadrupling it), and it looks like there's an opportunity for
several more. This commit modernizes the picture loader by using
String's built-in stream loader, and also adds several spec-compliance
checks: The MIME type must be ASCII in a specific range, and the picture
description must be UTF-8.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen ab9c18c176 LibAudio: Don't try to resample FLAC frames with sample rate 0
Although this sample rate is more or less bogus, we might as well not
crash.
2023-07-04 12:47:08 +02:00
kleines Filmröllchen 2e9e0dfe61 LibAudio: Check that LPC order is smaller than subframe sample count
An LPC predictor (fixed or not) contains as many warm-up samples as its
order. Therefore, the corresponding subframe must have at least this
many samples.

This turns this fuzzer-found crash into a handleable format error.
2023-07-04 12:47:08 +02:00
MacDue ff402b1b42 file: Add a description for the image/tinyvg mime type 2023-07-04 12:04:32 +02:00
Andreas Kling fb727332f9 LibWeb: Decode linked style sheets before parsing them
This fixes an issue where a BOM at the head of a style sheet would be
passed verbatim to the parser, who would then interpret it as an ident
token and (after some confusion) fail to parse the first rule, but then
carry on with the rest of the sheet.
2023-07-04 10:45:20 +02:00
Nico Weber efad31dac1 Utilities: Add a pdf utility
This utility will learn tricks such as extracting images from PDFs and
dumping tables from PDFs so that we can create code from specs.

It also allows testing LibPDF things in lagom, and allows testing
reading large amounts of PDFs using a shell script.
2023-07-04 06:50:15 +02:00
Andreas Kling e7e454f1d6 LibWeb: Resolve used insets for grid items 2023-07-04 06:43:53 +02:00
Andreas Kling 03ec17fd37 LibWeb: Resolve used insets for flex items 2023-07-04 06:43:53 +02:00
Andreas Kling c83ae729d2 LibWeb: Resolve used insets for floating elements
This makes the game carousel work on https://null.com/ :^)
2023-07-04 06:43:53 +02:00
Carwyn Nelson a2591bc5fa LibCore: Make ArgParser::Arg::accept_value return ErrorOr<bool>
Much like the previous commit, this commit makes the
ArgParser::Arg::accept_value callback return an ErrorOr<bool> instead of
just a bool.

The aim of this is to make argument parsing more robust, especially
with the newer String api that returns an ErrorOr for many functions.
2023-07-04 04:26:58 +03:30
Carwyn Nelson abbfb00a02 LibCore: Make ArgParser::Option::accept_value return ErrorOr<bool>
This commit makes the `ArgParser::Option::accept_value` property more
error-safe by ensuring it returns an ErrorOr<bool> instead of just a
bool.
2023-07-04 04:26:58 +03:30
Jelle Raaijmakers 5c64686666 Kernel+AudioServer: Use interrupts for Intel HDA audio buffer completion
We used to not care about stopping an audio output stream for Intel HDA
since AudioServer would continuously send new buffers to play. Since
707f5ac150ef858760eb9faa52b9ba80c50c4262 however, that has changed.

Intel HDA now uses interrupts to detect when each buffer was completed
by the device, and uses a simple heuristic to detect whether a buffer
underrun has occurred so it can stop the output stream.

This was tested on Qemu's Intel HDA (Linux x86_64) and a bare metal MSI
Starship/Matisse HD Audio Controller.
2023-07-04 00:05:34 +02:00
Lucas CHOLLET 2e474e8c18 image: Add an option to tweak the quality of output JPEG 2023-07-04 00:01:06 +02:00
Lucas CHOLLET f3d15f53c9 LibCore: Add the template instantiation ArgsParser::add_option<u8>() 2023-07-04 00:01:06 +02:00
Lucas CHOLLET 1c1ba6a2bd LibCore: Be explicit about integers size
This concerns all template instantiations of `ArgsParser::add_option()`
for integers.
2023-07-04 00:01:06 +02:00
Lucas CHOLLET a58c7fe322 LibGfx/JPEG: Take the quality as an argument instead of hardcoding it 2023-07-04 00:01:06 +02:00
Lucas CHOLLET 05c8ad4e91 LibGfx/JPEG: Write quantization tables in the zigzag ordering
This is clearly something I missed during the first implementation. The
specification is crystal clear about it: "The quantization elements
shall be specified in zig-zag scan order."

This patch fixes the weird behavior we had when using the quantization
table.
2023-07-04 00:01:06 +02:00
MacDue bb5db0835d LibGfx: Allow loading a Bitmap (from bytes) with an ideal size 2023-07-03 23:54:51 +02:00
MacDue ee09ecaf42 Userland: Register MIME type/extension for .tvg
These both come from the specification.
2023-07-03 23:54:51 +02:00
MacDue ae18186905 LibGfx: Implement image decoder for TinyVG (.tvg)
This adds a decoder for the TinyVG vector format (https://tinyvg.tech/).
TinyVG is a very simple binary vector format, but it is good enough to
represent a lot of SVGs, without needing the full web engine.

The main use case for Serenity is for scalable icons (which .tvg easily
handles).
2023-07-03 23:54:51 +02:00
MacDue e7cddda7e1 LibGfx: Allow passing an ideal size to image decoders
The ideal size is the size the user will display the image. Raster
formats should ignore this parameter, but vector formats can use
it to generate a bitmap of the ideal size.
2023-07-03 23:54:51 +02:00
Lucas CHOLLET ff47223301 LibCore: Make NetworkJob::start() take a Stream::BufferedSocketBase&
It used to take a plain `Socket` and cast it to a `BufferedSocketBase`,
which can lead to unpleasant result when used with a non-buffered
`Socket`.
2023-07-03 23:29:28 +02:00
Lucas CHOLLET 5fc873f53b LibCore: Don't implement pure virtual methods in NetworkJob 2023-07-03 23:29:28 +02:00
Lucas CHOLLET 9581fe1d7d LibTLS: Remove unused methods
Affected methods are:
 - can_read_line
 - can_read
 - read_line
2023-07-03 23:29:28 +02:00
Lucas CHOLLET b46667639f LibHTTP: Make HttpRequest return its method name as a StringView 2023-07-03 23:29:28 +02:00
Timothy Flynn 163ddf1d73 LibWeb: Display the media volume in a tooltip while it is changing 2023-07-03 19:07:26 +02:00
Timothy Flynn 720d8889ad LibWeb: Allow changing media volume with keyboard controls
This allows increasing and decreasing the media volume by 10% with the
up and down arrow keys, respectively. This also allows toggling the mute
state with the M key.
2023-07-03 19:07:26 +02:00
Timothy Flynn 6a5229c2cb LibWeb: Allow seeking media elements with keyboard controls
This allows seeking backwards and forwards by 5 seconds with the left
and right arrow keys, respectively. This also allows seeking to the
beginning and end of the media track with the home and end keys.
2023-07-03 19:07:26 +02:00
Timothy Flynn a4070b1452 LibWeb: Allow toggling playback of media elements with keyboard controls
This allows pausing/playing media elements with the space bar.
2023-07-03 19:07:26 +02:00
Timothy Flynn 2c5c815f44 LibWeb: Toggle media playback when clicking anywhere on the control box
Feels nicer to click anywhere on the control box to toggle playback,
rather than needing to accurately click the playback button. Note this
does not affect other behavior-specific buttons; i.e. if the mute button
is pressed, we won't reach the playback toggle..
2023-07-03 19:07:26 +02:00
Timothy Flynn c2357a059e LibWeb: Mark media elements as focusable
This allows focusing media elements for keyboard control.
2023-07-03 19:07:26 +02:00
Timothy Flynn 3793b7c6bd LibWeb: Move helper to toggle a media element's playback to the element
This will be needed elsewhere.
2023-07-03 19:07:26 +02:00
Timothy Flynn 435ced70b8 LibWeb: Update the media element's display in a couple situations
Mostly seen on macOS, but when we toggle playing a media element, we
need to update its layout node's display to ensure the change is
reflected on the playback button. Further, when setting the element's
display time, we need to update the display to ensure the change is
refelected on the media timeline.
2023-07-03 19:07:26 +02:00
Timothy Flynn 27ca90646d WebContent: Clear Serenity's audio buffers when seeking
Without this, the already-buffered audio may continue playing after a
seek. The SoundPlayer application does the same operation here.
2023-07-03 19:07:26 +02:00
Andreas Kling 21260ea2ef LibWeb: Merge did_remove_attribute() into attribute_changed()
Instead of having two virtuals for attribute change notifications,
there is now only one. When the attribute is removed, the value is null.
2023-07-03 19:04:45 +02:00
Andreas Kling 5a74486b59 LibWeb: Rename DOM::Element::parse_attribute() => attribute_changed()
This is a first step towards merging attribute change and removal
notifications into a single function.
2023-07-03 19:04:45 +02:00
Ali Mohammad Pur e1e04884b9 LibLine: Handle any errors propagated through refresh_display()
This can only realistically happen when the terminal no longer exists,
so quitting with an error here is the better solution as the application
will soon be killed anyway.
Fixes #19742.
Fixes #19017.
2023-07-03 19:07:33 +03:30
Hendiadyoin1 b26dad3d62 LibJS: Handle Calls argument range during EliminateLoads pass
Otherwise we could forget to emit stores those registers, thinking that
they are only directly accessed.
2023-07-03 16:55:13 +02:00
Lucas CHOLLET f52e3e540f LibGfx/JPEG: Add a fast path for sequential JPEGs
Decoding progressive JPEGs involves a much more complicated logic than
sequential JPEGs. Thanks to template specialization, this patch allow us
to skip the additional cost of progressive images when it's not needed.

It gives a nice 10% improvements on sequential JPEGs :^)
2023-07-03 14:26:15 +02:00
Andreas Kling 510dfbb7e6 LibWeb: Update anonymous wrappers when applying style changes
Anonymous wrapper boxes inherit style from their layout tree parent,
and since style data is per-layout-node, we have to manually sync them
from parent to anonymous children when something changes.

This is not very elegant or efficient, so I've left a FIXME about
solving it in a nicer way.

This fixes horizontal dog alignment on https://waffles.dog/ :^)
2023-07-03 13:37:14 +02:00
Andreas Kling b918ce4022 LibWeb: Make Layout::TextNode::text_for_rendering() lazily computed
As it turns out, Layout::TreeBuilder never managed to wrap text within
table boxes in anonymous wrapper boxes, since it relied on checking
text_for_rendering(), and that was never initialized during that early
stage of tree building.

This patch fixes the issue by making text_for_rendering() compute the
(potentially collapsed) text lazily when called.

Note that the test included with this patch is still totally wrong,
but that is now a TFC problem rather than a TreeBuilder problem. :^)
2023-07-03 11:50:58 +02:00
Andreas Kling 5cdb394400 LibWeb: Make HTML parser flush all pending tokens in "in table text"
There were multiple bugs in the parsing algorithm for handling text
occurring inside a `table` element:

- When there was pending non-whitespace text inside a table, we only
  flushed one token instead of all pending tokens.

- Also, we didn't even flush one of the right tokens, but instead the
  token that caused the flush to happen.

- Once we started flushing the right tokens, it turned out we had not
  yet implemented character insertion points expressed as "before X".

- Finally, we were not exiting the "in table text" mode after flushing
  pending tokens, effectively getting us stuck in that mode until EOF.
2023-07-03 11:50:58 +02:00
Andreas Kling 8c3e5137f7 LibWeb: Add spec comments to HTML parser "in table text" insertion mode 2023-07-03 11:50:58 +02:00
Andreas Kling 87f0c1c353 LibWeb: Add spec comments to HTML parser "in table" insertion mode
Also remove some overly anxious FIXMEs about slight variance in spec
language. :^)
2023-07-03 11:50:58 +02:00
Andreas Kling bac500b9ad LibWeb: Add spec comments to HTML parser "in row" insertion mode 2023-07-03 11:50:58 +02:00
Shannon Booth 8c8b24d877 diff: Add support for writing diffs in context format 2023-07-03 10:41:30 +02:00
Shannon Booth 44f141dd24 LibDiff: Add Diff::write_context_header
This is used to write a context patch header.
2023-07-03 10:41:30 +02:00
Shannon Booth f02cf2704c LibDiff: Add support for writing formatted context hunks
There is a little bit more complexity involved here than the other
formats. In particular, this is due to the need to determine whether
an addition line or removal line is just that, or a 'change'.
2023-07-03 10:41:30 +02:00
Carwyn Nelson e7da956090 man: Change all uses of DeprecatedString to String 2023-07-03 02:05:32 +02:00
Carwyn Nelson e44abaa777 LibMarkdown: Convert render_to_terminal to String
This commit converts render_to_terminal from DeprecatedString to return
an ErrorOr<String>. This is to aid moving `man` away from
DeprecatedString.

I have opted not to convert render_to_html and render_to_inline_html for
now to keep this commit as small as possible.
2023-07-03 02:05:32 +02:00
Carwyn Nelson e247da507f LibCore: Add new String variants to ArgsParser
This commit adds the ability to use the String class with `add_option`
and `add_positional_argument`.

This should help with the transition away from DeprecatedString.
2023-07-03 02:05:32 +02:00
Daniel Bertalan d165590809 LibJS/Bytecode: Do not coerce the receiver to Object for internal_set
This makes the behavior of `Symbol` correct in strict mode, wherein if
the receiver is a symbol primitive, assigning new properties should
throw a TypeError.
2023-07-02 22:08:48 +01:00
Daniel Bertalan 0cd85ab0fc AK+LibJS: Make Number.MIN_VALUE a denormal
ECMA-262 implies that `MIN_VALUE` should be a denormalized value if
denormal arithmetic is supported. This is the case on x86-64 and AArch64
using standard GCC/Clang compilation settings.

test262 checks whether `Number.MIN_VALUE / 2.0` is equal to 0, which
only holds if `MIN_VALUE` is the smallest denormalized value.

This commit renames the existing `NumericLimits<FloatingPoint>::min()`
to `min_normal()` and adds a `min_denormal()` method to force users to
explicitly think about which one is appropriate for their use case. We
shouldn't follow the STL's confusingly designed interface in this
regard.
2023-07-02 21:19:09 +01:00
Cameron Youell 978fe3c6d5 Shell: Add option Produce symbolic output to umask
Its a standard posix option thats always nice to have :^)
2023-07-02 11:19:10 -06:00