Commit Graph

19240 Commits

Author SHA1 Message Date
Linus Groh
08373090ae LibJS: Add VM::on_call_stack_emptied callback
Instead of having to run queued promise jobs in LibWeb in various
places, this allows us to consolidate that into one function - this is
very close to how the spec describes it as well ("at some future point
in time, when there is no running execution context and the execution
context stack is empty, the implementation must [...]").

Eventually this will also be used to log unhandled exceptions, and
possibly other actions that require JS execution to have ended.
2021-04-24 20:11:04 +02:00
Linus Groh
97d49cb92b LibJS: Consolidate exception function names and source ranges
Instead of storing the function names (in a badly named Vector<String>)
and source ranges separately, consolidate them into a new struct:
TracebackFrame. This makes it both easier to use now and easier to
extend in the future.
Unlike before we now keep each call frame's current node source range
in the traceback frame next to the function name, meaning we can display
line and column numbers outside of the VM and after the call stack is
emptied.
2021-04-24 20:11:04 +02:00
Linus Groh
0cf04d07aa LibJS: Temporarily clear exception in Object::get_without_side_effects()
This would return an empty value once it hits an exception check
otherwise. Considering that this mostly is used in situations where we
already *do* have an exception (traceback printing, for example), let's
make this easier for ourselves to use.
2021-04-24 20:11:04 +02:00
Linus Groh
5caab0148c LibJS: Add TemporaryClearException helper class
This is very similar to AK::TemporaryChange (and in fact replaces one
use of it), but since we can't directly set VM's m_exception from
outside of the VM, we need something more sophisticated.
Sometimes we need to temporarily remove the stored exception for some
other operation to succeed (e.g. anything that uses call(), as well as
get_without_side_effects()) and later restore it - the boilerplate code
required for this is annoying enough to justify a helper.
2021-04-24 20:11:04 +02:00
Andreas Kling
3a4d42bbbb LibJS: Remove stray '%' from MemberExpression AST dump 2021-04-24 18:50:12 +02:00
Andreas Kling
8ebb9d350c LibGUI: Remove some unused cruft from GUI::IconView 2021-04-24 18:50:12 +02:00
Albert S
89a9d8f45c LaunchServer: Fix argument order to FileManager
Correct the order we pass the arguments to the FileManager so
opening file:// URLs works.

The path is a positional argument that was passed after the flags.
We need to make sure the flags are passed before positional arguments.
2021-04-24 17:55:04 +02:00
Mart G
157cd7c819 LibGUI: Prevent a Painter's clip_rect from being outside of its target
Previously a Painter's m_clip_origin field was initialized to a
widget's window_relative_rect, which is not ensured to be within
the target rect.
m_clip_origin is normally not used for clipping, but after calling
clear_clip_rect the clip rect that IS used for clipping gets reset
to m_clip_origin (so an invalid state is entered).
Now the window_relative_rect will be clipped by the target rect
first, and will only then be used to initialize both the active
clip_rect and m_clip_origin.
2021-04-24 15:57:20 +02:00
Linus Groh
0754280214 Meta: Add Tim Flynn to the contributors list :^) 2021-04-24 14:34:18 +02:00
Timothy Flynn
1500479a1d LibSQL: Parse ALTER TABLE statement
There are 4 forms an ALTER TABLE statement can take, and each are very
distinct, so they each get their own AST node class.
2021-04-24 14:22:08 +02:00
Timothy Flynn
0764a68616 LibSQL: Parse UPDATE statement
This also migrates parsing of conflict resolution to a helper method,
since both INSERT and UPDATE need it.
2021-04-24 14:22:08 +02:00
Timothy Flynn
8d79b4a3e1 LibSQL: Parse INSERT statement
This also adds missing '&' on a couple AST getter methods.
2021-04-24 14:22:08 +02:00
Timothy Flynn
35f0450dd8 LibSQL: Add missing forward declarations 2021-04-24 14:22:08 +02:00
Brendan Coles
0252563a4e Utilities: Add cksum 2021-04-24 11:53:55 +02:00
Brendan Coles
e0188d27de Utilities: Add pathchk 2021-04-24 11:48:57 +02:00
Brendan Coles
ac98dc4f7c AudioServer: Mixer: limit max volume to 200% 2021-04-24 01:30:10 +02:00
Jelle Raaijmakers
2a0f92ef1f Ports/scummvm: Add launcher 2021-04-24 00:17:47 +02:00
Gunnar Beutner
f74b8a2d1f LibELF: Avoid calculating symbol hashes when we don't need them 2021-04-23 23:35:36 +02:00
Hendiadyoin1
39d34fb1f1 UE: Implement FLD_RM80 and FSTP_RM80
We do a bit too big reads and writes, but this should not be that bad
although it may taint memory graphs
2021-04-23 22:50:53 +02:00
Hendiadyoin1
f1957bb86b UE+LibX86: Support bigger reads and writes 2021-04-23 22:50:53 +02:00
Hendiadyoin1
a99812633b LibX86: Add basic u128 and u256 constainers
These support all bitwise operations
2021-04-23 22:50:53 +02:00
Timothy Flynn
fa59d02692 LibSQL: Parse IN / NOT IN expressions with a nested SELECT statement 2021-04-23 22:36:07 +02:00
Timothy Flynn
004025c3c4 LibSQL: Parse common-table-expressions with a nested SELECT statement
This also moves testing of common-table-expression to its own test case.
2021-04-23 22:36:07 +02:00
Timothy Flynn
cb943a2179 LibSQL: Parse CREATE TABLE statements with a nested SELECT statement 2021-04-23 22:36:07 +02:00
Timothy Flynn
99b38aa3fa LibSQL: Parse EXISTS expressions
The EXISTS expression is a bit of an odd-man-out because it can appear
as any of the following forms:

    EXISTS (select-stmt)
    NOT EXISTS (select-stmt)
    (select-stmt)

Which makes it the only keyword expression that doesn't require its
keyword to actually be used. The consequence is that we might come
across an EXISTS expression while parsing another expression type;
NOT would have triggered a unary operator expression, and an opening
parentheses would have triggered an expression chain.
2021-04-23 22:36:07 +02:00
Timothy Flynn
e62e76ca1a LibSQL: Parse terminating semi-colon in top-level statement parser
Currently, every parse_*_statement method ends by parsing a semi-colon.
This will prevent nested statements, e.g. a SELECT statement may be
nested in a CREATE TABLE statement. Move the semi-colon expectation up
and out of the individual statement parsers.
2021-04-23 22:36:07 +02:00
Timothy Flynn
27685bc799 LibSQL: Add Parser::parse_schema_and_table_name helper
Another common semantic is parsing an identifier of the form
"schema_name.table_name" / "table_name". Add a helper to do this work.

This helper does not parse any optional alias after the table name.
some syntaxes specify an alias using the AS keyword, some let the AS
keyword be optional, and others just parse it as an identifier. So
callers to this helper will just continue parsing the alias however
they require.
2021-04-23 22:36:07 +02:00
Timothy Flynn
418884ab64 LibSQL: Add Parser::parse_comma_separated_list helper
A quite common semantic emerged for parsing comma-separated expressions:

    consume(TokenType::ParenOpen);

    do {
        // do something

        if (!match(TokenType::Comma))
            break;

        consume(TokenType::Comma);
    } while (!match(TokenType::Eof));

    consume(TokenType::ParenClose);

Add a helper to do the bulk of the while loop.
2021-04-23 22:36:07 +02:00
Timothy Flynn
6a69b8efa7 LibSQL: Fix handling of optional AS keywords
In some syntaxes, using the 'AS' keyword to define an alias is optional.
But if it does appear, an identifier better appear afterwards.
2021-04-23 22:36:07 +02:00
kleines Filmröllchen
c1345bda3e Userland: Piano: Optimize repaints
The Piano application used to perform very poorly due to unnecessary
draw calls. This is solved with two optimziations:

1. Don't draw the widgets as often as possible. The widgets are instead
   at least updated every 150ms, except for other events.
2. Don't re-draw the entire piano roll sheet. The piano roll background,
   excluding in-motion objects (notes, the play cursor), is only re-drawn
   when its "viewport" changes.

A minor drawback of this change is that notes will appear on top of the
pitch labels if placed at the left edge of the roll. This is IMO
acceptable or may be changed by moving the text to the "foreground".
2021-04-23 22:35:49 +02:00
Gunnar Beutner
511ffa8d68 Meta: Support using rsync to install the root filesystem
Using rsync is significantly faster when we're using an existing
image because we only have to copy files which are new or have
been updated. This cuts down the image creation time to about
a second or two assuming an old image exists.
2021-04-23 22:34:05 +02:00
Gunnar Beutner
479905be6c Meta: Re-use existing disk image where possible
This adds support for re-using and re-sizing existing disk images.
Disk images are checked with e2fsck prior to re-use and a new disk
image is automatically created when that check fails.
2021-04-23 22:34:05 +02:00
Linus Groh
a4c1860bfc LibRegex: Put to dbgln()s behind REGEX_DEBUG 2021-04-23 20:52:12 +02:00
Linus Groh
0053816e9d LibJS: Correctly handle mixing +0 and -0 in Math.{min,max}()
The native C++ < and > operators won't handle this correctly, so the
result was different depending on the order of arguments. This is now
fixed by explicitly checking for positive and negative zero values.

Fixes #6589.
2021-04-23 20:51:48 +02:00
Linus Groh
883e8683b2 LibJS/Tests: Remove fileName and lineNumber args from ExpectationError
This is nono-standard, not supported by our Error implementation and not
even used anywhere, so let's just remove it.
2021-04-23 20:30:52 +02:00
Linus Groh
d400be05ec LibJS/Tests: Improve expectation error details 2021-04-23 20:30:52 +02:00
Ali Mohammad Pur
0d2602c900 Shell: Add a 'kill' builtin that wraps the system's own
Fixes #6578.
2021-04-23 20:27:58 +02:00
Ali Mohammad Pur
95055d3a38 Shell: Add support for jobspecs in fg/bg/disown/wait 2021-04-23 20:27:58 +02:00
Gunnar Beutner
ede0d7c04f Ports: Add launcher for OpenTTD 2021-04-23 20:15:49 +02:00
Gunnar Beutner
ae32abffe9 Ports: Add openttd 2021-04-23 20:15:49 +02:00
Linus Groh
4b33365078 Help: Run clang-format on main.cpp 2021-04-23 18:47:42 +02:00
Andreas Kling
935be7f297 SystemMonitor: Show action status tips in the statusbar :^) 2021-04-23 17:25:33 +02:00
Andreas Kling
caa39eee6f Help: Add a statusbar and use it for hovered links + action status tips 2021-04-23 17:19:17 +02:00
Andreas Kling
b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Gunnar Beutner
b3db01e20e Ports: Detect more types of errors in the AvailablePorts.md file
This adds support for detecting incorrect version numbers and links
in the ports list.

Also, unlike before it doesn't parse the package.sh script but executes
it instead which allows us to detect syntax errors.
2021-04-23 16:11:48 +02:00
Gunnar Beutner
fb67e99562 Ports: Fix version numbers for some of the ports 2021-04-23 16:11:48 +02:00
Andreas Kling
f7a33043e0 LibWeb: Don't assume name is string in HTMLCollectionWrapper::get()
If the property name is not a string (symbol or integer), we should
just defer to the base class instead of trying to handle it.

Fixes #6575.
2021-04-23 15:45:54 +02:00
Maciej Zygmanowski
6efcc2fc99 Kernel: Don't allow to kill kernel processes
The protection was only for SIGKILL before.
2021-04-23 13:26:02 +02:00
Brian Gianforcaro
072c264a04 Utilities: Fix the --list-syscalls option to syscall(1)
The 'syscall-arguments' positional arg being required was
breaking the scenario where the user just passes the
'--list-syscalls' argument.

Instead, make the argument not required, and manually handle
the error path our selves.

Closes: #6574
2021-04-23 13:24:39 +02:00
Idan Horowitz
161fd1c153 Meta: Add basic commit message linting for pull requests
This new check will ensure that all commit message lines are at most 72
characters long, as well as ensure the commit title conforms to the
"Category: Brief description of what's being changed" format.
2021-04-23 13:20:12 +02:00