MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / copyState

Function copyState

static/js/codemirror/codemirror.js:3075–3085  ·  view source on GitHub ↗
(mode, state)

Source from the content-addressed store, hash-verified

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) {

Callers 2

highlightWorkerFunction · 0.85
getStateBeforeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected