Commit graph

2230 commits

Author SHA1 Message Date
AnotherTest
42f06fc305 LibLine: Implement searching via up/down arrow keys 2020-04-20 17:27:30 +02:00
AnotherTest
58912994ab LibLine: Implement ^R searching
This commit adds searching in the editor history with ^R.
It does so by instantiating...another Line::Editor inside the current
Line::Editor :^)
2020-04-20 17:27:30 +02:00
Kesse Jones
df6696f576 LibJS: Add Array.prototype.reverse 2020-04-20 17:26:46 +02:00
Itamar
e35219b5ce Debugger: Add source-level operations
- Print current source location, if available
- Add a breakpoint at a source location
- "sl" command - step to the next line in source
2020-04-20 17:25:50 +02:00
Itamar
8a886e0e96 LibDebug: Parse line number information from DWARF format
DWARF line number information, if generated, is stored  in the
.debug_line section of an object file.

The information is encoded as instructions for a VM that is defined in
the DWARF specification.
By executing these instructions, we can extract the encoded line number
information.
2020-04-20 17:25:50 +02:00
Itamar
edaa9c06d9 LibELF: Make ELF::Loader RefCounted 2020-04-20 17:25:50 +02:00
angel
e0a16f8752 FileManager+LibGUI: Allow drop on entire DirectoryView
Previously, drag and drop would only work when dragging between node
items on a DirectoryView. This commit makes it possible to drag files to
the empty area of the DirectoryView and copy files more easily between
windows.
2020-04-20 12:15:26 +02:00
Kesse Jones
579975fd1e LibJS: Add Array.prototype.indexOf 2020-04-20 11:55:18 +02:00
Linus Groh
d3e3f5b421 LibJS: Add tests for String.prototype.repeat() 2020-04-20 11:41:25 +02:00
Linus Groh
a893c6ff0d LibJS: Throw RangeError in String.prototype.repeat() if count is invalid 2020-04-20 11:41:25 +02:00
Linus Groh
0718f216af LibJS: Add assertThrowsError() test function 2020-04-20 11:38:01 +02:00
Andreas Kling
c45e16f605 LibCore: Add StandardPaths thing to retrieve various standard locations
Fixes #1853.
2020-04-19 19:57:05 +02:00
AnotherTest
c97ca2fecc LibLine: Clear trailing trivia when cycling if the suggestion has any 2020-04-19 19:39:50 +02:00
Andreas Kling
4393a2a96d LibGfx: Let the PNG decoder fail if the header is missing or too short 2020-04-19 17:48:43 +02:00
AnotherTest
992467cca3 LibJS: Do not assume that a call frame exists in {get,set}_variable 2020-04-19 17:36:37 +02:00
Andreas Kling
69566bd4d6 LibJS: Allow passing "js" flags to run-tests
This allows us to run "run-tests -g" for testing with GC after every
heap allocation. This may flush out bugs that would otherwise not
occur if GC'ing only occasionally.
2020-04-19 17:34:33 +02:00
Andreas Kling
f7a1696087 LibJS: Add MarkedValueList and use it for argument passing
A MarkedValueList is basically a Vector<JS::Value> that registers with
the Heap and makes sure that the stored values don't get GC'd.

Before this change, we were unsafely keeping Vector<JS::Value> in some
places, which is out-of-reach for the live reference finding logic
since Vector puts its elements on the heap by default.

We now pass all the JavaScript tests even when running with "js -g",
which does a GC on every heap allocation.
2020-04-19 17:34:33 +02:00
AnotherTest
cb3cf589ed LibLine: Allow suggestions to have trailing trivia strings
These strings would be applied when inserted into the buffer, but are
not shown as part of the suggestion.

This commit also patches up Userland/js and Shell to use this
functionality
2020-04-19 17:21:55 +02:00
AnotherTest
7ef48171ce LibLine: Complete only common prefixes, and tweak suggestion logic
On the first tab, only complete the token without suggesting extra
stuff, and on further tabs, show suggestions.
Except in one case where the completion is all in the buffer, then
we show the suggestions, but do no completion.
2020-04-19 17:21:55 +02:00
Andreas Kling
afdba94f63 LibJS: Fix expectations in the function-TypeError.js test
They now match the new, more verbose error messages.
2020-04-19 14:51:47 +02:00
Andreas Kling
b251091a6a LibJS: CallExpression shouldn't throw TypeError or non-constructor call
This unbreaks the entire test suite. :^)
2020-04-19 14:51:47 +02:00
Andreas Kling
2a9e29fbb8 LibJS: Add DeferGC, a RAII way to prevent GC temporarily 2020-04-19 12:09:32 +02:00
Sergey Bugaev
50c139e61c LibCore: Check for fork() failure
For those good boy points :^)
2020-04-19 11:14:26 +02:00
Sergey Bugaev
f8b2a7b4a7 LibCore+LibGUI: Move DesktopServices to LibCore 2020-04-19 11:14:26 +02:00
Linus Groh
03f2024b6e LibJS: Improve CallExpression::execute()'s error messages 2020-04-19 11:00:39 +02:00
Kesse Jones
856ab9c600 LibJS: Add Array.prototype.slice 2020-04-19 02:09:06 +02:00
Linus Groh
3474d7c88e WindowServer/LibGUI: Enforce minimum window size 2020-04-19 02:07:45 +02:00
Linus Groh
71d6459b7f LibJS: Use AK::String::index_of() for StringPrototype::index_of() 2020-04-18 22:24:22 +02:00
Stephan Unverwerth
bf5b251684 LibJS: Allow reserved words as keys in object expressions. 2020-04-18 22:23:20 +02:00
Andreas Kling
3f08dd5ddc LibGUI: Add GUI::DesktopServices::open(URL)
This API is used to open a URL in whatever way the desktop system feels
is best. If you give it a file:// URL, it will try to work out a good
application to open the URL with. For all other protocols, it will open
a Browser instance. :^)
2020-04-18 21:56:28 +02:00
Andreas Kling
d17b42b28d LibGUI: Make view widgets fill background by default
Most clients will want background autofill, so let's make it the
default mode.
2020-04-18 21:55:37 +02:00
Andreas Kling
c7b7b65309 LibGUI: Fix ItemView crash when rubberbanding in main widget view
For some reason this was trying to access the Palette of the parent
widget which is obviously not going to work if the ItemView itself is
the main widget in its window.
2020-04-18 21:25:43 +02:00
Andreas Kling
54c980dbf2 LibGUI: Make ItemView respect Widget::fill_with_background_color()
This makes it possible to create a see-through ItemView. :^)
2020-04-18 21:23:39 +02:00
Andreas Kling
3d31f2e44b WindowServer: Add WindowType::Desktop
This new window type can be used to implement a desktop file manager
for example. :^)
2020-04-18 21:10:16 +02:00
Andreas Kling
88908be350 LibWeb: Parse <br/> into a self-closed br element
We were parsing "<br/>" as an open tag with the name "br/". This fixes
that specific scenario.

We also rename is_self_closing_tag() to is_void_element() to better fit
the specs.
2020-04-18 20:35:18 +02:00
Stephan Unverwerth
cebb619f8e LibJS: Fix parsing of IfStatement, fixes #1829 2020-04-18 14:04:24 +02:00
Andreas Kling
3072f9fd82 LibJS: Move the empty object shape from Interpreter to GlobalObject
The big remaining hurdle before a GlobalObject-agnostic Interpreter is
the fact that Interpreter owns and vends the GlobalObject :^)
2020-04-18 13:59:20 +02:00
Andreas Kling
fca08bd000 LibJS: Move builtin prototypes to the global object
This moves us towards being able to run JavaScript in different global
objects without allocating a separate GC heap.
2020-04-18 13:24:45 +02:00
Stephan Unverwerth
cbcf317e76 LibGfx: Fix draw_triangle() clipping calculations 2020-04-18 13:24:34 +02:00
Linus Groh
d14ddb6461 LibJS: Implement nullish coalescing operator (??) 2020-04-18 12:34:13 +02:00
Stephan Unverwerth
2dcc38d7bf LibGfx: Add Vector3 and Matrix4x4 classes
This adds two templated 3D math classes. They have already been typedf'd
as FloatVector3, DoubleVector3, FloatMatrix4x4 and DoubleMatrix4x4
2020-04-18 12:28:54 +02:00
Stephan Unverwerth
acd4676803 LibGfx: Add draw_triangle() for drawing filled triangles 2020-04-18 12:28:54 +02:00
Andreas Kling
30de1f610d LibJS: Use enumerator macro to mark all constructors in GlobalObject
We were forgetting to mark the String constructor! So this patch fixes
that and ensures we won't forget anyone in the future.
2020-04-18 11:02:05 +02:00
Andreas Kling
bc1ece7f37 LibJS+LibWeb: Pass prototype to Object constructor
Everyone who constructs an Object must now pass a prototype object when
applicable. There's still a fair amount of code that passes something
fetched from the Interpreter, but this brings us closer to being able
to detach prototypes from Interpreter eventually.
2020-04-18 11:00:55 +02:00
Andreas Kling
f6d57c82f6 LibJS: Pass prototype to Function constructors 2020-04-18 10:28:22 +02:00
Andreas Kling
205ac0090d LibJS: Pass prototype to Error constructors 2020-04-18 10:28:22 +02:00
Andreas Kling
0df4d2823a LibJS: Pass prototype to Date constructor 2020-04-18 10:28:22 +02:00
Andreas Kling
2a15323029 LibJS: Pass prototype to BooleanObject constructor 2020-04-18 10:28:22 +02:00
Andreas Kling
298c606200 LibJS: Pass prototype to StringObject constructor 2020-04-18 10:28:22 +02:00
Andreas Kling
cf702a13b9 LibJS: Pass prototype to NumberObject constructor 2020-04-18 10:28:22 +02:00