summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2020-10-26js: Load and save history from/to ~/.js-historyLinus Groh
This is super useful when hacking on LibJS and in general :^)
2020-10-25AK: Eradicate calls to warn().asynts
2020-10-25LibC+Tests: Fix broken snprintf test.asynts
`snprintf` returns the number of characters that would have been written had the buffer been large enough. It's a common trick to call `snprintf(nullptr, 0, ...)` to measure how large a buffer has to be. Thus the return value is not zero but fourteen.
2020-10-25Userland/sort: Convert sort to use getlineMatthew L. Curry
Sort uses a statically sized buffer. This commit changes that to use getline, so lines of any size will be handled properly.
2020-10-25Userland/uniq: Add uniq utilityMatthew L. Curry
Add an implementation for uniq. While it will be nice in the future to make more hardened versions of sort and uniq in the future, this implementation of uniq is compatible with the current version of sort and its buffer sizes. This version supports optional input and output files along with stdin and stdout.
2020-10-25LibCore: Rename File::ShouldCloseFile{Description => Descriptor}Linus Groh
From https://youtu.be/YNSAZIW3EM0?t=1474: "Hmm... I don't think that name is right! From the perspective of userspace, this is a file descriptor. File description is what the kernel internally keeps track of, but as far as userspace is concerned, he just has a file descriptor. [...] Maybe that name should be changed." Core::File even has a member of this enum type... called m_should_close_file_descriptor - so let's just rename it :^)
2020-10-25Userland: Add missing license header to hexdumpAndreas Kling
2020-10-25Userland: Add a very simple hexdump program :^)Andreas Kling
This can definitely be improved, but it does the basic job!
2020-10-24AK: Eradicate the uses of out().asynts
2020-10-23rm: Exit with status 0 if stat fails and force is setWesley Moore
2020-10-23LibWeb: Fix Document construction mishap in <template> elementAndreas Kling
Ref-counted objects must not be stack allocated. Make DOM::Document's constructor private to avoid this issue. (I wish we could mark classes as heap-only..)
2020-10-22Userland: Make `man` provide a `view_width` to `render_for_terminal()'AnotherTest
This makes tables actually show up when rendered through `man'
2020-10-22AK: Make Utf8View and Utf32View more consistentTom
This enables use of these classes in templated code.
2020-10-20Userland: Run clang-format on tree.cppAndreas Kling
2020-10-20Userland: Use new format functions in some programsAndreas Kling
2020-10-20Everywhere: Redundant inline specifier on constexpr functions (#3807)Lenny Maiorani
Problem: - `constexpr` functions are decorated with the `inline` specifier keyword. This is redundant because `constexpr` functions are implicitly `inline`. - [dcl.constexpr], §7.1.5/2 in the C++11 standard): "constexpr functions and constexpr constructors are implicitly inline (7.1.2)". Solution: - Remove the redundant `inline` keyword.
2020-10-19test-js: Support test262 parser testsLinus Groh
test-js now has a --test262-parser-tests option. Modules are skipped for now, current results: Test Suites: 1309 failed, 4314 passed, 5623 total Tests: 1309 failed, 262 skipped, 4052 passed, 5623 total Files: 5361 total Time: ~100ms (Lagom) / 600-800ms (Serenity) For more info, see: https://github.com/tc39/test262-parser-tests
2020-10-19test-js: Exit with 1 if any test failedLinus Groh
2020-10-19test-js: Include skipped tests in total test countLinus Groh
The current output is a bit strange: Tests: 3 skipped, 979 passed, 979 total This makes more sense to me: Tests: 3 skipped, 979 passed, 982 total
2020-10-19test-js: Add argument for explicit test root directoryLinus Groh
Right now test-js has a hardcoded test root directory when running on Serenity or will get it based on SERENITY_ROOT otherwise. Now it is also possible to pass a path to the command which will take precedence over these mechanisms. This will also be useful for adding test262 support as those files will not have a default location.
2020-10-17ntpquery: Add some more validation of the response headerNico Weber
2020-10-17ntpquery: For stratum 1 servers, print reference ID in ASCII with -vNico Weber
2020-10-17ntpquery: Add a comment listing a few more NTP serversNico Weber
2020-10-17ntpquery: Don't leak local time, and check origin time in replyNico Weber
This implements the transmit time suggestion in (abandoned?) draft-ietf-ntp-data-minimization. (The other suggestions were already implemented as far as I can tell.)
2020-10-17ntpquery: Make a few variable names more descriptiveNico Weber
2020-10-15seq: Add help optionMatthew L. Curry
Added a help option to the seq command that gives usage information. Further, when a user gives an incorrect argument, usage is supplied on stderr.
2020-10-15Userland: Add --loop option for aplaynooga
A tiny feature, useful when listening to your favorite song.
2020-10-13LibJS: Cache commonly used FlyStrings in the VMAndreas Kling
Roughly 7% of test-js runtime was spent creating FlyStrings from string literals. This patch frontloads that work and caches all the commonly used names in LibJS on a CommonPropertyNames struct that hangs off VM.
2020-10-13Userland/cp: Disallow copying directories into themselvesMatthew L. Curry
This patch causes cp to investigate whether a directory is being copied into a subdirectory of itself. It uses realpath(3) to ensure that links do not confound detection.
2020-10-13Style: Remove uses of NULL, substituting nullptrMatthew L. Curry
2020-10-12js: Print negative zero with minus signLinus Groh
2020-10-08html: Replace InProcessWebView with OutOfProcessWebViewLinus Groh
2020-10-08html: Create URL from filename, if anyLinus Groh
This makes it possible for the WebView to resolve relative paths in documents loaded from a file.
2020-10-05ntpquery: Make output less verbose by defaultNico Weber
2020-10-04LibJS: Unify syntax highlightingLinus Groh
So far we have three different syntax highlighters for LibJS: - js's Line::Editor stylization - JS::MarkupGenerator - GUI::JSSyntaxHighlighter This not only caused repetition of most token types in each highlighter but also a lot of inconsistency regarding the styling of certain tokens: - JSSyntaxHighlighter was considering TokenType::Period to be an operator whereas MarkupGenerator categorized it as punctuation. - MarkupGenerator was considering TokenType::{Break,Case,Continue, Default,Switch,With} control keywords whereas JSSyntaxHighlighter just disregarded them - MarkupGenerator considered some future reserved keywords invalid and others not. JSSyntaxHighlighter and js disregarded most Adding a new token type meant adding it to ENUMERATE_JS_TOKENS as well as each individual highlighter's switch/case construct. I added a TokenCategory enum, and each TokenType is now associated to a certain category, which the syntax highlighters then can use for styling rather than operating on the token type directly. This also makes changing a token's category everywhere easier, should we need to do that (e.g. I decided to make TokenType::{Period,QuestionMarkPeriod} TokenCategory::Operator for now, but we might want to change them to Punctuation.
2020-10-04LibJS: Remove Interpreter::call()Andreas Kling
Just use VM::call() directly everywhere.
2020-10-04AK: Don't add newline for outf/dbgf/warnf.asynts
In the future all (normal) output should be written by any of the following functions: out (currently called new_out) outln dbg (currently called new_dbg) dbgln warn (currently called new_warn) warnln However, there are still a ton of uses of the old out/warn/dbg in the code base so the new functions are called new_out/new_warn/new_dbg. I am going to rename them as soon as all the other usages are gone (this might take a while.) I also added raw_out/raw_dbg/raw_warn which don't do any escaping, this should be useful if no formatting is required and if the input contains tons of curly braces. (I am not entirely sure if this function will stay, but I am adding it for now.)
2020-10-04LibJS: Move "strict mode" state to the call stackAndreas Kling
Each call frame now knows whether it's executing in strict mode. It's no longer necessary to access the scope stack to find this mode.
2020-10-04Userland: tar: support extracting gzipped filesPeter Elliott
2020-10-04Userland: Add tar commandPeter Elliott
2020-10-03Everywhere: Fix more typosLinus Groh
2020-10-01Userland: Fix buffer overflow in unzipTibor Nagy
It's not a great idea reading file names into a 4 byte sized buffer.
2020-09-29LibJS: Move Console from Interpreter to GlobalObjectAndreas Kling
Each JS global object has its own "console", so it makes more sense to store it in GlobalObject. We'll need some smartness later to bundle up console messages from all the different frames that make up a page later, but this works for now.
2020-09-28ProtocolServer+LibWeb: Support more detailed HTTP requestsAndreas Kling
This patch adds the ability for ProtocolServer clients to specify which HTTP method to use, and also to include an optional HTTP request body.
2020-09-27AK: Remove the ctype adapters and use the actual ctype functions insteadBenoît Lormeau
This finally takes care of the kind-of excessive boilerplate code that were the ctype adapters. On the other hand, I had to link `LibC/ctype.cpp` to the Kernel (for `AK/JsonParser.cpp` and `AK/Format.cpp`). The previous commit actually makes sense now: the `string.h` includes in `ctype.{h,cpp}` would require to link more LibC stuff to the Kernel when it only needs the `_ctype_` array of `ctype.cpp`, and there wasn't any string stuff used in ctype. Instead of all this I could have put static derivatives of `is_any_of()` in the concerned AK files, however that would have meant more boilerplate and workarounds; so I went for the Kernel approach.
2020-09-27LibC: Remove an unneeded string.h include in ctype.h/cppBenoit Lormeau
And include string.h in the files that actually needed it
2020-09-27LibMarkdown: Take a 'view_width' argument for render_for_terminal()AnotherTest
Some constructs will require the width of the terminal (or a general 'width') to be rendered correctly, such as tables.
2020-09-27LibJS: Remove use of Interpreter& in JSONObject codeAndreas Kling
2020-09-27LibJS: Make native function/property callbacks take VM, not InterpreterAndreas Kling
More work on decoupling the general runtime from Interpreter. The goal is becoming clearer. Interpreter should be one possible way to execute code inside a VM. In the future we might have other ways :^)
2020-09-27LibJS: Move most of Interpreter into VMAndreas Kling
This patch moves the exception state, call stack and scope stack from Interpreter to VM. I'm doing this to help myself discover what the split between Interpreter and VM should be, by shuffling things around and seeing what falls where. With these changes, we no longer have a persistent lexical environment for the current global object on the Interpreter's call stack. Instead, we push/pop that environment on Interpreter::run() enter/exit. Since it should only be used to find the global "this", and not for variable storage (that goes directly into the global object instead!), I had to insert some short-circuiting when walking the environment parent chain during variable lookup. Note that this is a "stepping stone" commit, not a final design.