(mode, state)
| 774 | } |
| 775 | |
| 776 | function copyState(mode, state) { |
| 777 | if (state === true) { return state } |
| 778 | if (mode.copyState) { return mode.copyState(state) } |
| 779 | var nstate = {}; |
| 780 | for (var n in state) { |
| 781 | var val = state[n]; |
| 782 | if (val instanceof Array) { val = val.concat([]); } |
| 783 | nstate[n] = val; |
| 784 | } |
| 785 | return nstate |
| 786 | } |
| 787 | |
| 788 | // Given a mode and a state (for that mode), find the inner mode and |
| 789 | // state at the position that the state refers to. |
no outgoing calls
no test coverage detected