Commit Graph

8160 Commits

Author SHA1 Message Date
Andreas Kling
bb2be4bb99 Kernel: Make VMWareBackdoor eternal (since it's never freed) 2020-04-08 17:19:46 +02:00
Andreas Kling
e4ab908fe0 Kernel: Move global constructor invocation a bit earlier 2020-04-08 17:19:46 +02:00
Andreas Kling
a066dd1fac Kernel: Move sync and finalization tasks into their own files
Instead of clogging up the initialization sequence, put these tasks
in their own files.
2020-04-08 17:19:46 +02:00
Andreas Kling
befe4c6709 Kernel: Remove DebugLogDevice
This was a cute idea but ultimately it's just not useful since we
already have the dbgputch() and dbgputstr() syscalls.
2020-04-08 17:19:46 +02:00
Andreas Kling
c8087a42fc Kernel: Move more things from init() to init_stage2()
The purpose of init() is to get multi-tasking up and running. We don't
want to do anything in init() that doesn't advance that goal.

This patch moves some things from init() to init_stage2(), and adds a
comment block explaining the split.
2020-04-08 17:19:46 +02:00
Andreas Kling
a7bbfda034 Kernel: Rename KParams => Kernel::CommandLine
Let's make this read more like English.
2020-04-08 17:19:46 +02:00
Andreas Kling
dc7340332d Kernel: Update cryptically-named functions related to symbolication 2020-04-08 17:19:46 +02:00
Andreas Kling
348e209eb5 LibWeb: Make CanvasRenderingContext2D use floats instead of ints
This matches what we already do for the layout tree and things are
expected to work this way regardless.
2020-04-08 17:19:46 +02:00
Andreas Kling
2ffa054574 LibJS: Add Value::to_double() for convenience 2020-04-08 17:19:46 +02:00
Paul Redmond
a9779e12ea
AK: Appending 0 bytes to a ByteBuffer should be a no-op (#1699)
- inserting an empty string into LibLine Editor triggered an assertion
  trying to grow a ByteBuffer by 0 bytes.
2020-04-08 17:04:37 +02:00
Emanuele Torre
38dfd04633 LibJS: rename JS::DeclarationType => JS::DeclarationKind
Many other parsers call it with this name.

Also Type can be confusing in this context since the DeclarationType is
not the type (number, string, etc.) of the variables that are being
declared by the VariableDeclaration.
2020-04-08 14:50:14 +02:00
Brendan Coles
44f8161166 IRCClient: Remove FIXME for RPL_TOPICWHOTIME
RPL_TOPICWHOTIME is handled by handle_rpl_topicwhotime.
2020-04-08 14:06:03 +02:00
Brendan Coles
9126859679 IRCClient: Rename /hop command to /cycle
Some IRC clients use /hop to part and re-join a channel; however this
can be confused with granting half-op (+h) channel privileges to a user.

The general convention used by other IRC clients is /cycle.
2020-04-08 11:42:05 +02:00
Andreas Kling
f07f8d5a44 LibJS: Add "constructor" property to constructor prototypes 2020-04-08 11:08:07 +02:00
Brian Gianforcaro
39855fe9ef LibWeb: Add canvas.strokeRect(), and fix scale & translate
Add an implementation of CanvasRenderingContext2DWrapper.strokeRect().
While implementing this I fixed fillRect() and the new strokeRect() to
honor the .scale() and .translate() values that had previously been plumbed.

Also enhance the canvas.html demo to utilize strokeRect(), scale(), and translate().
2020-04-08 11:07:50 +02:00
Paul Redmond
7291d5c86f
Lagom: Add fuzz testing for LibJS using libFuzzer (#1692)
Note: clang only (see https://llvm.org/docs/LibFuzzer.html)

- add FuzzJs which will run the LibJS parser on random javascript inputs
- added a basic dictionary of javascript tokens

To use fuzzer:
CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -DENABLE_FUZZER_SANITIZER=1 ..
Fuzzers/FuzzJs -dict=../Fuzzers/FuzzJs.dict
2020-04-08 10:40:02 +02:00
rhin123
e91cb83a23 Calendar: Make the application theme-aware 2020-04-08 10:34:20 +02:00
Andreas Kling
7382b27c22 LibWeb: Add Origin concept (protocol, host, port tuple)
Every Document now has an Origin, found via Document::origin().
It's based on the URL of the document.

This will be used to implement things like the same-origin policy.
2020-04-07 23:01:45 +02:00
Andreas Kling
53f63058b9 WindowServer: Remove long-unused COMPOSITOR_DEBUG logging 2020-04-07 23:01:45 +02:00
Andreas Kling
a53cf81374 LibCore: Add Core::Timer::create_single_shot()
This is just a convenience function for creating single-shot timers.
2020-04-07 23:01:43 +02:00
Andreas Kling
f813041f67 ProfileViewer: Remove nonsense no-op 2020-04-07 21:29:30 +02:00
Linus Groh
5ecc7e6a1c LibJS: Add Number.isSafeInteger() 2020-04-07 21:28:43 +02:00
Linus Groh
b7032b4972 LibJS: Add Number constants 2020-04-07 21:28:43 +02:00
VAN BOSSUYT Nicolas
f85aa8462f LibGUI: Thumbnail keep the aspect ratio of the original file. 2020-04-07 21:27:31 +02:00
VAN BOSSUYT Nicolas
e9de8a445f LibGUI: Center the icon in ItemView when smaller than 32px. 2020-04-07 21:27:31 +02:00
VAN BOSSUYT Nicolas
694e4e9168 Resources: Added filetype icon for object, library, text and unknown. 2020-04-07 21:27:31 +02:00
Brendan Coles
0f91045008 IRCClient: Add right-click context menu to IRCWindow member list 2020-04-07 21:27:06 +02:00
Brendan Coles
6476f690fe WindowServer: Menu::popup() should return when the menu is empty
Previously the WindowServer would assert `!is_empty()` and crash.

Fixes #1689
2020-04-07 21:26:52 +02:00
Linus Groh
3e677fd03d LibJS: Break loop on EOF when parsing object expression 2020-04-07 21:26:38 +02:00
Andreas Kling
19be842b5b AK: Disable the consumable annotation checking to fix Clang build
Clang keeps whining that NonnullFooPtrs are in "unknown" state and I'm
not sure how to resolve that right now. Disable the checking until we
can figure it out.
2020-04-07 17:30:16 +02:00
Linus Groh
f631f6a2e6 LibJS: Add Number() 2020-04-07 17:25:50 +02:00
Linus Groh
40ac94995d LibJS: Reformat BooleanConstructor.{cpp,h} 2020-04-07 17:25:50 +02:00
Andreas Kling
a31ef54a2a LibELF: Cache symbol counts + demangled names (userspace only)
To make repeated symbolication requests faster, we now cache the symbol
count on ELFLoader instead of looking it up in the image each time.

We also cache the demangled versions of names after looking them up the
first time. This is a huge speedup for ProfileViewer. :^)
2020-04-07 16:41:42 +02:00
Andreas Kling
992d8e450c ProfileViewer: Remove an unnecessary call to String::format() 2020-04-07 16:41:00 +02:00
Andreas Kling
19cbfaee54 LibJS: Add SequenceExpression AST node (comma operator)
This patch only adds the AST node, the parser doesn't create them yet.
2020-04-07 15:56:26 +02:00
Andreas Kling
f8942411ac AK: Add forward() overload that refuses to forward lvalue as rvalue
This matches what other forward() implementations do.
2020-04-07 15:56:19 +02:00
Brian Gianforcaro
e54cc055ac HackStudio: pledge "thread" to fix opening files
It looks like HackStudio got broken when clicking on
a folder in the open file dialog. The thumbnail icons
appear to be loaded on a new thread.
2020-04-07 12:14:35 +02:00
Andreas Kling
f8d6d61da5 LibWeb: Fix null dereference in HtmlView::mousedown_event
Running event handlers in response to a mouse event may cause full
layout invalidation, so we can't expect the layout root to be present
right after returning from JS.

Fixes #1629.
2020-04-07 10:26:54 +02:00
DexesTTP
e586dc285a LibJS: Allow parsing numeric and string literals in object expressions
Also updated the object-basic.js test to include this change
2020-04-07 09:05:16 +02:00
Emanuel Sprung
154dcd1ed6 AK: Allow %m.nf specifier for double/float in printf to set fraction with
This patch adds the missing part for the printf of double values to specify
the length of the fraction part. For GVariant, a default of %.2 is used.
2020-04-07 09:02:02 +02:00
Linus Groh
22f20cd51d LibJS: Add String.prototype.toUpperCase() 2020-04-07 08:50:35 +02:00
Oliver Hunt
727031ac1b Toolchain: Make BuildQemu.sh choose the correct ui library when building on OSX 2020-04-07 08:44:41 +02:00
Jack Karamanian
edae926cb0 LibJS: Add Boolean constructor object 2020-04-07 08:41:25 +02:00
Jack Karamanian
57bd194e5a LibJS: Return false for NaN numbers in Value::to_boolean() 2020-04-07 08:41:25 +02:00
DexesTTP
4a9485f830 LibJS: Fix impossible member access for negative integers
The PropertyName class able to match a number or an array can only
accept positive numerical values. However, the computed_property_name
method sometimes returned negative values.

This commit also adds a basic object access test case.
2020-04-06 21:45:20 +02:00
Andreas Kling
cb18b2c74d LibJS: Add String.prototype.toLowerCase() 2020-04-06 20:46:08 +02:00
Linus Groh
220ecde626 LibM: Improve pow() and powf() 2020-04-06 20:31:48 +02:00
Andreas Kling
4fe14aab3b LibJS: Inline JS::Value()
I had this out of line for debugging reasons. Put it back inline.
2020-04-06 20:30:36 +02:00
Andreas Kling
bdffc9e7fb LibJS: Support array holes, encoded as empty JS::Value
This patch adds a new kind of JS::Value, the empty value.
It's what you get when you do JSValue() (or most commonly, {} in C++.)

An empty Value signifies the absence of a value, and should never be
visible to JavaScript itself. As of right now, it's used for array
holes and as a return value when an exception has been thrown and we
just want to unwind.

This patch is a bit of a mess as I had to fix a whole bunch of code
that was relying on JSValue() being undefined, etc.
2020-04-06 20:27:44 +02:00
Andreas Kling
5495f06af5 LibJS: Give argument vectors an inline capacity of 8
This avoids one malloc/free pair for every function call if there are
8 arguments or fewer.
2020-04-06 19:22:12 +02:00