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

Function operation

static/js/codemirror/codemirror.js:1287–1295  ·  view source on GitHub ↗
(cm1, f)

Source from the content-addressed store, hash-verified

1285
1286 // Wraps a function in an operation. Returns the wrapped function.
1287 function operation(cm1, f) {
1288 return function() {
1289 var cm = cm1 || this, withOp = !cm.curOp;
1290 if (withOp) startOperation(cm);
1291 try { var result = f.apply(cm, arguments); }
1292 finally { if (withOp) endOperation(cm); }
1293 return result;
1294 };
1295 }
1296 function docOperation(f) {
1297 return function() {
1298 var withOp = this.cm && !this.cm.curOp, result;

Callers 12

CodeMirrorFunction · 0.85
highlightWorkerFunction · 0.85
registerEventHandlersFunction · 0.85
onMouseDownFunction · 0.85
extendFunction · 0.85
onKeyPressFunction · 0.85
onContextMenuFunction · 0.85
pollFunction · 0.85
makeChangeFunction · 0.85
makeChangeSingleDocFunction · 0.85
codemirror.jsFile · 0.85
markTextFunction · 0.85

Calls 3

startOperationFunction · 0.85
endOperationFunction · 0.85
applyMethod · 0.45

Tested by

no test coverage detected