operator= for JS::SafeFunction was missing the CallableKind parameter
in the call to init_with_callable. This was not picked up before as
nothing used operator= on JS::SafeFunction.
Since we don't currently have streams, we didn't set length anywhere.
However, this is required by XHR's reliance on Fetch to get the total
number of bytes for the progress events.
This makes Fetch rely less on using main_thread_vm().current_realm(),
which relies on the dummy execution context if no JavaScript is
currently running.
This relied on pulling the current realm from the main thread VM, which
requires an execution context to be on the VM's stack. This heavily
relied on the dummy execution context that is always on the stack, for
example, when parsing the UA style sheets where no JavaScript is
running.
It is unsafe to defer this selection update, because ::open_url itself
is called when users make selection updates, creating a race.
This fixes and infinite selection change loop one could easily reproduce
by holding an up or down arrow key in the tree view while clicking on a
tree view item a couple of times.
This requires Parser to be movable, so we remove the `default`
destructors from Parser and TokenStream, and give them both move
constructors. Since TokenStream only holds a reference to its tokens,
(and it needs to, to avoid copying when given eg a function's contents,)
we add a manual move constructor for Parser which creates a new
TokenStream from the new Parser's tokens, and then manually copies the
old TokenStream's state.
Instead of constructing a Tokenizer and then calling parse() on it, we
now call `Tokenizer::tokenize(...)` directly. (Renamed from `parse()`
because this is a Tokenizer, not a Parser.)
man invokes the pager command via `sh` which, since
beaae6b420 launches `Shell` in posix mode.
As the referenced commits message indicates, launching `Shell` in posix
mode while interactive, makes it choke on the default `.shellrc`. This
made `man` spew out some shell syntax errors to stderr every time it
invoked the pager.
To fix that, invoke `sh` with `--skip-shellrc` for now as suggested by
the aforementioned commit.
This patch switches away from {Nonnull,}LockRefPtr to the non-locking
smart pointers throughout the kernel.
I've looked at the handful of places where these were being persisted
and I don't see any race situations.
Note that the process file descriptor table (Process::m_fds) was already
guarded via MutexProtected.
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.
This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
Each time we wrapped a line, we were appending an extra blank span which
wasn't needed. This was leading to an extra blank line after every
single line.
This is implemented as a Clang frontend tool, and currently does two
things:
- Ensure for all fields wrapped in {Nonnull,}GCPtr<T>, T inherits from
JS::Cell
- Ensure for all fields not wrapped in {Nonnull,}GCPtr, that the type
does not inherit from JS::Cell (otherwise it should be wrapped in a
Ptr class).
In the future, this tool could be extended further. For example, we may
consider validating all implementations of Cell::visit_impl.
Without this change, using {Nonnull,}GCPtr<T const> would complain that
there are multiple constructors which resolve to the same type (T& and
T const&). This removes that disambiguation and allows us to slowly fix
all of the constness issues surrounding GCPtrs. This change will not be
necessary in the future as we will be able to remove all of the const
qualifiers from the Ptr classes (they'll be in the template type
instead).