1
Fork 0
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:
mattco98 2020-04-29 23:25:21 -07:00 committed by Andreas Kling
parent b5b08fba92
commit 4ced126704
21 changed files with 819 additions and 3 deletions

View file

@ -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)