MCPcopy Create free account
hub / github.com/dop251/goja / Keys

Method Keys

value.go:819–829  ·  view source on GitHub ↗

Keys returns a list of Object's enumerable keys. This method will panic with an *Exception if a JavaScript exception is thrown in the process. Use Runtime.Try to catch these.

()

Source from the content-addressed store, hash-verified

817// Keys returns a list of Object's enumerable keys.
818// This method will panic with an *Exception if a JavaScript exception is thrown in the process. Use Runtime.Try to catch these.
819func (o *Object) Keys() (keys []string) {
820 iter := &enumerableIter{
821 o: o,
822 wrapped: o.self.iterateStringKeys(),
823 }
824 for item, next := iter.next(); next != nil; item, next = next() {
825 keys = append(keys, item.name.String())
826 }
827
828 return
829}
830
831// GetOwnPropertyNames returns a list of all own string properties of the Object, similar to Object.getOwnPropertyNames()
832// This method will panic with an *Exception if a JavaScript exception is thrown in the process. Use Runtime.Try to catch these.

Callers

nothing calls this directly

Calls 3

nextMethod · 0.95
iterateStringKeysMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected