MCPcopy Index your code
hub / github.com/deployd/deployd / checkWrappedMethod

Function checkWrappedMethod

test-app/public/sinon.js:3597–3617  ·  view source on GitHub ↗
(wrappedMethod)

Source from the content-addressed store, hash-verified

3595 }
3596
3597 function checkWrappedMethod(wrappedMethod) {
3598 var error;
3599
3600 if (!isFunction(wrappedMethod)) {
3601 error = new TypeError(
3602 "Attempted to wrap " + typeof wrappedMethod + " property " + valueToString(property) + " as function"
3603 );
3604 } else if (wrappedMethod.restore && wrappedMethod.restore.sinon) {
3605 error = new TypeError("Attempted to wrap " + valueToString(property) + " which is already wrapped");
3606 } else if (wrappedMethod.calledBefore) {
3607 var verb = wrappedMethod.returns ? "stubbed" : "spied on";
3608 error = new TypeError("Attempted to wrap " + valueToString(property) + " which is already " + verb);
3609 }
3610
3611 if (error) {
3612 if (wrappedMethod && wrappedMethod.stackTraceError) {
3613 error.stack += "\n--------------\n" + wrappedMethod.stackTraceError.stack;
3614 }
3615 throw error;
3616 }
3617 }
3618
3619 var error, wrappedMethod, i, wrappedMethodDesc;
3620

Callers 2

simplePropertyAssignmentFunction · 0.85
sinon.jsFile · 0.85

Calls 2

valueToStringFunction · 0.85
isFunctionFunction · 0.70

Tested by

no test coverage detected