(cm, f)
| 3171 | |
| 3172 | // Run the given function in an operation |
| 3173 | function runInOp(cm, f) { |
| 3174 | if (cm.curOp) return f(); |
| 3175 | startOperation(cm); |
| 3176 | try { return f(); } |
| 3177 | finally { endOperation(cm); } |
| 3178 | } |
| 3179 | // Wraps a function in an operation. Returns the wrapped function. |
| 3180 | function operation(cm, f) { |
| 3181 | return function() { |
no test coverage detected