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