MCPcopy
hub / github.com/cujojs/when / replace

Function replace

test/monitor/unhandledRejectionApi-test.js:7–13  ·  view source on GitHub ↗
(target, method, replacement)

Source from the content-addressed store, hash-verified

5var Promise = require('../../lib/Promise');
6
7function replace(target, method, replacement) {
8 var tmp = target[method];
9 target[method] = function() {
10 target[method] = tmp;
11 return replacement.apply(this, arguments);
12 };
13}
14
15buster.testCase('when/unhandledRejectionApi', {
16

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…