This changes the RequestClient::start_request() method to take a URL
object instead of a URL string as argument. All callers of the method
already had a URL object anyway, and start_request() in turn parses the
URL string back into a URL object. This removes this unnecessary
conversion.
On most (if not all) systems rm ignores an empty paths array if -f or
--force is specified. This helps with scripts that may pass an empty
variable where the file paths are supposed to go.
Instead of manually specifying the types and names of imports to stub
out, `--export-noop` can be used to export stub functions for any
unresolved function import.
This makes running and debugging random wasm files much easier.
This commit is a fairly large refactor, mainly because it unified the
two different ways that existed to represent references.
Now Reference values are also a kind of value.
It also implements a printer for values/references instead of copying
the implementation everywhere.
This updates ps so that it calculates the ideal column width instead
of relying on hard-coded values. Previously the STATE column was too
small to fit the state for "FinalizerTask".
Since this program is setuid-root, it should be as simple as possible.
To that end, remove `/etc/plsusers` and use filesystem permissions to
achieve the same thing. `/bin/pls` is now only executable by `root` or
members of the `wheel` group.
Also remove all the logic that went to great lengths to `unveil()` a
minimal set of filesystem paths that may be used for the command.
The complexity-to-benefit ratio did not seem justified, and I think
we're better off keeping this simple.
Finally, remove pledge promises the moment they are no longer needed.
The POSIX man-page states that inet_pton returns 0 if the input is not a
valid IPv4 dotted-decimal string or a valid IPv6 address string. This is
also how it is implemented in SerenityOS.
This means that we should treat a return value of 0 as an error to avoid
using an invalid address (or 0.0.0.0).
This allows multiply different kinds of interpreters to be used by the
runtime; currently a BytecodeInterpreter and a
DebuggerBytecodeInterpreter is provided.
This replaces the two sloppy copies of the load() function with a
cleaned up implementation:
- Only use the first argument, to load multiple files just call the
function multiple times
- Fix a crash when using any non-string argument
- Throw an error if the file can't be opened instead of logging to
stderr
- Don't use parse_and_run(), which would print the AST of the loaded
file when using -A, for example - it's used either way as the entry
point in both REPL and non-REPL mode, so we already get exception
handling and all that