Skip to content

Commit

Permalink
rename GetPropertyNames to GetEnumerablePropertyNames
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Jan 11, 2022
1 parent b70d63b commit 97bce5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion object.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (o *Object) SetIdx(idx uint32, val interface{}) error {

// Returns an array containing the names of the enumerable properties of this object,
// including properties from prototype objects
func (o *Object) GetPropertyNames() []string {
func (o *Object) GetEnumerablePropertyNames() []string {
rtn := C.ObjectGetPropertyNames(o.ptr)
return valueStrings(o.ctx, rtn)
}
Expand Down
4 changes: 2 additions & 2 deletions object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func TestObjectDelete(t *testing.T) {

}

func TestObjectGetPropertyNames(t *testing.T) {
func TestGetEnumerablePropertyNames(t *testing.T) {
t.Parallel()

ctx := v8.NewContext()
Expand All @@ -204,7 +204,7 @@ func TestObjectGetPropertyNames(t *testing.T) {
obj.Set("hello", "world")

expectedProperties := []string{"bar2", "foo", "hello"}
properties := obj.GetPropertyNames()
properties := obj.GetEnumerablePropertyNames()

if !reflect.DeepEqual(properties, expectedProperties) {
t.Error("properteis are not the same")
Expand Down

0 comments on commit 97bce5a

Please sign in to comment.