Commit graph

22202 commits

Author SHA1 Message Date
Liav A
b91df26d4a Kernel/Interrupts: Return boolean on whether we handled the interrupt
If we are in a shared interrupt handler, the called handlers might
indicate it was not their interrupt, so we should not increment the
call counter of these handlers.
2021-06-17 16:53:25 +02:00
Liav A
7a6d5a7b8b Kernel/VirtIO: Indicate we handling unknown interrupt early when called 2021-06-17 16:53:25 +02:00
Liav A
c802b1a363 Kernel/Interrupts: Add sensible purposes to VirtIO and USB devices
When we enumerate the interrupt handlers, it's a good idea to show a
meaningful name to the user instead of "IRQ Handler".
2021-06-17 16:53:25 +02:00
Liav A
030999d269 Kernel/Interrupts: Enumerate nested handlers in a shared handler
When asked to enumerate all interrupt handlers, display all shared
handlers within it instead of just returning the responsible handler of
them.
2021-06-17 16:53:25 +02:00
Idan Horowitz
dcb55db99b LibJS: Replace boolean without_side_effects parameters with an enum 2021-06-17 16:52:15 +02:00
Idan Horowitz
864beb0bd5 LibJS: Remove the unused IndexedProperties::append_all method 2021-06-17 16:52:15 +02:00
stelar7
22851287b1 Spreadsheet: Pledge 'fattr' to avoid crashing after exporting as csv 2021-06-17 18:49:44 +04:30
Ali Mohammad Pur
ac6a3d068d AK: Add some tests for hexdump formatting 2021-06-17 18:44:00 +04:30
Ali Mohammad Pur
2fe9c81b30 Everywhere: Replace the multiple impls of print_buffer() with :hex-dump 2021-06-17 18:44:00 +04:30
Ali Mohammad Pur
7eda164c25 AK: Add a :hex-dump mode to AK::Format
This will just hexdump the given value.
Note that not all formatters respect this, the ones that do are:
- (Readonly)Bytes: formatter added in this commit
- StringView / char const*
- integral types
2021-06-17 18:44:00 +04:30
sin-ack
10f56166e5 LibJS: Cast to i64 for is_integral_number
This fixes the built-ins/Number/isInteger/integers.js test.
9007199254740991 is still an integer, though not a safe one.
2021-06-17 13:44:01 +01:00
Idan Horowitz
a85a95fe8d LibJS: Stop overwriting existing accessors in Object::define_property 2021-06-17 13:20:18 +01:00
Idan Horowitz
1cf5663e38 LibJS: Add the Object.prototype.__lookup{Getter, Setter}__ methods
These are a part of the Annex B extension of the specification.
2021-06-17 13:20:18 +01:00
Idan Horowitz
f98c0ca528 LibJS: Add the Object.prototype.__define{Getter, Setter}__ methods
These are a part of the Annex B extension of the specification.
2021-06-17 13:20:18 +01:00
Idan Horowitz
37340aa599 LibJS: Add the Object.prototype.__proto__ native accessor property
This is part of the Annex B extension of the specification.
2021-06-17 13:20:18 +01:00
Linus Groh
d1c109be96 LibJS: Fix .length attributes of various native functions
Namely the Proxy revocation, Promise resolving, Promise then/catch
finally, and Promise GetCapabilitiesExecutor functions.
They were all missing an explicit 'Attribute::Configurable' argument
and therefore incorrectly used the default attributes (writable,
enumerable, configurable).
2021-06-17 13:10:06 +01:00
Gunnar Beutner
631d36fd98 Everywhere: Add component declarations
This adds component declarations so that users can select to not build
certain parts of the OS.
2021-06-17 11:03:51 +02:00
Gunnar Beutner
6e094b8dbe Meta: Increase additional space for disk images
Previously we'd add 100MB on top of what du returned for the Root
directory. This increases that to 500MB.
2021-06-17 11:03:51 +02:00
Gunnar Beutner
0ca5a393d1 SystemServer: Improve error message when execv() fails
Previously perror() would just tell us that the file specified
for execv() doesn't exist.
2021-06-17 11:03:51 +02:00
Gunnar Beutner
d7a03397af Meta: Allow building images without most utilities
Previously the build script assumed that certain utilities were always
available.
2021-06-17 11:03:51 +02:00
Gunnar Beutner
0dd03413d6 Meta: Add support for declaring components
Components are a group of build targets that can be built and installed
separately. Whether a component should be built can be configured with
CMake arguments: -DBUILD_<NAME>=ON|OFF, where <NAME> is the name of the
component (in all caps).

Components can be marked as REQUIRED if they're necessary for a
minimally functional base system or they can be marked as RECOMMENDED
if they're not strictly necessary but are useful for most users.

A component can have an optional description which isn't used by the
build system but may be useful for a configuration UI.

Components specify the TARGETS which should be built when the component
is enabled. They can also specify other components which they depend on
(with DEPENDS).

This also adds the BUILD_EVERYTHING CMake variable which lets the user
build all optional components. For now this defaults to ON to make the
transition to the components-based build system easier.

The list of components is exported as an INI file in the build directory
(e.g. Build/i686/components.ini).

Fixes #8048.
2021-06-17 11:03:51 +02:00
Idan Horowitz
70697a5999 LibJS: Throw a syntax error when an identifier is a reserved word
From the specification:
It is a Syntax Error if StringValue of IdentifierName is the same
String value as the StringValue of any ReservedWord except for yield
or await.
It is a Syntax Error if this phrase is contained in strict mode code
and the StringValue of IdentifierName is: "implements", "interface",
"let", "package", "private", "protected", "public", "static", or
"yield".
2021-06-17 10:56:11 +02:00
Idan Horowitz
d6df955305 LibJS: Add missing to_property_key exception check in ClassExpression 2021-06-17 10:56:11 +02:00
Luke
9cbd90fdb6 LibJS: Add BigInt64Array and BigUint64Array
This fixes ~297 test262 test cases :^)
2021-06-17 02:20:03 +01:00
Luke
411c72da27 js: Add print_number method and use it to print out TypedArray values
We can't construct Values with u64 and i64.
I tried adding these constructors, but then it refuses to build in
lagom.
2021-06-17 02:20:03 +01:00
Luke
8d90e137a5 LibJS: Fix check for byteOffset instead of byteLength in byteLength test 2021-06-17 02:20:03 +01:00
Luke
9c2eff8859 LibJS: Make TypedArray use numeric_to_raw_bytes and raw_bytes_to_numeric
It was previously writing directly to the underlying buffer instead of
using these methods. This has a benefit of dealing with BigInt64 and
BigUint64 for us already.
2021-06-17 02:20:03 +01:00
Luke
80edf6f5b6 LibJS: Refactor numeric_to_raw_bytes and raw_bytes_to_numeric
This is to make use of the new Value conversion methods.
This also moves the clamped u8 tag to ArrayBuffer from TypedArray and
the conversion to these methods, as the spec does it here.
2021-06-17 02:20:03 +01:00
Luke
7ff144d533 LibJS: Add a bunch of numeric conversions to Value
Namely:
- BigInt64
- BigUint64
- i16
- u16
- i8
- u8
- Clamped u8

These will be used in ArrayBuffer::numeric_to_raw_bytes later.
2021-06-17 02:20:03 +01:00
sin-ack
93996eb48e CI: Remove incorrect single quote escape
The A in YAML stands for Ass-backwards.
2021-06-17 00:07:26 +02:00
sin-ack
aa91284485 Userland: Allow multiple files to be run by js
js only accepted a single script file to run before this.  With this
patch, multiple scripts can be run in the same execution environment,
allowing the user to specify a "preamble script" to be executed before
the main script.
2021-06-17 00:07:04 +02:00
Idan Horowitz
b9d9187feb LibJS: Automatically & lazily coerce PropertyNames into numbers
This commit expands on 5eef07d232 by
automatically trying to coerce Type::String PropertyNames into numbers
when a caller checks if the PropertyName is_number/is_string.
This has several benefits:
 - We no longer have to duplicate the number coercion code to every
   function that accepts a PropertyNumber. (Or more likely, forget to.)
 - This keeps the lazy nature of only doing the coercion when and if
   there is a semantic difference to the different PropertyName types,
   which means this shouldnt cause any performance drop.
 - Since this coercion changes the state of the PropertyName itself the
   result is essentially cached and can speed up any repeat uses of the
   same PropertyName instance.
2021-06-16 22:54:48 +01:00
Idan Horowitz
623eadb44e LibJS: Stop overwriting existing indexed accessors in define_accessor
The previous implementation only checked the shape, ignoring existing
accessors when using number property names.
2021-06-16 22:54:48 +01:00
Idan Horowitz
6352a33ed2 LibJS: Respect Object::get's without_side_effects parameter for numbers 2021-06-16 22:54:48 +01:00
Linus Groh
317b88a8c3 LibJS: Replace Object's create_empty() with create() taking a prototype
This now matches the spec's OrdinaryObjectCreate() across the board:
instead of implicitly setting the created object's prototype to
%Object.prototype% and then in many cases setting it to a nullptr right
away, it now has an 'Object* prototype' parameter with _no default
value_. This makes the code easier to compare with the spec, very clear
in terms of what prototype is being used as well as avoiding unnecessary
shape transitions.

Also fixes a couple of cases were we weren't setting the correct
prototype.

There's no reason to assume that the object would not be empty (as in
having own properties), so let's follow our existing pattern of
Type::create(...) and simply call it 'create'.
2021-06-16 22:49:04 +01:00
Linus Groh
7489189645 LibJS/Tests: Use Object.prototype.toString() for values in test details
Using String() like we did before depends on objects having either
toString, valueOf, or  @@toPrimitive, which is not the case for objects
with no prototype.
2021-06-16 22:49:04 +01:00
Ali Mohammad Pur
66e5e74374 Spreadsheet: Remove the offset used for exception TextRanges
After yet another rewrite of how GUI::TextEditor interprets text ranges
this was broken yet again :P
2021-06-17 01:08:27 +04:30
Ali Mohammad Pur
0c9a505ad1 Spreadsheet: Remove 'return (...)' workaround in conditional formatting
Now that LibJS can evaluate expressions correctly, that workaround was
breaking conditional formatting.
2021-06-17 01:08:27 +04:30
Ali Mohammad Pur
16b4a78072 Spreadsheet: Do not cancel drag-select when moving over a cell corner
Fixes #4277.
2021-06-17 01:08:27 +04:30
Ali Mohammad Pur
a01358f015 Spreadsheet: Correctly resolve nonstandard column names 2021-06-17 01:08:27 +04:30
Ali Mohammad Pur
b11b3c2f1c Spreadsheet: Make the XSV parser start with a preview parse
Instead of parsing the whole document. That's really wasteful and
super slow.
2021-06-17 01:08:27 +04:30
Andreas Kling
88b168ff16 WindowServer: Simplify WindowFrame shadow logic a little bit
Remove the confusingly-named inflate_for_shadow() function and inline
its logic into render_to_cache(). And remove the m_shadow_offset
member variable since it was only needed locally in one place.

Also improve some variable names to make it more understandable what
is going on.
2021-06-16 21:53:10 +02:00
Andreas Kling
20fb30d857 LibGfx: Add a bunch of [[nodiscard]] to Point 2021-06-16 21:53:10 +02:00
Andreas Kling
df0248b096 LibGfx: Convert Point to east-const style 2021-06-16 21:53:10 +02:00
Andreas Kling
243dfb3bdc LibGfx: Add a bunch of [[nodiscard]] to Size 2021-06-16 21:53:10 +02:00
Andreas Kling
bd9096c97d LibGfx: Convert Size to east-const style 2021-06-16 21:53:10 +02:00
Andreas Kling
3f57037ee7 LibGfx: Convert Rect to east-const style 2021-06-16 21:53:10 +02:00
Andreas Kling
316fb6cf31 LibGfx: Add a bunch of [[nodiscard]] to Gfx::Rect 2021-06-16 21:53:10 +02:00
Andreas Kling
d924d93fa2 WindowServer: Fix unnecessary local variable shadowing in WindowFrame 2021-06-16 21:53:10 +02:00
Gunnar Beutner
bc3076f894 Kernel: Remove various other uses of ssize_t 2021-06-16 21:29:36 +02:00