(mode, state)
| 3073 | // Utility functions for working with state. Exported because modes |
| 3074 | // sometimes need to do this. |
| 3075 | function copyState(mode, state) { |
| 3076 | if (state === true) return state; |
| 3077 | if (mode.copyState) return mode.copyState(state); |
| 3078 | var nstate = {}; |
| 3079 | for (var n in state) { |
| 3080 | var val = state[n]; |
| 3081 | if (val instanceof Array) val = val.concat([]); |
| 3082 | nstate[n] = val; |
| 3083 | } |
| 3084 | return nstate; |
| 3085 | } |
| 3086 | CodeMirror.copyState = copyState; |
| 3087 | |
| 3088 | function startState(mode, a1, a2) { |
no outgoing calls
no test coverage detected