(cm, f)
| 3062 | |
| 3063 | // Run the given function in an operation |
| 3064 | function runInOp(cm, f) { |
| 3065 | if (cm.curOp) return f(); |
| 3066 | startOperation(cm); |
| 3067 | try { return f(); } |
| 3068 | finally { endOperation(cm); } |
| 3069 | } |
| 3070 | // Wraps a function in an operation. Returns the wrapped function. |
| 3071 | function operation(cm, f) { |
| 3072 | return function() { |
no test coverage detected