Rename GetPropertyPointer to GetPropertyAddr

This change mirrors the same change we made for local variable scope
addressing.  GetPropertyPointer is all about getting the property's
address; instead of GetPropertyPointer, which could be confused as
meaning the property's value is a pointer, we will call this method
GetPropertyAddr instead.
This commit is contained in:
joeduffy 2017-01-28 10:54:16 -08:00
parent 5336122511
commit f050b567aa
2 changed files with 4 additions and 4 deletions

View file

@ -704,7 +704,7 @@ func (e *evaluator) evalObjectLiteral(node *ast.ObjectLiteral) (*Object, *Unwind
return nil, uw
}
member := init.Property.Tok.Name()
obj.GetPropertyPointer(member.Name(), true).Set(val)
obj.GetPropertyAddr(member.Name(), true).Set(val)
}
}
@ -741,7 +741,7 @@ func (e *evaluator) evalLoadLocationExpressionFor(node *ast.LoadLocationExpressi
case *symbols.ClassProperty:
// Search the class's properties and, if not present, allocate a new one.
contract.Assert(this != nil)
pv = this.GetPropertyPointer(sym.Name(), true)
pv = this.GetPropertyAddr(sym.Name(), true)
ty = s.Type()
case *symbols.ClassMethod:
// Create a new readonly ref slot, pointing to the method, that will abandon if overwritten.

View file

@ -150,9 +150,9 @@ func (o *Object) PointerValue() *Pointer {
return r
}
// GetPropertyPointer returns the reference to an object's property, lazily initializing if 'init' is true, or
// GetPropertyAddr returns the reference to an object's property, lazily initializing if 'init' is true, or
// returning nil otherwise.
func (o *Object) GetPropertyPointer(nm tokens.Name, init bool) *Pointer {
func (o *Object) GetPropertyAddr(nm tokens.Name, init bool) *Pointer {
ref, has := o.Properties[nm]
if !has {
ref = &Pointer{}