mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibJS: Add PropertyLookupPhase enum to distinguish Object [[Get]] calls
We can now tell the difference between an own property access and a subsequent (automatic) prototype chain access. This will be used to implement caching of prototype chain accesses.
This commit is contained in:
@@ -137,14 +137,14 @@ ThrowCompletionOr<bool> ModuleNamespaceObject::internal_has_property(PropertyKey
|
||||
}
|
||||
|
||||
// 10.4.6.8 [[Get]] ( P, Receiver ), https://tc39.es/ecma262/#sec-module-namespace-exotic-objects-get-p-receiver
|
||||
ThrowCompletionOr<Value> ModuleNamespaceObject::internal_get(PropertyKey const& property_key, Value receiver, CacheablePropertyMetadata* cacheable_metadata) const
|
||||
ThrowCompletionOr<Value> ModuleNamespaceObject::internal_get(PropertyKey const& property_key, Value receiver, CacheablePropertyMetadata* cacheable_metadata, PropertyLookupPhase phase) const
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 1. If Type(P) is Symbol, then
|
||||
if (property_key.is_symbol()) {
|
||||
// a. Return ! OrdinaryGet(O, P, Receiver).
|
||||
return MUST(Object::internal_get(property_key, receiver, cacheable_metadata));
|
||||
return MUST(Object::internal_get(property_key, receiver, cacheable_metadata, phase));
|
||||
}
|
||||
|
||||
// 2. Let exports be O.[[Exports]].
|
||||
|
||||
Reference in New Issue
Block a user