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

Method keys

proxy.go:765–787  ·  view source on GitHub ↗
(all bool, _ []Value)

Source from the content-addressed store, hash-verified

763}
764
765func (p *proxyObject) keys(all bool, _ []Value) []Value {
766 if v, ok := p.proxyOwnKeys(); ok {
767 if !all {
768 k := 0
769 for i, key := range v {
770 prop := p.val.getOwnProp(key)
771 if prop == nil || prop == _undefined {
772 continue
773 }
774 if prop, ok := prop.(*valueProperty); ok && !prop.enumerable {
775 continue
776 }
777 if k != i {
778 v[k] = v[i]
779 }
780 k++
781 }
782 v = v[:k]
783 }
784 return v
785 }
786 return p.target.self.keys(all, nil)
787}
788
789func (p *proxyObject) proxyOwnKeys() ([]Value, bool) {
790 target := p.target

Callers 1

iterateKeysMethod · 0.95

Calls 3

proxyOwnKeysMethod · 0.95
getOwnPropMethod · 0.80
keysMethod · 0.65

Tested by

no test coverage detected