Commit graph

26559 commits

Author SHA1 Message Date
Cameron Youell d9ff37e1b1 Utilities: Make mktemp follow the spec directory path resolution
Previously an input like this:

mktemp -d /tmp/dirtest_-XXXXX

Would result in an error when it should have created a temp directory
2023-07-02 11:19:10 -06:00
Cameron Youell 9630fe3ebc Utilities: Remove unused variable in mktemp 2023-07-02 11:19:10 -06:00
Shannon Booth ff23426b6e headless-browser: Write failed diffs in unified format with context 2023-07-02 11:18:11 -06:00
Shannon Booth 2c9db2de05 diff: Add support for writing diffs in unified format with context 2023-07-02 11:18:11 -06:00
Shannon Booth 55a3dfec10 LibDiff: Add support for generating diffs with surrounding context
While not used in normal diffs due to limitations in the format, this
may be used in context and unified format diffs.
2023-07-02 11:18:11 -06:00
Shannon Booth f528aedc85 LibDiff: Add Diff::write_unified_header
This is used to write a unified patch header.
2023-07-02 11:18:11 -06:00
Shannon Booth a4e50deeea LibDiff: Add Diff::write_unified for formatting unified hunks 2023-07-02 11:18:11 -06:00
Shannon Booth f690807c5a LibDiff: Change underlying representation of Hunk to allow context
The existing hunk data structure does not contain any way to easily
store information about context surrounding the additions and removals
in a hunk. While this does work fine for normal diffs (where there is
never any surrounding context) this data structure is quite limiting for
other use cases.

Without support for surrounding context it is not possible to:
 * Add support for unified or context format to the diff utility to
   output surrounding context.
 * Be able to implement a patch utility that uses the surrounding
   context to reliably locate where to apply a patch when a hunk range
   does not apply perfectly.

This patch changes Diff::Hunk such that its data structure more closely
resembles a unified diff. Each line in a hunk is now either a change,
removal, addition or context.

Allowing hunks to have context inside of them exposes that HackStudio
heavily relies on there being no context in the hunks that it uses for
its' git gutter implementation. The fix here is simple - ask git to
produce us a diff that has no context in it!
2023-07-02 11:18:11 -06:00
Sebastian Zaha 553694679e LibWeb: Fix alternating-sides float positioning
The "y" check for when to reset float side positioning was comparing an
offset that included the border, while the offset of the other side does
not.
2023-07-02 18:43:20 +02:00
Andreas Kling c37b204ce1 LibJS/Bytecode: Add Call opcode for fixed-argument-count calls
This avoids the overhead of allocating a new Array on every function
call, saving a substantial amount of time and avoiding GC thrash.

This patch only makes use of Op::Call in CallExpression. There are other
places we should codegen this op. We should also do the same for super
expression calls.

~5% speed-up on Kraken/stanford-crypto-ccm.js
2023-07-02 18:30:02 +02:00
Andreas Kling 7eb87dec9f LibJS/Bytecode: Rename Call and SuperCall to &WithArgumentArray
Forcing every function call to allocate a new Array just to accommodate
spread parameters is not very nice, so let's start moving towards making
this a special case rather than the general (and only) case.
2023-07-02 18:30:02 +02:00
Andreas Kling dc884aa0d3 LibJS/Bytecode: Remove unnecessary variable environment stack
The var environments will unwind as needed with the ExecutionContext
and there's no need to include it in the unwind info.

We still need to do this for lexical environments though, since they
can have short local lifetimes inside a function.
2023-07-02 18:30:02 +02:00
Niklas Lahnstein e2b0cacb89 3DFileViewer: Properly handle ENOENT errors 2023-07-02 17:35:35 +02:00
Niklas Lahnstein 8534506ab0 3DFileViewer: Use ArgsParser 2023-07-02 17:35:35 +02:00
stelar7 0fc73679f1 LibTLS: Fix typo in ecdsa_sha512 OID 2023-07-02 16:13:37 +02:00
stelar7 77080fbade LibTLS: Rename parse_version to parse_certificate_version
This is not a generic version, but specifically for certificates.
2023-07-02 16:13:37 +02:00
Torstennator 0c95564533 PixelPaint: FilterGallery fix preview
This patch fixes an issue where the preview for an filter was always
based on the content bitmap even if the edit mode was set to Mask.
Now the preview is using the content or mask bitmap based on the
current edit mode and therefore generates the correct preview of
what is going to be changed.
2023-07-02 15:23:42 +02:00
Torstennator d9d9103cbb PixelPaint: Start using Editing-Masks for some tools
This patch starts to integrate the usage of Editing-Masks for the
following tools: Spray-Tool, Brush-Tool and Erase-Tool
2023-07-02 15:23:42 +02:00
Torstennator 0a120e239a PixelPaint: Remove todo from LevelDialog
This patch removes a todo where the revert for any changes could be
optimized. Previously every single pixel was copied back from the
reference bitmap to the content bitmap. Now the editors content
bitmap is just replaced with the reference bitmap that is a copy
of the unchanged content bitmap.
2023-07-02 15:23:42 +02:00
Torstennator 1f31e72843 PixelPaint: LevelDialog enhancements
This patch adds the ability to apply slider changes only to regions
where a editing-mask was drawn.
2023-07-02 15:23:42 +02:00
Torstennator e3509efc1b PixelPaint: Introduce new mask features
This patch adds a new Editing-Mask type to layers. This kind of mask
is used to restrict changes on the content bitmap only to areas where
the mask is drawn. The intensity of a pixel change is controlled by the
alpha-value of the mask.

Furthermore a function to invert and clear masks has been introduced.
When a new mask is created for a layer the edit mode of the layer is
also changed to Mask so that the user can immediately start to draw the
mask.
2023-07-02 15:23:42 +02:00
Ali Mohammad Pur 7e5f1fa895 LibLine: Defer handling SIGWINCH and SIGINT
Performing these immediately can introduce a race condition between the
user's signal-related logic and LibLine's own, so defer the handlers to
make sure they run when our terminal IO cannot interfere with the
user's.
2023-07-02 16:27:52 +03:30
Andreas Kling fb979dcf34 LibJS/Bytecode: Make Bytecode::Interpreter participate in GC marking
Since the relationship between VM and Bytecode::Interpreter is now
clear, we can have VM ask the Interpreter for roots in the GC marking
pass. This avoids having to register and unregister handles and
MarkedVectors over and over.

Since GeneratorObject can also own a RegisterWindow, we share the code
in a RegisterWindow::visit_edges() helper.

~4% speed-up on Kraken/stanford-crypto-ccm.js :^)
2023-07-02 14:50:02 +02:00
Andreas Kling cea2071349 LibJS/Bytecode: Infer name of anonymous exported classes when possible
5 new passes on test262. :^)
2023-07-02 12:18:25 +02:00
Andreas Kling b0ae1e80fb LibJS/Bytecode: Support using MemberExpression as rest property
Also, don't assert while dumping an AST with this construct.

7 new passes on test262. :^)
2023-07-02 11:53:10 +02:00
Daniel Bertalan 0df7255fe7 LibJS/Bytecode: Do not clobber completion value with VariableDeclaration
While the completion value of a variable declaration is specified to be
empty, we might already have a completion value in the accumulator from
a previous statement. Preserve it so as to avoid clobbering it.

This fixes 6 tests on test262.
2023-07-02 10:54:35 +02:00
Andreas Kling bd2c3ace68 LibJS/Bytecode: Make sure empty with statement results in undefined
2 new passes on test262. :^)
2023-07-02 10:54:28 +02:00
kleines Filmröllchen 8ba4036bba Base: Add accept(2) man page
This man page was referenced from some places. This is mostly a
condensed version of the POSIX behavior that the system call
implementation already has, only documenting the obviously visible
errors (in source code) we do actually report.
2023-07-02 02:29:09 +02:00
kleines Filmröllchen 6cddee98a9 LibAudio: Don't overread MP3 granule samples if big_values is too large
There are at most 576 granule samples/frequency lines, but the side data
can specify that the big_values granule type take up to 1024 samples.
The spec says in 2.4.3.4.6 that we should always stop reading Huffman
data once we have 576 samples, so that is what this change does. I also
add some useful spec comments while I'm here.
2023-07-02 02:15:32 +02:00
kleines Filmröllchen 53785a9206 LibAudio: Handle bitstream errors in MP3 Huffman decode 2023-07-02 02:15:32 +02:00
MacDue 40fa07a6e1 LibWeb: Force paintable to exist for SVG <g> elements
This (along with the previous commit) fixes the missing tears on the
sad Duolingo owl.
2023-07-02 01:31:18 +02:00
MacDue 7d26383426 LibWeb: Remove SVGContext
The SVGContext is a leftover from when SVG properties were more ad-hoc.
All properties are now (for better or worse) treated as CSS properties
(or handled elsewhere). This makes the SVGContext's fill/stroke
inheritance handling unnecessary.
2023-07-02 01:31:18 +02:00
Liav A 23a7ccf607 Kernel+LibCore+LibC: Split the mount syscall into multiple syscalls
This is a preparation before we can create a usable mechanism to use
filesystem-specific mount flags.
To keep some compatibility with userland code, LibC and LibCore mount
functions are kept being usable, but now instead of doing an "atomic"
syscall, they do multiple syscalls to perform the complete procedure of
mounting a filesystem.

The FileBackedFileSystem IntrusiveList in the VFS code is now changed to
be protected by a Mutex, because when we mount a new filesystem, we need
to check if a filesystem is already created for a given source_fd so we
do a scan for that OpenFileDescription in that list. If we fail to find
an already-created filesystem we create a new one and register it in the
list if we successfully mounted it. We use a Mutex because we might need
to initiate disk access during the filesystem creation, which will take
other mutexes in other parts of the kernel, therefore making it not
possible to take a spinlock while doing this.
2023-07-02 01:04:51 +02:00
kleines Filmröllchen b4fbd30b70 AudioServer+Userland: Decouple client sample rates from device rate
This change was a long time in the making ever since we obtained sample
rate awareness in the system. Now, each client has its own sample rate,
accessible via new IPC APIs, and the device sample rate is only
accessible via the management interface. AudioServer takes care of
resampling client streams into the device sample rate. Therefore, the
main improvement introduced with this commit is full responsiveness to
sample rate changes; all open audio programs will continue to play at
correct speed with the audio resampled to the new device rate.

The immediate benefits are manifold:
- Gets rid of the legacy hardware sample rate IPC message in the
  non-managing client
- Removes duplicate resampling and sample index rescaling code
  everywhere
- Avoids potential sample index scaling bugs in SoundPlayer (which have
  happened many times before) and fixes a sample index scaling bug in
  aplay
- Removes several FIXMEs
- Reduces amount of sample copying in all applications (especially
  Piano, where this is critical), improving performance
- Reduces number of resampling users, making future API changes (which
  will need to happen for correct resampling to be implemented) easier

I also threw in a simple race condition fix for Piano's audio player
loop.
2023-07-01 23:27:24 +01:00
Sebastian Zaha d52a2ff10e LibGfx: Fix error & crash in Rect::closest_to
Assertion fails if the point is outside of the rect. This was introduced
in introduced in #18970 and causes serenity to crash when changing to 2x
resolution for a monitor, if the cursor after resizing is outside of
the new screen.

Added test to reproduce.
2023-07-01 23:27:00 +02:00
Andreas Kling 0cb9c9e81e LibJS: Add fast paths for bitwise ops on 2x Int32 JS::Value
~9% speed-up on Kraken/stanford-crypto-aes.js :^)
2023-07-01 20:29:12 +01:00
Andreas Kling 1efe4b58aa LibJS/Bytecode: Store current interpreter register window as a Span
This avoids a bunch of indirections on every single register access.

~17% speed-up on Kraken/stanford-crypto-aes.js :^)
2023-07-01 20:29:12 +01:00
Shannon Booth e7435d68b0 LibJS: Extract named vm variables in ArrayBufferPrototype::slice 2023-07-01 16:55:17 +01:00
Shannon Booth 3781948f0c LibJS: Add initial implementation for SharedArrayBuffer
None of the actual sharing is implemented yet, but this is enough for
most basic functionality.

Diff Tests:
    +260     -262    +2 💀
2023-07-01 16:55:17 +01:00
Ali Mohammad Pur 1c1aa2c0d0 Shell: Handle (most) errors in the parsers
This turns all errors into either "OOM" or a proper shell error (if
propagation is impossible or meaningless).
Fixes `echo -en '\xfe\x4a' | $SHELL` crashing.
2023-07-01 17:01:54 +03:30
Andreas Kling 3f022f4040 LibWeb: Treat non-finite containing block width as zero for percentages
Fixes an assertion when loading https://bun.sh/
2023-07-01 09:06:49 +02:00
Haikal Zain bf16618fba LibWeb: Add vertical border heights to tr
tr y offset is not being computed correctly.
This is causing errors in hit testing since
td and tr are misaligned.
2023-07-01 08:07:49 +02:00
Andi Gallo 6b649af447 LibWeb: Fix inset shadow with zero offset and blur
Before this change, we only blurred the shadows which would've been
generated without blur. This meant that we didn't generate a shadow when
the offset was zero, even with blur. However, other browsers generate a
shadow when blur is set.

Instead, always generate a rectangular contour of sufficient thickness,
blur it if needed and blit it into the right position at the very end.
Thanks to the blur radius, we'll have a shadow even when the offset is
zero.
2023-07-01 07:48:33 +02:00
Andrew Kaster 31440687a3 LibJS: Check the ASAN fake stack for heap pointers when ASAN is enabled
This is a similar strategy to what v8 does. Use the ASAN API function
__asan_addr_is_in_fake_stack to check any fake stack frames associated
with each stack address we scan. This fully allows running test-js -g
with the option detect_stack_use_after_return turned on.
2023-07-01 07:03:11 +02:00
Daniel Bertalan 96b197ef46 LibJS/Temporal: Perform floating point arithmetic in RoundTime
The valid range for temporal values (`nsMinInstant`/`nsMaxInstant`)
means performing nanosecond-valued integers could lead to an overflow.

NB: Only the `roundingMode: "day"` case was affected, as all others were
already performing the division on floating-point `fractional_second`
values. I'm adding `.0` suffixes everywhere to make this fact clearer.

This adds a few local tests as well, as those are tested with sanitizers
enabled by default, unlike test262.
2023-07-01 06:51:25 +02:00
Daniel Bertalan 1dce1994eb LibJS: Make the options arg of InterpretTemporalDateTimeFields nullable
This fixes "reference binding to null pointer" UBSan warnings.
2023-07-01 06:51:25 +02:00
PrestonLTaylor 850c252b3e LibJS: Implement ArrayBuffer.prototype.transfer & transferToFixedLength 2023-06-30 23:23:15 +02:00
PrestonLTaylor 34c5d34b95 LibJS: Show when an ArrayBuffer is detached when printing 2023-06-30 23:23:15 +02:00
PrestonLTaylor 286bf307d2 LibJS: Don't crash when calling byte_length for a detached ArrayBuffer 2023-06-30 23:23:15 +02:00
Sam Atkins 8c50d5d248 LibWeb: Remove misleading log message about unimplemented functions
`parse_a_calc_function_node()` only detects math functions, but
regularly encounters unrelated functions like `rgba()`. Since we now
support all the math functions, this message is just misleading spam.
2023-06-30 14:39:36 +01:00
Sam Atkins d0808e5d94 LibWeb: Correct @font-face debug log messages 2023-06-30 14:39:36 +01:00
PrestonLTaylor bd0ccbe3c8 LibJS: Implement the ArrayBuffer.prototype.detached getter 2023-06-30 12:47:15 +01:00
Zaggy1024 8157bb601b LibWeb: Place the unique task source used by media elements last
In the merging of an extremely large navigables PR, a task queue source
was added after the unique task source start value that was supposed to
remain last in the enum.
2023-06-30 12:52:46 +02:00
Andreas Kling 854b114c04 LibWeb: Use the script's own URL as filename for fetched classic script
This makes JS backtraces actually show the filename of scripts correctly
again (instead of the URL of the document that loaded them).
2023-06-29 12:07:11 +02:00
Daniel Bertalan 18c735429f LibJS: Fix incorrect is_function() check in NewPromiseCapability
I introduced this copy-paste mistake in c21255d.

Gets rid of 7 assertion failures on test262.
2023-06-29 08:43:28 +02:00
Aliaksandr Kalenik 1550e7c421 LibJS: Stop using execute_ast_node in NewClass instruction
This change replaces usage of `execute_ast_node` to evaluate super
expression in NewClass by generating instructions instead.
2023-06-29 07:14:14 +02:00
Andi Gallo d33b99dd24 LibWeb: Check whether table box width is auto when resolving cell width
Computing the table width algorithm bifurcates based on whether
table-root width is auto. We only adjust the used table width based on
cell percentage widths on the auto branch, thus the same check is needed
when we initialize cell widths.
2023-06-29 05:37:34 +02:00
Hendiadyoin1 37067cf3ca LibJS: Use the IdentifierTable for NewFunction and NewClass lhs names
This makes them trivially copyable, which is an assumption multiple
optimizations use when rebuilding the instruction stream.

This fixes most optimized crashes in the test262 suite.
2023-06-29 05:32:08 +02:00
Daniel Bertalan c21255da7f LibJS: Align NewPromiseCapability with spec changes
See https://github.com/tc39/ecma262/commit/874ecf9

After this refactoring, we now correctly handle non-function /
non-undefined objects being passed multiple times: instead of skipping
assignment to promiseCapability altogether and failing with a
NotAFunction error in the end; on the second time the executor closure
is called, we return GetCapabilitiesExecutorCalledMultipleTimes.

This fixes the 7 `capability-executor-called-twice.js` test262 tests.
2023-06-28 23:36:15 +01:00
Shannon Booth 0748e755d8 LibJS: Implement SetValueInBuffer closer to spec
No functional changes intended, mostly just adding spec comments, along
with some asserts.
2023-06-28 23:18:39 +01:00
Shannon Booth fe479ffd66 LibJS: Add spec comment for [[ArrayBufferData]]
I have found myself needing to grep around for this one a bunch.
2023-06-28 23:18:39 +01:00
Shannon Booth 78d5c23c3a LibJS: Add spec comment for IsDetachedBuffer ( arrayBuffer ) 2023-06-28 23:18:39 +01:00
PrestonLTaylor 0eac8bce6f LibWeb: Fix js execution for js urls in anchor tags href 2023-06-28 16:19:13 +02:00
Andi Gallo 4596d41291 LibWeb: Make cell percentage widths relative to table
Cell percentage widths are relative to table width, not containing
block width. If the table width is auto, there isn't a normative
specification, only a brief mention that the user agent should try to
meet it.

As a starting point, we increase the width of the table such that it's
sufficient to cover min-width of cells with a percentage width. This
matches the behavior of other browsers, at least for simple cases.
2023-06-28 16:14:42 +02:00
Daniel Bertalan 50d6b1ba19 LibJS/Bytecode: Keep completion value of switch case if falling through
We do this by moving the `LoadImmediate undefined` instruction to a
separate basic block which jumps to the case's block unconditionally.
We enter a case initially using this wrapper, but when falling through,
we directly jump to the next case's block.
2023-06-28 12:30:23 +02:00
Andi Gallo 9cb4fe6a6f LibWeb: Don't distribute excess width to constrained columns
Bring our implementation closer to the specification, which distributes
excess width to unconstrained columns first.
2023-06-28 12:17:55 +02:00
zhiyuang 6bd4d44f73 LibWeb: Make two borders joints part painting work
Unify using device pixel to compute step
2023-06-28 10:08:09 +01:00
Shannon Booth be280ff3e4 LibJS/Tests: Enable some now passing Array length tests
Now that serenity is 64 bit only these tests no longer need to be
skipped :^)
2023-06-28 10:48:15 +02:00
Daniel Bertalan fda619c7c2 LibJS/Bytecode: Implement Annex B Initializers in ForIn Statement Heads 2023-06-28 10:42:32 +02:00
Daniel Adams 49e6414c58 LibWeb: Start filling out BaseAudioContext/AudioContext interfaces
- Fills out both IDLs and implements some basic attributes/methods.
- No actual audio processing yet though :^)
2023-06-28 05:22:51 +02:00
Daniel Bertalan fc7de74b12 LibJS/Bytecode: Improve export statement handling
This adds support for exporting class expressions, which was previously
TODO'd.

We now correctly set the binding name of exports to `"*default*"` if
they are unnamed. I'm not sure what the difference between the
`InitializationMode` kinds is, but using `Initialize` fixes a bunch of
tests.

Note that some export tests (e.g. `eval-export-dflt-expr-cls-named.js`)
still fail, as we don't set the "name" property of exported classes
correctly.

176 new passes on test262
2023-06-28 05:13:52 +02:00
Daniel Bertalan 11a7014b4e LibJS/Bytecode: Handle ImportStatement in codegen
There is nothing to do here at runtime as imports are handled in
`Interpreter::run`.
2023-06-27 21:10:08 +02:00
Luke Wilde 363bf114c0 LibJS/Bytecode: Implement for await of
Summary:
    Diff Tests:
        +391    +15    +2 💥️    -408 📝
2023-06-27 21:04:22 +02:00
kleines Filmröllchen 5c8405c455 ClipboardHistory: Use i32 config change listener
Fixes a FIXME.
2023-06-27 15:37:00 +01:00
kleines Filmröllchen 33829f05fe Userland: Convert config listener callbacks to use StringView
The immutability of the string is not relevant here, since the string
we're given was allocated in the IPC serialization layer and will be
destroyed shortly afterwards. Additionally, noone relies on
DeprecatedString-specific functionality. This will make it easier to
convert the IPC layer itself to String later on.
2023-06-27 15:37:00 +01:00
kleines Filmröllchen 5f1dbbaaa6 LibAudio: Extract loader stream creation from the plugins
This removes a lot of duplicated stream creation code from the plugins,
and also simplifies the way that the appropriate plugin is found. This
mirrors the ImageDecoderPlugin design and necessitates new sniffing
methods on the loaders.
2023-06-27 15:28:22 +01:00
kleines Filmröllchen dfd48ab643 LibAudio: Extract MP3 synchronize to static helper function
This comes in handy when we want to sniff an MP3 file with a stream
outside of the loader.
2023-06-27 15:28:22 +01:00
Andreas Kling aec3d9d84e LibJS/Bytecode: Prefer alias over name in object pattern bindings
10 new passes on test262. :^)
2023-06-27 15:08:14 +02:00
Andreas Kling 1dc7f03137 LibJS: Have AsyncFunctionDriverWrapper unwrap promises before returning
24 new passes on test262. :^)
2023-06-27 13:48:27 +02:00
Daniel Bertalan cc9ec6693b LibJS: Remove the concept of bytecode optimization levels
While this would be useful in the future for implementing a multi-tiered
optimization strategy, currently a binary on/off is enough for us. This
removes the confusingly on-by-default `OptimizationLevel::None` option
which made the optimization pipeline a no-op even if
`Bytecode::Interpreter::set_optimizations_enabled` had been called.

Fixes #15982
2023-06-27 14:35:23 +03:30
Daniel Bertalan e012565898 test262-runner+js: Respect the bytecode optimizations enabled flag 2023-06-27 14:35:23 +03:30
Andrew Kaster aa0ed4ab4e LibDebug: Keep track of the SetEpilogueBegin LineProgram OpCode
This prevents a crash with clang 16.
2023-06-27 12:40:38 +02:00
implicitfield 5dfe2eb389 Everywhere: Resolve conflicts with LibC and libc++
Since https://reviews.llvm.org/D131441, libc++ must be included before
LibC. As clang includes libc++ as one of the system includes, LibC
must be included after those, and the only correct way to do that is
to install LibC's headers into the sysroot.

Targets that don't link with LibC yet require its headers for one
reason or another must add install_libc_headers as a dependency to
ensure that the correct headers have been (re)installed into the
sysroot.

LibC/stddef.h has been dropped since the built-in stddef.h receives
a higher include priority.

In addition, string.h and wchar.h must
define __CORRECT_ISO_CPP_STRING_H_PROTO and
_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS respectively in order to tell
libc++ to not try to define methods implemented by LibC.
2023-06-27 12:40:38 +02:00
implicitfield 58c4e266e9 LibWeb: Prevent double promotion in paint_background 2023-06-27 12:40:38 +02:00
implicitfield 007f3cdb00 Everywhere: Remove exceptions for using #include <LibC/...>
Once LibC is installed to the sysroot and its conflicts with libc++
are resolved, including LibC headers in such a way will cause errors
with a modern LLVM-based toolchain.
2023-06-27 12:40:38 +02:00
implicitfield 79adeb626b LibC+LibELF: Move ELF definitions from LibC to LibELF
This is needed to avoid including LibC headers in Lagom builds.
Unfortunately, we cannot rely on the build machine to provide a
fully POSIX-compatible ELF header for Lagom builds, so we have to
use our own.
2023-06-27 12:40:38 +02:00
implicitfield 7d19abda7a LibC+LibRegex: Move regex_defs.h from LibC to LibRegex
This is needed to avoid including LibC headers in Lagom builds.
2023-06-27 12:40:38 +02:00
implicitfield cccb6c7287 LibC: Drop complex.cpp and move its definitions to complex.h
libc++ disallows including LibC's complex.h in C++ mode. This means that
a C++ file cannot expect LibC's complex.h to be included, and thus
cannot use c-prefixed complex number functions. As a result,
complex.cpp is broken when libc++ has a higher include priority
than LibC.

A check for __cplusplus has been added to complex.h to warn users of
toolchains that don't use libc++.
2023-06-27 12:40:38 +02:00
MacDue 1cc199d365 LibWeb: Prevent crash when inspecting SVG documents
(Or any document with aria-hidden=true on the root)
2023-06-27 09:20:06 +01:00
Andreas Kling 9430bbcc62 LibJS/Bytecode: Propagate FunctionDeclarationInstantiation exceptions
If an exception is thrown by FunctionDeclarationInstantiation for an
async or async-generator function, we still need to return a promise.
We can't just throw the exception.

81 new passes on test262. :^)
2023-06-27 00:21:52 +02:00
Andreas Kling 57404bae1f LibGfx: Return early from Painter::draw_line() if clip rect is empty 2023-06-26 20:28:42 +02:00
Nico Weber 3dd6638177 ICC: Strip trailing nul characters from MultiLocalizedUnicodeTagData
Having those trailing nuls is invalid per spec, but it happens in
practice (in already checked-in test files, no less).
2023-06-26 19:24:34 +01:00
Tim Ledbetter dedbc17160 cut: Add -s option to suppress lines without field delimiters
If this option is not specified, lines that contain to field
delimiters will be printed unmodified.
2023-06-26 19:49:34 +02:00
Tim Ledbetter e740489abd cut: Ignore trailing newline if present 2023-06-26 19:49:34 +02:00
Tim Ledbetter da67d593d8 cut: Treat a range containing consecutive commas or dashes as invalid 2023-06-26 19:49:34 +02:00
Tim Ledbetter bc56d71252 cut: Print the entire line if it contains no field delimiters 2023-06-26 19:49:34 +02:00
Tim Ledbetter 230a873e0e cut: Don't ignore empty fields 2023-06-26 19:49:34 +02:00
Tim Ledbetter b17aa47769 usermod: Add -a and -r options to append or remove extra groups 2023-06-26 19:31:09 +02:00
Tim Ledbetter caf55c0b2d usermod: Add -G option to modify supplementary groups 2023-06-26 19:31:09 +02:00
Tim Ledbetter d7fccfc237 usermod: Allow group name or number to be used with the -g option 2023-06-26 19:31:09 +02:00
Tim Ledbetter 99f763cab3 usermod: Simplify uid validation 2023-06-26 19:31:09 +02:00
Tim Ledbetter e86dd1cc89 usermod: Return error if -L and -U options are used simultaneously 2023-06-26 19:31:09 +02:00
Tim Ledbetter 089ff7b94e LibCore: Enable modification of a user's supplementary groups 2023-06-26 19:31:09 +02:00
Tim Ledbetter ba34931620 strings: Don't bail immediately on error
Previously, strings would exit immediately if there was an error
changing file ownership. We now print an error to stderr and
continue when an error occurs.
2023-06-26 19:28:42 +02:00
Tim Ledbetter c723101728 strings: Add -o option as an alias for -t o 2023-06-26 19:28:42 +02:00
Tim Ledbetter a2fb0768ff strings: Add commonly used long option names for -n and -t 2023-06-26 19:28:42 +02:00
Tim Ledbetter ab1e8a7b91 strings: Replace the -p option with the more commonly used -f
Previously, the `-p` option printed the path of the file being
processed before any strings for that file. The `-f` prints the file
path before each string . This matches the behavior of strings on
Linux and FreeBSD.
2023-06-26 19:28:42 +02:00
Tim Ledbetter 6aa87e2119 env: Add -u option to unset environment variables 2023-06-26 19:27:45 +02:00
Tim Ledbetter b9e7998b53 LibC: Return EINVAL from unsetenv() if input is empty or contains "=" 2023-06-26 19:27:45 +02:00
Shannon Booth d3a27eeaf2 LibDiff: Port Diff::Hunk from DeprecatedString to String
Removing the last instance of DeprecatedString in this library! :^)
2023-06-26 19:26:34 +02:00
Shannon Booth 9dc92f19b8 LibDiff: Port Diff::parse_hunks from DeprecatedString to StringView 2023-06-26 19:26:34 +02:00
Shannon Booth c60150da15 HackStudio: Use StringView in DiffViewer::draw_line 2023-06-26 19:26:34 +02:00
Shannon Booth ee92378b80 LibDiff: Make Diff::from_text fallible 2023-06-26 19:26:34 +02:00
Shannon Booth 23df5748f6 LibDiff: Make Diff::parse_hunks fallible
Currently the only error that can happen is an OOM. However, in the
future there may be other errors that this function may throw, such as
detecting an invalid patch.
2023-06-26 19:26:34 +02:00
Shannon Booth dbd838efdf LibDiff: Replace DeprecatedString with StringView in parse_hunk_location 2023-06-26 19:26:34 +02:00
Shannon Booth 84e8ff34a2 diff: Use StringView instead of DeprecatedString 2023-06-26 19:26:34 +02:00
Tim Ledbetter 96fecc434c chgrp: Add support for multiple file paths 2023-06-26 19:26:20 +02:00
Andi Gallo 8afe5ce718 LibWeb: Fix min-content initialization for row measures
This ensures that min-content contributions from cells with no content
are computed using their calculated values, which are never considered
for min-content before then. The specification diverges from column
measures algorithm, which doesn't use specified width of cells anywhere.
2023-06-26 19:25:34 +02:00
Daniel Bertalan 5aef8f280f LibJS: Fix integer overflow in Number::exponentiate
The exponent might be larger than the range of values representable by
an i32, so we have to use the `fmod` function instead of the modulo
operator.

This fixes 3 test262 tests on AArch64. No changes on x86-64.
2023-06-26 19:25:12 +02:00
Andreas Kling 56fb5a3f5d LibJS/Bytecode: Ensure iterator is closed after array destructuring
If destructuring didn't exhaust the iterator, we have to manually close
the iterator.

49 new passes on test262. :^)
2023-06-26 19:18:06 +02:00
Andreas Kling 55531e5cda LibJS/Bytecode: Use LHS identifier as function name on logical assign
This now creates a function named `x`:

    x ||= function() { }

9 new passes on test262. :^)
2023-06-26 16:07:33 +02:00
Andreas Kling 17ba47558c LibWeb: Make a copy of Document's DocumentObserver set when iterating
The observer callbacks can do all kinds of things, so let's not be in
the middle of iterating the set in case someone decides to mutate it.

Fixes a crash when loading https://lichess.org/
2023-06-26 12:10:33 +02:00
Timothy Flynn 6fb670c1c2 LibJS: Implement Iterator.prototype.find 2023-06-26 10:39:07 +02:00
Timothy Flynn 1f05b0638f LibJS: Implement Iterator.prototype.every 2023-06-26 10:39:07 +02:00
Timothy Flynn 6ac1d5afae LibJS: Implement Iterator.prototype.some 2023-06-26 10:39:07 +02:00
Timothy Flynn 134bb44ca0 LibJS: Implement Iterator.prototype.forEach 2023-06-26 10:39:07 +02:00
Timothy Flynn 35380b2aef LibJS: Implement Iterator.prototype.toArray 2023-06-26 10:39:07 +02:00
Timothy Flynn acc05480e8 LibJS: Implement Iterator.prototype.reduce 2023-06-26 10:39:07 +02:00
Timothy Flynn ad42b4ea67 LibJS: Implement Iterator.prototype.flatMap
This prototype is a bit tricky in that we need to maintain the iteration
state of the mapped iterator's inner iterator as we return values to the
caller. To do this, we create a FlatMapIterator helper to perform the
steps that apply to the current iteration state.
2023-06-26 10:39:07 +02:00
Timothy Flynn 67028ee3a3 LibJS: Implement Iterator.prototype.drop 2023-06-26 10:39:07 +02:00
Timothy Flynn 0e2f9f006d LibJS: Implement Iterator.prototype.take 2023-06-26 10:39:07 +02:00
Timothy Flynn 7e0083fb65 LibJS: Rename ErrorType::IntlNumberIsNaN to ErrorType::NumberIsNaN
It will be used outside of the Intl namespace, so give it a less overly
specific name.
2023-06-26 10:39:07 +02:00
Timothy Flynn deeee65e37 LibJS: Implement Iterator.prototype.filter 2023-06-26 10:39:07 +02:00
Timothy Flynn 3eb2e4e08a LibJS: Implement Iterator.prototype.map
This uses a new Iterator type called IteratorHelper. This does not
implement IteratorHelper.prototype.return as that relies on generator
objects (i.e. the internal slots of JS::GeneratorObject), which are not
hooked up here.
2023-06-26 10:39:07 +02:00
Timothy Flynn 7ff6b472c0 LibJS: Implement Iterator.prototype [ @@toStringTag ] 2023-06-26 10:39:07 +02:00
Timothy Flynn d9d245faa7 LibJS: Implement Iterator.from and the WrapForValidIteratorPrototype
Iterator.from creates an Iterator from either an existing iterator or
an iterator-like object. In the latter case, it sets the prototype of
the returned iterator to WrapForValidIteratorPrototype to wrap around
the iterator-like object's iteration methods.
2023-06-26 10:39:07 +02:00
Timothy Flynn 5736b53013 LibJS: Add an Iterator constructor and object
The Iterator object cannot be constructed directly but can be subclassed
or created with `Iterator.from` (not implemented here).
2023-06-26 10:39:07 +02:00
Timothy Flynn 428109e709 LibJS: Forward declare IteratorRecord and remove inclusion from VM.h
This drastically reduces the amount of compilation required when
Iterator.h is changed.
2023-06-26 10:39:07 +02:00
Timothy Flynn 4977000fa0 LibJS: Rename JS::Iterator to JS::IteratorRecord
This is in preparation for an upcoming implementation of the Iterator
Helpers proposal. That proposal will require a JS::Object type named
"Iterator", so this rename is to avoid conflicts.
2023-06-26 10:39:07 +02:00
Luke Wilde c5f3b3ae02 LibJS/Bytecode: Return the proper result for iteration statements 2023-06-26 04:58:27 +02:00
Luke Wilde b162c9117e LibJS/Bytecode: Set accumulator to undefined at start of catch blocks
Otherwise we leak the error value through to the result.
2023-06-26 04:58:27 +02:00
Zaggy1024 1789905d4a LibVideo/PlaybackManager: Don't crash when demuxer seek throws an error
`seek_demuxer_to_most_recent_keyframe()` wasn't correctly returning in
cases where an error was thrown by the demuxer. To avoid this, the
function now returns the error, and the playback state handler must act
on it instead, allowing it to exit the seeking state early.
2023-06-25 20:35:37 -04:00
Zaggy1024 cf1cb04af0 LibVideo/Matroska: Don't choke on files containing CRC32 elements
The EBML specification allows for CRC32 elements to be placed as the
first child element of a master element. However, our parsing of master
elements didn't take that into account, so an error would be thrown.

Instead of erroring out, the `parse_master_element()` function will now
skip CRC32 elements that are found as the first child of a master
element. If it is found after the first child, that will be considered
an error.

Void elements will also be skipped by `parse_master_element()`.

Since the `parse_cluster()` function has to seek the stream back to the
cluster's first child in order to allow cues' positions to be used
correctly, `parse_master_element()` had to be changed to return the
first element position, since the callback is not invoked for CRC32
elements. This means that the parameter used to communicate the element
position to the child element parsing function is unused, so that is
removed.
2023-06-25 20:27:02 -04:00
Andreas Kling a4a1d1b84a LibJS/Bytecode: Transfer object expression property names to functions
2 new passes on test262. :^)
2023-06-25 20:39:29 +02:00
Andreas Kling ad15a1e3e2 LibJS/Bytecode: Don't assert on eval() without arguments
3 new passes on test262. :^)
2023-06-25 19:41:53 +02:00
Andreas Kling ceb5199225 LibJS/Bytecode: Don't clobber accumulator in Put/Delete instructions
The fact that side effects clobbers the accumulator isn't just annoying
inside the instruction handler, but also really counter-intuitive in
the bytecode program itself.

17 new passes on test262. :^)
2023-06-25 19:14:30 +02:00
Andreas Kling 8450948458 LibJS: Make class definition evaluation work in bytecode mode
Instead of assuming that there's an active AST interpreter, this code
now takes VM& everywhere and invokes the appropriate interpreter.

92 new passes on test262. :^)
2023-06-25 18:28:44 +02:00
Andreas Kling 66936a0d61 LibJS/Bytecode: Fix non-string keys not being excluded in rest object
By converting the excluded names to PropertyKey before filtering, we
ensure that non-string keys get excluded as needed.

14 new passes on test262. :^)
2023-06-25 18:02:37 +02:00
Andreas Kling 6f0952c358 LibJS/Bytecode: Handle object destructuring to member expression
19 new passes on test262. :^)
2023-06-25 17:00:29 +02:00
Hendiadyoin1 7005a91a1e LibJS: Replace invalid escapes in TemplateLiterals with undefined in BC
Also adds a big FIXME, to outline what is still wrong
2023-06-25 16:41:50 +02:00
Andi Gallo 3a0f7e8eb8 LibWeb: Adjust specified table height
Subtract borders and padding from specified height before comparing to
the used content height.
2023-06-25 15:08:42 +02:00
Andreas Kling 77f1e91e9d LibJS: Make $262.evalScript() work in bytecode mode
29 new passes on test262. :^)
2023-06-25 13:13:19 +02:00
Andreas Kling 1932f7e6b6 LibJS/Bytecode: Transfer binding pattern aliases to function names
60 new passes on test262. :^)
2023-06-25 11:59:51 +02:00
Shannon Booth 55d59636ef LibWeb: Implement Web::URL::url_encode closer to spec 2023-06-25 11:28:32 +02:00
Shannon Booth 799c79cc5a LibWeb: Simplify logic in Web::URL::URLSearchParams::sort 2023-06-25 11:28:32 +02:00
Shannon Booth e99c0ddb0e LibWeb: Add spec link for Web::URL::url_decode 2023-06-25 11:28:32 +02:00
Kenneth Myhra c445bd3a0c LibWeb: Move WebSocket constructor steps closer to spec 2023-06-25 11:28:18 +02:00
FalseHonesty 110eeb8591 LibWeb: Support calc(...) in box-shadow's values of type Length
The CSS box-shadow property takes 2-4 properties that are `<length>`s,
those being:
  - offset-x
  - offset-y
  - blur-radius
  - spread-radius

Previously these were resolved directly to concrete Lengths at parse
time, but now they will be parsed as LengthStyleValues and/or
CalculatedStyleValues and be stored that way until styles are later
resolved.
2023-06-25 10:27:08 +01:00
Andreas Kling 8873bf5016 LibJS/Bytecode: Use ToString instead of generic add() in ConcatString
This avoids invoking valueOf() on the values, which is observable.

48 new passes on test262. :^)
2023-06-25 11:20:05 +02:00
Andreas Kling 8021048bc9 LibJS/Bytecode: Throw on destructuring object assignment to nullish LHS
24 new passes on test262. :^)
2023-06-25 09:19:53 +02:00
Andi Gallo 8b34af816e LibWeb: Report border box width for tables in a block
For the containing block, table borders are opaque and have to be
accounted when computing the table width since they use available space.
2023-06-25 08:13:04 +02:00
Andi Gallo 2c4908094c LibWeb: Don't subtract border from used table width
The used width is already a content width, which doesn't include
borders. Border widths should be subtracted from the specified width
instead, since that initially specifies the total width including
borders, for consistent comparison. Also handle table box padding as an
additional fix.
2023-06-25 08:13:04 +02:00
Andreas Kling 1f95a40780 LibJS/Bytecode: Actually exit switch statement's lexical scope
95 new passes on test262. :^)
2023-06-25 08:09:39 +02:00
Lucas CHOLLET cc1bd2d2d9 LibGfx/JPEG: Use a look-up table for cosine values
This solution is a middle ground between re-computing `cos` every time
and a much more mathematically complicated approach (as we have in the
decoder).

While still being far from optimal it already gives us a 10x
improvement, not that bad :^)

Co-authored-by: Tim Flynn <trflynn89@pm.me>
2023-06-25 00:22:21 +02:00
kleines Filmröllchen e0dce41ddf AudioServer: Add a hack to make audio "just work" on HDA for now
This should be fixed properly, but we have decided that a quick hack is
fine so that audio "just works" for most people.
2023-06-25 00:16:44 +02:00
kleines Filmröllchen 03fac609ee AudioServer+Userland: Separate audio IPC into normal client and manager
This is a sensible separation of concerns that mirrors the WindowServer
IPC split. On the one hand, there is the "normal" audio interface, used
for clients that play audio, which is the primary service of
AudioServer. On the other hand, there is the management interface,
which, like the WindowManager endpoint, provides higher-level control
over clients and the server itself.

The reasoning for this split are manifold, as mentioned we are mirroring
the WindowServer split. Another indication to the sensibility of the
split is that no single audio client used the APIs of both interfaces.
Also, useless audio queues are no longer created for managing clients
(since those don't even exist, just like there's no window backing
bitmap for window managing clients), eliminating any bugs that may occur
there as they have in the past.

Implementation-wise, we just move all the APIs and implementations from
the old AudioServer into the AudioManagerServer (and respective clients,
of course). There is one point of duplication, namely the hardware
sample rate. This will be fixed in combination with per-client sample
rate, eliminating client-side resampling and the related update bugs.
For now, we keep one legacy API to simplify the transition.

The new AudioManagerServer also gains a hardware sample rate change
callback to have exact symmetry on the main server parameters (getter,
setter, and callback).
2023-06-25 00:16:44 +02:00
Valtteri Koskivuori c3f5b514c8 WindowServer: Yank out window frame opacity
This facility was added in 15a1d9a, but isn't being used for anything.
It wasn't even hooked up to LibGUI for applications to use.
Relevant use-cases, such as the most prominent one in `AnalogClock`, use
`GUI::Window::set_frameless()` instead.
2023-06-24 23:45:27 +02:00
Valtteri Koskivuori 6931a5a0a8 WindowServer+LibGUI: Yank out window-global opacity
From what I can tell, this facility was added to WSWindow/GWindow in
2019 in 9b71307. I only found a single place in the codebase still using
this facility: `WindowServer::Menu::start_activation_animation()`. A
subtle fade-out animation that happens when a menu item is selected, and
the menu disappears.
I think our compositing facilities have improved enough to make this
facility redundant. The remaining use mentioned above was ported to just
directly blit the fade-out animation instead of requesting it from
WindowServer.
2023-06-24 23:45:27 +02:00
Andreas Kling 4fd71e3c3a LibJS/Bytecode: Support destructuring in try..catch
112 new passes in test262.
2023-06-24 21:10:07 +02:00
MacDue 3d755a57b6 LibGfx: Ensure last subpath is closed by Path::close_all_subpaths() 2023-06-24 19:31:30 +02:00
MacDue 6b40271b95 LibWeb: Close all subpaths when filling SVG paths 2023-06-24 19:31:30 +02:00
Shannon Booth f2881f4662 headless-browser: Use Diff::write_normal to output hunks
Saving a bunch of code :^)

The "Hunk:" text is preserved as there is no real need for the browser
test harness to be producing valid patch files.
2023-06-24 18:34:08 +02:00
Shannon Booth 2b56aefaed diff: Use Diff::write_normal to output hunks
Saving a bunch of code :^)
2023-06-24 18:34:08 +02:00
Shannon Booth 7afff80e71 LibDiff: Add Diff::write_normal for outputting normal hunks
In order to extract duplicated code between browser and the diff
utility.
2023-06-24 18:34:08 +02:00
Shannon Booth 312de21498 diff: Remove "Hunk:" text from output
While this is a useful piece of information it means that diff is
producing hunks that are not of a valid normal diff format. This breaks
the ability to redirect the output of diff to a file to generate a
patch.
2023-06-24 18:34:08 +02:00
Aliaksandr Kalenik 331f6a9e60 LibJS: Invalidate cached environment coordinate after delete in global
Fixes the bug in interpreter when cached environment coordinate is not
invalidated after `delete` operator usage on global `this`.
2023-06-24 18:33:44 +02:00
Andreas Kling 06ac768c8b LibJS/Bytecode: Add some basic codegen for ExportStatement
This is by no means complete, but at least a bunch of test-js and
test262 tests start working. :^)
2023-06-24 17:13:30 +02:00
Andreas Kling 5d79431859 LibJS/Bytecode: Actually generate & run bytecode for SourceTextModule 2023-06-24 17:13:30 +02:00
Andreas Kling 8a5e71256d LibJS/Bytecode: Add codegen for ImportCall
Also moved most of the AST ImportCall::execute() into a helper so we can
share the code.
2023-06-24 17:13:30 +02:00
Andreas Kling eb9298b54e LibJS/Bytecode: Support destructuring function parameters
To reduce code duplication, I've added new VM::execute_ast_node()
helper that handles bytecode compilation if needed.

918 new passes on test262. :^)
2023-06-24 08:38:54 +02:00
Andreas Kling b3a3c53007 LibJS: Fix bad indentation when dumping FunctionNode AST nodes 2023-06-24 08:38:54 +02:00
Zaggy1024 c760713650 LibWeb: Prioritize video duration when loading video element media
Previously, an audio loader could succeed for an HTMLVideoElement that
contains a video file, which caused the duration to be set to the bogus
duration of the audio loader instead of the correct duration from the
video container. Instead of setting the duration based on audio always,
set it to the video duration if we are creating a video element.
2023-06-24 06:20:06 +02:00
Xexxa e3a0f84ffb Browser: Change "Same Origin" to "Same-Origin" 2023-06-24 06:19:39 +02:00
Luke Wilde 95d619943e LibJS/Bytecode: Support private identifiers in optional chaining
Fixes 4 test262 tests :^)
2023-06-23 21:05:18 +02:00
Timothy Flynn 8b668da9d5 LibRegex: Bail parsing class set characters upon early EOF
Otherwise, we reach a skip() invocation at the end of this function,
which crashes due to EOF. Caught by test262.
2023-06-23 20:22:45 +02:00
Timothy Flynn 32502fceed LibJS: Update spec numbers/steps for RegExp unicode sets flag proposal
This proposal has been merged into the main ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/26b2369
2023-06-23 20:22:45 +02:00
Timothy Flynn 9407e05a3c LibJS: Update RegExp spec numbers to match re-ordering within the spec
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/abee2e6
https://github.com/tc39/ecma262/commit/77256bf
2023-06-23 20:22:45 +02:00
Andreas Kling 99b23fe2ad LibJS/Bytecode: Emit GetPrivateById for private member expressions
This makes it possible to call private member functions.

347 new passes on test262. :^)
2023-06-23 17:51:04 +02:00
Aliaksandr Kalenik 934cb601c2 LibWeb: Implement "destroy the child navigable" on navigable containers
Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-06-23 17:24:32 +02:00
Andi Gallo 55f1a70577 LibWeb: Fix style updates for table box nodes
On style update, we have to preserve the invariant established when we
built the layout tree - some properties are applied to the table wrapper
and the table box values are reset to their initial values.

This also ensures that the containing block of a table box is always a
table wrapper, which isn't the case if we set absolute position on the
box instead of the wrapper.

Fixes #19452.
2023-06-23 16:40:19 +02:00
Andi Gallo e28578363a LibWeb: Get initial values for table box from CSS::InitialValues 2023-06-23 16:40:19 +02:00
Andreas Kling 406e3ed849 LibWeb: Implement getting the container document of a navigable
Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2023-06-23 16:20:29 +02:00
Aliaksandr Kalenik d85bdd3ac5 LibWeb: Add API for finding NavigableContainer by content navigable
This is only needed because currently spec doesn't explicitly define
that navigable should have a pointer to associated container and when
this pointer should be set.
2023-06-23 16:20:29 +02:00
Andreas Kling 85a3a1c085 LibJS/Bytecode: Add codegen for "named evaluation if anonymous function"
This gives anonymous functions the name from the LHS they are being
assigned to.

171 new passes on test262. :^)
2023-06-23 16:09:33 +02:00
Shannon Booth a975fca42e LibWeb: Implement size attribute of ByteLengthQueuingStrategy
Co-authored-by: Matthew Olsson <mattco@serenityos.org>
2023-06-23 13:27:29 +02:00
Shannon Booth 49689e5d8e LibWeb: Implement size attribute of CountQueuingStrategy
Co-authored-by: Matthew Olsson <mattco@serenityos.org>
2023-06-23 13:27:29 +02:00
Shannon Booth 6d93692bc5 LibWeb: Add IDL definition for 'Function'
This is used in ByteLengthQueuingStrategy and CountQueuingStrategy
in the Streams spec.
2023-06-23 13:27:29 +02:00
Shannon Booth 4f217947b3 LibWeb: Implement QueuingStrategy for Web::Streams::ReadableStream 2023-06-23 13:27:29 +02:00
Andreas Kling e5c7d8407b LibJS/Bytecode: Support private class fields
This is accomplished with two new instructions:
- GetPrivateById
- PutPrivateById

Looks like 1616 new passes on test262. :^)
2023-06-23 08:53:10 +02:00
Andreas Kling 467ea86179 LibJS: Use bytecode for generator function default parameters
Otherwise there's a mismatch between which interpreter we use.
This fixes a regression in the AST interpreter score on test262.
2023-06-23 08:09:50 +02:00