mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
LibJS: Add symbol objects
This commit adds the following classes: SymbolObject, SymbolConstructor, SymbolPrototype, and Symbol. This commit does not introduce any new functionality to the Object class, so they cannot be used as property keys in objects.
This commit is contained in:
parent
b5b08fba92
commit
4ced126704
21 changed files with 819 additions and 3 deletions
|
@ -36,6 +36,7 @@
|
|||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibJS/Runtime/Reference.h>
|
||||
#include <LibJS/Runtime/Shape.h>
|
||||
#include <LibJS/Runtime/SymbolObject.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
namespace JS {
|
||||
|
@ -195,6 +196,8 @@ void Interpreter::gather_roots(Badge<Heap>, HashTable<Cell*>& roots)
|
|||
}
|
||||
roots.set(call_frame.environment);
|
||||
}
|
||||
|
||||
SymbolObject::gather_symbol_roots(roots);
|
||||
}
|
||||
|
||||
Value Interpreter::call(Function& function, Value this_value, Optional<MarkedValueList> arguments)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue