MCPcopy
hub / github.com/csev/py4e / copyState

Function copyState

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:2365–2375  ·  view source on GitHub ↗
(mode, state)

Source from the content-addressed store, hash-verified

2363 // Utility functions for working with state. Exported because modes
2364 // sometimes need to do this.
2365 function copyState(mode, state) {
2366 if (state === true) return state;
2367 if (mode.copyState) return mode.copyState(state);
2368 var nstate = {};
2369 for (var n in state) {
2370 var val = state[n];
2371 if (val instanceof Array) val = val.concat([]);
2372 nstate[n] = val;
2373 }
2374 return nstate;
2375 }
2376 CodeMirror.copyState = copyState;
2377 function startState(mode, a1, a2) {
2378 return mode.startState ? mode.startState(a1, a2) : true;

Callers 5

getStateBeforeFunction · 0.70
highlightLinesFunction · 0.70
highlightWorkerFunction · 0.70
highlightWorkerFunction · 0.70
getStateBeforeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected