(cm, f)
| 3924 | } |
| 3925 | // Wraps a function in an operation. Returns the wrapped function. |
| 3926 | function operation(cm, f) { |
| 3927 | return function() { |
| 3928 | if (cm.curOp) { return f.apply(cm, arguments) } |
| 3929 | startOperation(cm); |
| 3930 | try { return f.apply(cm, arguments) } |
| 3931 | finally { endOperation(cm); } |
| 3932 | } |
| 3933 | } |
| 3934 | // Used to add methods to editor and doc instances, wrapping them in |
| 3935 | // operations. |
| 3936 | function methodOp(f) { |
no test coverage detected