Commit Graph

3629 Commits

Author SHA1 Message Date
Alexander
459aa44f6b LibWeb: Avoid UAF in query_selector{,_all}()
This fixes a bug that caused the selector to be dumped.
It would relase the RefPtr into a dump function, and then use it.
2021-07-17 01:48:04 +04:30
Linus Groh
86c6e68431 LibJS: Implement Temporal.Duration.prototype.abs() 2021-07-16 21:59:13 +01:00
Linus Groh
7df47bf3fb LibJS: Implement Temporal.Duration.prototype.negated() 2021-07-16 21:59:13 +01:00
Linus Groh
9aa1e4b885 LibJS: Implement Temporal.Duration.prototype.with() 2021-07-16 21:59:13 +01:00
Linus Groh
510f668ae3 LibJS: Add TokenType::{Debugger,With} to Token::is_identifier_name()
Also remove TokenType::Interface, that should be handled elsewhere (as
a 'future reserved word' in strict mode).
2021-07-16 21:59:13 +01:00
Ali Mohammad Pur
52a2518a69 LibWasm: Remove a useless use of ScopeGuard
There are no multiple exit paths in that function, so we can just put
the ending logic right at the end of the function instead.
2021-07-17 01:13:39 +04:30
Ali Mohammad Pur
65cd5526cb LibWasm+Everywhere: Make the instruction count limit configurable
...and enable it for LibWeb and test-wasm.
Note that `wasm` will not be limited by this.
2021-07-17 01:13:39 +04:30
Ali Mohammad Pur
70b94f58b2 LibWasm: Inline some very hot functions
These are mostly pretty small functions too, and they were about ~10%
of runtime.
2021-07-17 01:13:39 +04:30
Ali Mohammad Pur
23b48f8fe1 Revert "LibWasm: Some more performance stuff (#8812)"
This reverts commit 35394dbfaa.
I pushed the wrong button again, hopefully this will be the last of
such incidents.
2021-07-17 01:11:28 +04:30
Ali Mohammad Pur
35394dbfaa
LibWasm: Some more performance stuff (#8812)
* wasm: Don't try to print the function results if it traps

* LibWasm: Inline some very hot functions

These are mostly pretty small functions too, and they were about ~10%
of runtime.

* LibWasm+Everywhere: Make the instruction count limit configurable

...and enable it for LibWeb and test-wasm.
Note that `wasm` will not be limited by this.

* LibWasm: Remove a useless use of ScopeGuard

There are no multiple exit paths in that function, so we can just put
the ending logic right at the end of the function instead.
2021-07-17 01:04:37 +04:30
Timothy Flynn
860417fb4f LibJS: Ensure RegExpStringIterator keeps the RegExp matcher object alive
Fixes a crash found with 'test-js -g' due to this object going out of
scope.
2021-07-16 20:44:48 +02:00
Wesley Moret
1b8f73b6b3 LibPDF: Fix treating not finding the linearized dict as a fatal error
We now try to parse the first indirect value and see 
if it's the `Linearization Parameter Dictionary`. if it's not, we 
fallback to reading the xref table from the end of the document
2021-07-16 20:44:10 +02:00
Wesley Moret
5d4d70355e LibPDF: Fix checking minor_ver instead of major_ver 2021-07-16 20:44:10 +02:00
Idan Horowitz
8d01d43f5e LibJS: Replace the boolean argument of Object::set with an enum class
This is more serenity-esque and also makes pointing out missing
exception checks during reviews much easier.
2021-07-16 17:50:01 +01:00
Idan Horowitz
4b39e718b3 LibJS: Remove unused Object::PutOwnPropertyMode enum class
All usages of this enum class were removed in the Object rewrite, but
this enum was left behind.
2021-07-16 17:50:01 +01:00
Timothy Flynn
4812b95795 LibJS: Implement RegExp AdvanceStringIndex abstraction
This isn't particularly useful yet because the underlying LibRegex
engine doesn't support unicode matching yet. But the debt of FIXMEs
related to AdvanceStringIndex have added up, so let's get this out of
the way.
2021-07-16 13:53:11 +01:00
Timothy Flynn
5135f4000c LibJS: Implement RegExp.prototype [ @@matchAll ]
This also allows String.prototype.matchAll to work, as all calls to that
method result in an invocation to @@matchAll.
2021-07-16 13:53:11 +01:00
Timothy Flynn
cfddcad7cf LibJS: Implement the RegExpStringIterator object
This implementation closely follows the StringIterator object in that
the abstract closure meant to be created in CreateRegExpStringIterator
is instead unrolled into RegExpStringIterator.prototype.next.
2021-07-16 13:53:11 +01:00
Timothy Flynn
6cf64d0f09 LibJS: Make the RegExpExec abstraction publically available
For RegExpStringIterator, this will be needed outside of the RegExp
prototype.
2021-07-16 13:53:11 +01:00
Max Wipfli
e22a34badb LibWeb: Fix assertion failures in HTMLTokenizer
The *TagName states are all very similar, so it seems to be correct to
apply the fix from #8761 to all of those states.

This fixes #8788.
2021-07-16 11:55:55 +02:00
Peter Bindels
ca9c53c1a8
LibELF/DynamicLinker: Evaluate symbols in library insertion order (#8802)
When loading libraries, it is required that each library uses the same
instance of each symbol, and that they use the one from the executable
if any. This is barely noticeable if done incorrectly; except that it
completely breaks RTTI on Clang. This switches the hash map to be
ordered; tested to work for Clang by @Bertaland
2021-07-16 11:55:01 +02:00
Linus Groh
9d7e391f94 LibJS/Tests: Add test for Temporal.Instant.prototype.valueOf() 2021-07-16 01:07:01 +01:00
Linus Groh
8daf35e1b1 LibJS: Implement Temporal.Duration.prototype.valueOf() 2021-07-16 01:07:01 +01:00
Linus Groh
a06b034a9a LibJS: Implement Temporal.Duration.prototype.blank 2021-07-16 01:07:01 +01:00
Linus Groh
3713164fa3 LibJS: Implement Temporal.Duration.prototype.sign 2021-07-16 01:07:01 +01:00
Linus Groh
be5254dcac LibJS: Implement Temporal.Duration.prototype.nanoseconds 2021-07-16 01:07:01 +01:00
Linus Groh
04e2d215a1 LibJS: Implement Temporal.Duration.prototype.microseconds 2021-07-16 01:07:01 +01:00
Linus Groh
db22f86055 LibJS: Implement Temporal.Duration.prototype.milliseconds 2021-07-16 01:07:01 +01:00
Linus Groh
b81331a110 LibJS: Implement Temporal.Duration.prototype.seconds 2021-07-16 01:07:01 +01:00
Linus Groh
dbdbfbeebc LibJS: Implement Temporal.Duration.prototype.minutes 2021-07-16 01:07:01 +01:00
Linus Groh
067c2346ed LibJS: Implement Temporal.Duration.prototype.hours 2021-07-16 01:07:01 +01:00
Linus Groh
2015640168 LibJS: Implement Temporal.Duration.prototype.days 2021-07-16 01:07:01 +01:00
Linus Groh
23d0c3494f LibJS: Implement Temporal.Duration.prototype.weeks 2021-07-16 01:07:01 +01:00
Linus Groh
8011409428 LibJS: Implement Temporal.Duration.prototype.months 2021-07-16 01:07:01 +01:00
Linus Groh
300a22f9b9 LibJS: Implement Temporal.Duration.prototype.years 2021-07-16 01:07:01 +01:00
Linus Groh
23766f28db LibJS: Implement Temporal.Duration.prototype[@@toStringTag] 2021-07-16 01:07:01 +01:00
Linus Groh
7921d8ba91 LibJS: Start implementing Temporal.Duration
This patch adds the Duration object itself, its constructor and
prototype (currently empty), and three required abstract operations.
2021-07-16 01:07:01 +01:00
Gunnar Beutner
d83c672926 LibC: Don't include AK headers in system headers
AK/Platform.h might not be available when building the toolchain.
2021-07-15 23:51:59 +02:00
Tom
1021aba226 LibGUI: Dither pattern should be independent from clipping rectangle
The dither pattern needs to be determined relative to the bitmap
itself, not the clipping rectangle.

Fixes #8780
2021-07-15 19:46:42 +02:00
M4x1m3
927f6ea221 LibC: Add putgrent 2021-07-15 11:16:58 +02:00
Timothy
2eb93f2628 LibCore+LibIMAP: Move Promise to LibCore
This makes Promise available without having to link LibIMAP.
2021-07-15 11:11:14 +02:00
Matthew Hall
3b5b7c5e65 VimEditingEngine: Add support for repeats of J 2021-07-15 10:10:07 +02:00
Matthew Hall
2653ad36ee VimEditingEngine: Add support for repeats of p and P 2021-07-15 10:10:07 +02:00
Matthew Hall
7b7548ce9d VimEditingEngine: Allow repeats for dd, yy and x 2021-07-15 10:10:07 +02:00
Matthew Hall
c1e2710a0d VimEditingEngine: Add P command to put before cursor 2021-07-15 10:10:07 +02:00
Matthew Hall
180e2469af VimEditingEngine: Add J command to join two lines 2021-07-15 10:10:07 +02:00
Matthew Hall
a7e7f62d08 VimEditingEngine: Operate on real lines rather than wrapped ones
In the normal editing engine keys like Home, End etc work on visual
lines, but vim operates on real ones. Eg if you have a really long line
and wrapping is on then in normal editing Home would take you to the
beginning of the wrapped line, but 'I' would put you insert mode at the
beginning of the real line in vim.
2021-07-15 10:10:07 +02:00
Max Wipfli
2404ad6897 LibWeb: Fix assertion failure when tokenizing JS regex literals
This fixes parsing the following regular expression: /</g;

It also adds a simple script element to the HTMLTokenizer regression
test, which also contains that specific regex.
2021-07-15 01:47:22 +02:00
Linus Groh
466c5bc96d LibJS: Implement Temporal.Calendar.prototype.id 2021-07-14 23:50:03 +01:00
Linus Groh
3ee169d8e7 LibJS: Implement Temporal.Calendar.prototype.toJSON() 2021-07-14 23:50:03 +01:00