1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibJS: Start implementing ShadowRealm

This commit adds the ShadowRealm object itself, its constructor, and
prototype (currently empty).
This commit is contained in:
Linus Groh 2021-10-13 21:09:45 +01:00
parent 50f8755792
commit d40331ef69
10 changed files with 216 additions and 0 deletions

View file

@ -9,6 +9,20 @@
namespace JS {
ShadowRealm::ShadowRealm(Realm& shadow_realm, ExecutionContext execution_context, Object& prototype)
: Object(prototype)
, m_shadow_realm(shadow_realm)
, m_execution_context(move(execution_context))
{
}
void ShadowRealm::visit_edges(Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(&m_shadow_realm);
}
// 3.1.3 GetWrappedValue ( callerRealm, value ), https://tc39.es/proposal-shadowrealm/#sec-getwrappedvalue
ThrowCompletionOr<Value> get_wrapped_value(GlobalObject& global_object, Realm& caller_realm, Value value)
{