Age | Commit message (Collapse) | Author |
|
This allows performing an action based on whether something
was actually added or removed without having to look it up
prior to calling set() or remove().
|
|
The fact that JsonValues can contain 64-bit values isn't a JavaScript
compatible behavior in the first place, but as long as we're supporting
this, we should make sure it works correctly.
|
|
|
|
...and rename it to unstable_take(), to align with other take...() methods.
|
|
|
|
This allows you to clear all the WeakPtrs pointing at a Weakable *now*
instead of waiting until the Weakable is destroyed.
|
|
Prior to this, we wrote to the log every time the << operator
was used, which meant that only these parts of the log statement
were serialized. If the thread was preempted, or especially with
multiple CPUs the debug output was hard to decipher. Instead, we
buffer up the log statements. To avoid allocations we'll attempt
to use stack space, which covers most log statements.
|
|
|
|
This allows us to query the current thread and process on a
per processor basis
|
|
This allows the inspector to show arbitrary json structures.
|
|
Inlining these allows the compiler to optimize out the assertions in
favor of a static range check in many cases.
|
|
|
|
|
|
|
|
The test cases are taken from RFC 4648.
|
|
This was showing up in Browser profiles, which is silly, so write a new
version that doesn't create a temporary String object.
There are a whole bunch of these and long-term it would be nice to find
a way to share all the very similar logic instead of duplicating it.
|
|
|
|
|
|
This was useful in debugging a nullptr dereference, which was happening
through later, but was caused by this inconsistent initialization.
|
|
- Parsing invalid JSON no longer asserts
Instead of asserting when coming across malformed JSON,
JsonParser::parse now returns an Optional<JsonValue>.
- Disallow trailing commas in JSON objects and arrays
- No longer parse 'undefined', as that is a purely JS thing
- No longer allow non-whitespace after anything consumed by the initial
parse() call. Examples of things that were valid and no longer are:
- undefineddfz
- {"foo": 1}abcd
- [1,2,3]4
- JsonObject.for_each_member now iterates in original insertion order
|
|
Get rid of the weird old signature:
- int StringType::to_int(bool& ok) const
And replace it with sensible new signature:
- Optional<int> StringType::to_int() const
|
|
|
|
Before this, it has been possible to assign a RefCounted object to another
RefCounted object. Hilariosly (or sadly), that copied the refcount among
the other fields, meaning the target value ended up with a wrong refcount.
Ensure this never happens by disallowing copies and moves for RefCounted types.
|
|
We don't really have a good way to prevent this kind of overflow,
but let's at least immediately panic in this case.
|
|
This fixes all sorts of race conditions, primarily in the kernel, where till
now it's been possible to obtain either double free or use-after-free by
exploiting refcounting races.
|
|
And while fixing all the tests that look at ref_count(),
sneak in a fix for the test suite name.
|
|
|
|
|
|
We have to include <stddef.h> to get its definition.
|
|
Otherwise we can end up with percent-encoded nonsense in base64 data
which does not decode correctly.
|
|
|
|
|
|
|
|
It was me who has broken this, sorry ;(
|
|
|
|
Also, implement append(Utf32View) using it.
|
|
This allows for using atomic operations on any variables,
not only those wrapped in AK::Atomic<T>
|
|
|
|
|
|
Once again, we need to hint the compiler that it should inline the function, and
then it is able to eliminate the assertion.
|
|
|
|
I've been using this in the new HTML parser and it makes it much easier
to understand the state of unfinished code branches.
TODO() is for places where it's okay to end up but we need to implement
something there.
ASSERT_NOT_REACHED() is for places where it's not okay to end up, and
something has gone wrong.
|
|
Also, make the zero-argument variant private since it's not meant to be
called by clients directly.
|
|
|
|
The SDL port failed to build because the CMake toolchain filed pointed
to the old root. Now the toolchain file assumes that the Root is in
Build/Root.
Additionally, the AK/ and Kernel/ headers need to be installed in the
root too.
|
|
.. and make travis run it.
I renamed check-license-headers.sh to check-style.sh and expanded it so
that it now also checks for the presence of "#pragma once" in .h files.
It also checks the presence of a (single) blank line above and below the
"#pragma once" line.
I also added "#pragma once" to all the files that need it: even the ones
we are not check.
I also added/removed blank lines in order to make the script not fail.
I also ran clang-format on the files I modified.
|
|
Since the task of splitting a string via another is pretty common, we
might as well have this overload of split_view() as well.
|
|
This can be used in code that builds on non-Serenity platforms.
|
|
I don't wanna see String::length() in a profile, jeez. :^)
|
|
And move canonicalized_path() to a static method on LexicalPath.
This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
|