refactor objects
This commit is contained in:
@@ -25,12 +25,12 @@ func (m Module) Inspect() string {
|
||||
}
|
||||
|
||||
func (m Module) Get(index Object) (Object, error) {
|
||||
key, ok := index.(Hashable)
|
||||
key, ok := index.(Hasher)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("invalid module attribute %s", index.Type())
|
||||
}
|
||||
|
||||
attr, found := m.Attrs.(*Hash).Pairs[key.HashKey()]
|
||||
attr, found := m.Attrs.(*Hash).Pairs[key.Hash()]
|
||||
if !found {
|
||||
return Null{}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user