Commit graph

8236 commits

Author SHA1 Message Date
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
Andreas Kling
be019f28ca LibJS: Add a PropertyName class that represents a string or a number
Now that we have two separate storages for Object properties depending
on what kind of index they have, it's nice to have an abstraction that
still allows us to say "here's a property name".

We use PropertyName to always choose the optimal storage path directly
while interpreting the AST. :^)
2020-04-06 18:09:26 +02:00
Andreas Kling
90ba0145f6 LibJS: Add a number-indexed property storage to all Objects
Objects can have both named and indexed properties. Previously we kept
all property names as strings. This patch separates named and indexed
properties and splits them between Object::m_storage and m_elements.

This allows us to do much faster array-style access using numeric
indices. It also makes the Array class much less special, since all
Objects now have number-indexed storage. :^)
2020-04-06 18:09:26 +02:00
Liav A
65dd9d5ad3 Kernel: Ensure we flush the entire ext2 superblock 2020-04-06 17:18:36 +02:00
Linus Groh
061badeaea Ports: Remove LibDraw from c-ray CMakeLists.txt 2020-04-06 17:17:52 +02:00
Andreas Kling
9aaf19f4de LibJS: Do a garbage collection every N allocations (N=10'000)
To prevent the heap from growing infinitely large, we now do a full GC
every 10'000 allocations. :^)
2020-04-06 15:54:46 +02:00
Linus Groh
c7b4b5fe00 LibM: Fix ceil() and ceilf() for negative numbers
These functions are using a naive approach: casting double/float to int
and returning the result + 1. That increment by one must only happen for
positive input values though.
2020-04-06 15:43:47 +02:00
Liav A
7cda0b9027 SystemMonitor: Replace 'device' JSON field with 'source' 2020-04-06 15:36:36 +02:00
Liav A
23fb985f02 Kernel & Userland: Allow to mount image files formatted with Ext2FS 2020-04-06 15:36:36 +02:00
Liav A
ecee76b741 Kernel: Change Ext2FS to be backed by a file instead of a block device
In contrast to the previous patchset that was reverted, this time we use
a "special" method to access a file with block size of 512 bytes (like
a harddrive essentially).
2020-04-06 15:36:36 +02:00
Emanuele Torre
1d6c8724b9 LibJS: Fix some tests for Math.min()
In some of the tests in Math.min.js, we were testing Math.max() instead
of Math.min()
2020-04-06 15:14:34 +02:00
VAN BOSSUYT Nicolas
5d2bfbd20b LibGUI: Added the new icons to FileSystemModel. 2020-04-06 14:44:09 +02:00
VAN BOSSUYT Nicolas
0d04327318 Ressources: Added more file type icon. 2020-04-06 14:44:09 +02:00
Emanuele Torre
ba67fc68b8
LibJS: Rename variable "max" to "min" in MathObject::min() (#1665) 2020-04-06 14:08:56 +02:00
Andreas Kling
67f7763ab9 LibJS: Object needs to protect values in its storage
Otherwise the garbage collector will eat them way too soon! This made
it impossible to use "js -g" without crashing.
2020-04-06 13:35:20 +02:00
Xiao NuoFu
bb1ad4b649 Ports: refresh OpenSSL, make it build its command line utils.
This patch refreshes the openssl port and makes it build the utilities
in apps/, e.g. the openssl utility.

Now you can do this from Serenity:

    $ openssl s_client -connect example.org:443
    ...
    GET / HTTP/1.1
    Host: example.org

    <HTTP response here>

The download URL was bit-rotten and needed a fix.
2020-04-06 11:44:13 +02:00
Xiao NuoFu
7fd77e9ffe Kernel/Net: make setsockopt pretend it understands SO_KEEPALIVE. 2020-04-06 11:44:13 +02:00
Xiao NuoFu
5fe521c507 LibC: create a stub for getrusage. 2020-04-06 11:44:13 +02:00
Andreas Kling
e323246517 Meta: Add missing copyright headers 2020-04-06 11:09:01 +02:00
AnotherTest
3ab6c5fd09 DHCPClient: Log errors and cleanup the code
Prior to this, we ran the DHCP client as a high-priority service, but
making the system feel laggy "for some network stuff" is not the
greatest of ideas :^)
2020-04-06 10:58:40 +02:00
Linus Groh
bf62625001 Base: Add trigonometry demo webpage 2020-04-06 10:58:16 +02:00
Linus Groh
f5dacfbb5b LibJS: Add Math.{cos,sin,tan}() 2020-04-06 10:58:16 +02:00
Linus Groh
04a36b247b LibJS: Simplify MathObject functions 2020-04-06 10:58:16 +02:00
Andreas Kling
20e58c5513 AK: Make dbgprintf() and dbgputstr() go to stderr on non-Serenity hosts 2020-04-06 10:49:27 +02:00
Andreas Kling
0d48fb9a87 AK: Add out() and warn() streams that forward to stdout and stderr
Our C++ code generator tools have been relying on host-side dbg() being
forwarded to stdout until now. Now they use out() instead.

Hopefully this will make it easier and more enticing to use streams in
userspace programs as well. :^)
2020-04-06 10:49:27 +02:00