(cm, f)
| 1954 | |
| 1955 | // Run the given function in an operation |
| 1956 | function runInOp(cm, f) { |
| 1957 | if (cm.curOp) return f(); |
| 1958 | startOperation(cm); |
| 1959 | try { return f(); } |
| 1960 | finally { endOperation(cm); } |
| 1961 | } |
| 1962 | // Wraps a function in an operation. Returns the wrapped function. |
| 1963 | function operation(cm, f) { |
| 1964 | return function() { |
no test coverage detected