summaryrefslogtreecommitdiff
path: root/Libraries
AgeCommit message (Collapse)Author
2020-05-30LibJS: Throw a TypeError when an arrow function is used as a constructorJack Karamanian
2020-05-30LibJS: Don't define the "prototype" property for arrow functionsJack Karamanian
2020-05-30LibJS: Set the bound |this| value to the |this| value of the currentJack Karamanian
scope for arrow functions
2020-05-30LibJS: Track whether ScriptFunctions and FunctionExpressions are arrowJack Karamanian
functions
2020-05-30LibJS: Remove unnecessary explicit from the 3 argument FunctionJack Karamanian
constructor
2020-05-30LibJS: Object.getOwnPropertyDescriptor works properly with accessorsMatthew Olsson
2020-05-30LibGUI+HackStudio: Fix cursor appearance and crash while debuggingFalseHonesty
HackStudio uses a TreeView to display the list of current variables while debugging, and when the program completes, it sets that view's model to a null model. This would trip an assertion if the TreeView had something selected at the time, so this patch lessens the assertion into a simple null check. Additionally, the cursor would look laggy when moving about the editor because the code was waiting for a window repaint to update the cursor's look when it makes more sense to update the cursor when it actually moves. This change also requires the base GUI::TextEditor to expose a getter to tell if its currently in a drag selection. Finally, requesting a context menu in the line ruler on the side of the editor would also place/remove breakpoints, which was counter intuitive, so this requires a left click to modify breakpoint placement.
2020-05-30Lagom: Adjust AK, LibCore and LibTLS to build on MacOSMarcin Gasperowicz
2020-05-30LibJS: Parse arrow function expression with correct precedenceMarcin Gasperowicz
The parser was chomping on commas present after the arrow function expression. eg. [x=>x,2] would parse as [x=>(x,2)] instead of [(x=>x),2]. This is not the case anymore. I've added a small test to prove this.
2020-05-30LibMarkdown: Change internal MD API to return OwnPtrsFalseHonesty
Previously, all Markdown blocks had a virtual parse method which has been swapped out for a static parse method returning an OwnPtr of that block's type. The Text class also now has a static parse method that will return an Optional<Text>.
2020-05-30LibMarkdown: Change MD Document parse API to return a RefPtrFalseHonesty
Markdown documents are now obtained via the static Document::parse method, which returns a RefPtr<Document>, or nullptr on failure.
2020-05-29LibJS: Add all remaining tokens to MarkupGenerator's style converterFalseHonesty
2020-05-29LibGUI: Fix cursor being out of view after typingFalseHonesty
Previously, if the cursor moved out of the visible area while text was being inserted, the text editor would never scroll the cursor back into view until the arrow keys were pressed to move the cursor. This was caused by the TextEditor's reflow deferral system stopping visual line recomputation until the end of text insertion, so now when reflow deferral is completed, the TextEditor will make sure the cursor is visible.
2020-05-29LibGUI: Fix TextEditor crashing when selecting a blank lineFalseHonesty
Previously, the TextEditor would crash when selecting a line with no codepoints due to a null dereference, so this patch makes sure there is actually any text to render before giving it to the painter.
2020-05-29LibCrypto: Fix some issues preventing compilation w/ clang 10AnotherTest
2020-05-29LibCrypto: Format all files with clang-format 10AnotherTest
2020-05-29LibJS: Integrate labels into the InterpreterMatthew Olsson
The interpreter now considers a statement or block's label when considering whether or not to break. All statements can be labelled.
2020-05-29LibJS: Parse labels in continue and break statementsMatthew Olsson
2020-05-29LibJS: Parse labelled statementsMatthew Olsson
All statements now have an optional label string that can be null.
2020-05-29LibJS: New expressions look for expressions with correct precedenceMatthew Olsson
2020-05-29LibJS: Make Object::invoke() non-constLinus Groh
As suggested in #2431's code review.
2020-05-29LibJS: Add Array.prototype.toLocaleString()Linus Groh
2020-05-29LibJS: Add Object.prototype.toLocaleString()Linus Groh
2020-05-29LibJS: Add Object::invoke()Linus Groh
2020-05-29LibLine: Remove unused header in Span.hEmanuele Torre
2020-05-29Meta: Add a script check the presence of "#pragma once" in header filesEmanuele Torre
.. 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.
2020-05-29LibJS: Fix conditional expression precedenceMatthew Olsson
This fixes the following from parsing incorrectly due to the comma that occurs after the conditional: let o = { foo: true ? 1 : 2, bar: 'baz', };
2020-05-29Kernel+Userland: Support remounting filesystems :^)Sergey Bugaev
This makes it possible to change flags of a mount after the fact, with the caveats outlined in the man page.
2020-05-29LibCore+Inspector: Move RPC sockets to /tmp/rpcSergey Bugaev
We have a hierarchical filesystem, let's make use of it :^)
2020-05-29LibCore: Do not assert that we can start the RPC serverSergey Bugaev
Now that the Shell uses Core::EventLoop, we can't afford to just crash if /tmp is unwritable.
2020-05-29Kernel: Support read-only filesystem mountsSergey Bugaev
This adds support for MS_RDONLY, a mount flag that tells the kernel to disallow any attempts to write to the newly mounted filesystem. As this flag is per-mount, and different mounts of the same filesystems (such as in case of bind mounts) can have different mutability settings, you have to go though a custody to find out if the filesystem is mounted read-only, instead of just asking the filesystem itself whether it's inherently read-only. This also adds a lot of checks we were previously missing; and moves some of them to happen after more specific checks (such as regular permission checks). One outstanding hole in this system is sys$mprotect(PROT_WRITE), as there's no way we can know if the original file description this region has been mounted from had been opened through a readonly mount point. Currently, we always allow such sys$mprotect() calls to succeed, which effectively allows anyone to circumvent the effect of MS_RDONLY. We should solve this one way or another.
2020-05-29Kernel+LibC: Move O_* and MS_* flags to UnixTypes.hSergey Bugaev
That's where the other similar definitions reside. Also, use bit shift operations for MS_* values.
2020-05-29LibJS: Throw in strict mode when assigning property to primitive valueLinus Groh
2020-05-28LibWeb: Add a way to stop the new HTML parserAndreas Kling
Some things are specced to "stop parsing", which basically just means to stop fetching tokens and jump to "The end"
2020-05-28LibWeb: Implement more of the "after body" insertion modeAndreas Kling
2020-05-28LibWeb: Parse comments in the "in body" insertion modeAndreas Kling
2020-05-28LibWeb: Implement a bunch more script-related tokenization statesAndreas Kling
2020-05-28LibWeb: Add HTMLToken::make_character()Andreas Kling
It's tedious to make character tokens manually all the time.
2020-05-28LibWeb: Rename Web::HtmlView => Web::PageViewAndreas Kling
This widget doesn't just view HTML, it views a web page. :^)
2020-05-28LibWeb: Fix HTMLDocumentParser buildAndreas Kling
2020-05-28LibWeb: Remove a misplaced call to close_a_p_element() in "in body"Andreas Kling
This should only be done for the corresponding start tags.
2020-05-28LibWeb: Add a StackOfOpenElements helper for "popping until a tag name"Andreas Kling
2020-05-28LibJS: Implement standard semantics for relational operators (#2417)Marcin Gasperowicz
Previously, the relational operators where casting any value to double and comparing the results according to C++ semantics. This patch makes the relational operators in JS behave according to the standard specification. Since we don't have BigInt yet, the implementation doesn't take it into account. Moved PreferredType from Object to Value. Value::to_primitive now passes preferred_type to Object::to_primitive.
2020-05-28LibJS: Strict mode assignment to 'eval' & 'arguments' is a syntax errorMatthew Olsson
2020-05-28LibJS: Add strict modeMatthew Olsson
Adds the ability for a scope (either a function or the entire program) to be in strict mode. Scopes default to non-strict mode. There are two ways to determine the strict-ness of the JS engine: 1. In the parser, this can be accessed with the parser_state variable m_is_strict_mode boolean. If true, the Parser is currently parsing in strict mode. This is done so that the Parser can generate syntax errors at parse time, which is required in some cases. 2. With Interpreter.is_strict_mode(). This allows strict mode checking at runtime as opposed to compile time. Additionally, in order to test this, a global isStrictMode() function has been added to the JS ReplObject under the test-mode flag.
2020-05-28LibJS: Object index properties have descriptors; Handle sparse indicesMatthew Olsson
This patch adds an IndexedProperties object for storing indexed properties within an Object. This accomplishes two goals: indexed properties now have an associated descriptor, and objects now gracefully handle sparse properties. The IndexedProperties class is a wrapper around two other classes, one for simple indexed properties storage, and one for general indexed property storage. Simple indexed property storage is the common-case, and is simply a vector of properties which all have attributes of default_attributes (writable, enumerable, and configurable). General indexed property storage is for a collection of indexed properties where EITHER one or more properties have attributes other than default_attributes OR there is a property with a large index (in particular, large is '200' or higher). Indexed properties are now treated relatively the same as storage within the various Object methods. Additionally, there is a custom iterator class for IndexedProperties which makes iteration easy. The iterator skips empty values by default, but can be configured otherwise. Likewise, it evaluates getters by default, but can be set not to.
2020-05-28LibJS: Fix out-of-range error in Parser::Error::source_location_hintMatthew Olsson
2020-05-28LibC: run clang-format on getopt.h to remove tab charactersEmanuele Torre
2020-05-28LibWeb: replace some tab characters with spacesEmanuele Torre
also add missing "#pragma once" in StylePropertiesModel.h
2020-05-28LibWeb: Fall back to block layout for unimplemented CSS display valuesAndreas Kling
This seems to have a higher chance of generating somewhat recognizable content compared to inline layout. This problem will gradually go away as we implement more display values.