diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/robertkrimen/otto/stash.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/robertkrimen/otto/stash.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/robertkrimen/otto/stash.go b/Godeps/_workspace/src/github.com/robertkrimen/otto/stash.go index 578708d3f..0d3ffa511 100644 --- a/Godeps/_workspace/src/github.com/robertkrimen/otto/stash.go +++ b/Godeps/_workspace/src/github.com/robertkrimen/otto/stash.go @@ -273,3 +273,24 @@ func (in *_fnStash) clone(clone *_clone) _stash { } return out } + +func getStashProperties(stash _stash) (keys []string) { + switch vars := stash.(type) { + case *_dclStash: + for k := range vars.property { + keys = append(keys, k) + } + case *_fnStash: + for k := range vars.property { + keys = append(keys, k) + } + case *_objectStash: + for k := range vars.object.property { + keys = append(keys, k) + } + default: + panic("unknown stash type") + } + + return +} |