(cm, f)
| 1975 | } |
| 1976 | // Wraps a function in an operation. Returns the wrapped function. |
| 1977 | function operation(cm, f) { |
| 1978 | return function() { |
| 1979 | if (cm.curOp) return f.apply(cm, arguments); |
| 1980 | startOperation(cm); |
| 1981 | try { return f.apply(cm, arguments); } |
| 1982 | finally { endOperation(cm); } |
| 1983 | }; |
| 1984 | } |
| 1985 | // Used to add methods to editor and doc instances, wrapping them in |
| 1986 | // operations. |
| 1987 | function methodOp(f) { |
no test coverage detected
searching dependent graphs…