summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Runtime/RegExpConstructor.cpp
AgeCommit message (Collapse)Author
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling
2020-11-28LibJS: Make RegExp() constructor spec-compliantLinus Groh
- Default values should depend on arguments being undefined, not being missing - "(?:)" for empty pattern happens in RegExp.prototype.source, not the constructor
2020-11-27LibJS+js: Rename RegExp.{content => pattern}AnotherTest
The spec talks about it as 'pattern', so let's use that instead.
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-09-27LibJS: Remove a whole bunch of includes of <LibJS/Interpreter.h>Andreas Kling
2020-09-27LibJS: Remove Interpreter& argument to Function::construct()Andreas Kling
This is no longer needed, we can get everything we need from the VM.
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: Make Function::call() not require an Interpreter&Andreas Kling
This makes a difference inside ScriptFunction::call(), which will now instantiate a temporary Interpreter if one is not attached to the VM.
2020-07-23LibJS: Simplify Cell::initialize()Andreas Kling
Remove the Interpreter& argument and pass only GlobalObject&. We can find everything we need via the global object anyway.
2020-07-01LibJS: Explicitly pass a "Function& new_target" to Function::constructMatthew Olsson
This allows the proxy handler to pass the proper new.target to construct handlers.
2020-06-20LibJS: Object::initialize() overrides must always call base classAndreas Kling
2020-06-20LibJS: Move native objects towards two-pass constructionAndreas Kling
To make sure that everything is set up correctly in objects before we start adding properties to them, we split cell allocation into 3 steps: 1. Allocate a cell of appropriate size from the Heap 2. Call the C++ constructor on the cell 3. Call initialize() on the constructed object The job of initialize() is to define all the initial properties. Doing it in a second pass guarantees that the Object has a valid Shape and can find its own GlobalObject.
2020-06-08LibJS+LibWeb: Remove a bunch of calls to Interpreter::global_object()Andreas Kling
Objects should get the GlobalObject from themselves instead. However, it's not yet available during construction so this only switches code that happens after construction. To support multiple global objects, Interpreter needs to stop holding on to "the" global object and let each object graph own their global.
2020-06-07LibJS: Lex and parse regex literals, add RegExp objectsMatthew Olsson
This adds regex parsing/lexing, as well as a relatively empty RegExpObject. The purpose of this patch is to allow the engine to not get hung up on parsing regexes. This will aid in finding new syntax errors (say, from google or twitter) without having to replace all of their regexes first!