(mode, state)
| 3523 | // Utility functions for working with state. Exported because modes |
| 3524 | // sometimes need to do this. |
| 3525 | function copyState(mode, state) { |
| 3526 | if (state === true) return state; |
| 3527 | if (mode.copyState) return mode.copyState(state); |
| 3528 | var nstate = {}; |
| 3529 | for (var n in state) { |
| 3530 | var val = state[n]; |
| 3531 | if (val instanceof Array) val = val.concat([]); |
| 3532 | nstate[n] = val; |
| 3533 | } |
| 3534 | return nstate; |
| 3535 | } |
| 3536 | CodeMirror.copyState = copyState; |
| 3537 | |
| 3538 | function startState(mode, a1, a2) { |
no outgoing calls
no test coverage detected