MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / overrideMethod

Function overrideMethod

libs/htmlwidgets-1.5.3/htmlwidgets.js:70–76  ·  view source on GitHub ↗
(target, methodName, funcSource)

Source from the content-addressed store, hash-verified

68 // method can be called like a regular function, it has the target permanently
69 // bound to it so "this" will work correctly.
70 function overrideMethod(target, methodName, funcSource) {
71 var superFunc = target[methodName] || function() {};
72 var superFuncBound = function() {
73 return superFunc.apply(target, arguments);
74 };
75 target[methodName] = funcSource(superFuncBound);
76 }
77
78 // Add a method to delegator that, when invoked, calls
79 // delegatee.methodName. If there is no such method on

Callers 1

htmlwidgets.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected