mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the namespace change, we now have the following names: * JS::NonnullGCPtr -> GC::Ref * JS::GCPtr -> GC::Ptr * JS::HeapFunction -> GC::Function * JS::CellImpl -> GC::Cell * JS::Handle -> GC::Root
This commit is contained in:
committed by
Andreas Kling
parent
ce23efc5f6
commit
f87041bf3a
Notes:
github-actions[bot]
2024-11-15 13:50:17 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/f87041bf3a8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2345
@@ -14,10 +14,10 @@
|
||||
|
||||
namespace JS {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(StringObject);
|
||||
GC_DEFINE_ALLOCATOR(StringObject);
|
||||
|
||||
// 10.4.3.4 StringCreate ( value, prototype ), https://tc39.es/ecma262/#sec-stringcreate
|
||||
NonnullGCPtr<StringObject> StringObject::create(Realm& realm, PrimitiveString& primitive_string, Object& prototype)
|
||||
GC::Ref<StringObject> StringObject::create(Realm& realm, PrimitiveString& primitive_string, Object& prototype)
|
||||
{
|
||||
// 1. Let S be MakeBasicObject(« [[Prototype]], [[Extensible]], [[StringData]] »).
|
||||
// 2. Set S.[[Prototype]] to prototype.
|
||||
@@ -128,12 +128,12 @@ ThrowCompletionOr<bool> StringObject::internal_define_own_property(PropertyKey c
|
||||
}
|
||||
|
||||
// 10.4.3.3 [[OwnPropertyKeys]] ( ), https://tc39.es/ecma262/#sec-string-exotic-objects-ownpropertykeys
|
||||
ThrowCompletionOr<MarkedVector<Value>> StringObject::internal_own_property_keys() const
|
||||
ThrowCompletionOr<GC::MarkedVector<Value>> StringObject::internal_own_property_keys() const
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 1. Let keys be a new empty List.
|
||||
auto keys = MarkedVector<Value> { heap() };
|
||||
auto keys = GC::MarkedVector<Value> { heap() };
|
||||
|
||||
// 2. Let str be O.[[StringData]].
|
||||
auto str = m_string->utf16_string_view();
|
||||
|
||||
Reference in New Issue
Block a user