- ReturnIfAbrupt(V).
- If Type(V) is not Reference, return V.
- If IsUnresolvableReference(V) is true, throw a ReferenceError exception.
- Let base be GetBase(V).
- If HasPrimitiveBase(V) is true, Set base to !ToObject(base)
- If IsPropertyReference(V) is true, Return ? base.[[Get]](GetReferencedName(V), Receiver = GetThisValue(V)).
- Return ? base.GetBindingValue(GetReferencedName(V), IsStrictReference(V))
note If IsSuperReference(V), GetThisValue(V) returns the thisValue component of the reference V; else returns GetBase(V).
abstract operation O.[[Get]](P, Receiver) works as:
- Let desc be ? O.[[GetOwnProperty]](P).
- If desc is undefined, Return ?O.[[Prototype]].[[Get]](P, Receiver).
- If IsDataDescriptor(desc) is true, return desc.[[Value]].
- Return ? Call(desc.[[Get]], Receiver)// Receiver is only used by AccessorDescriptor
above all
- super is parent and super.super is grandpa
- desc.[[Get]] can accept base, base.super, base.super.super... as Receiver
- refer to new.target for more info regarding the super keyword
No comments:
Post a Comment