MCPcopy Create free account
hub / github.com/OpenWebCAD/node-occ / installProxyMethods

Method installProxyMethods

lib/fastbuilder.js:49–71  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

47
48
49 installProxyMethods(obj) {
50
51 // xx console.log("xxx in installProxyMethods on",obj.constructor.name);
52 assert(!!obj);
53
54 const prototype = obj.constructor.prototype;
55
56 const functionToOverride = Object.keys(prototype).filter(n => typeof prototype[n] === "function");
57
58 // ---------------- old
59 const that = this;
60 functionToOverride.forEach((funcName) => {
61
62 if (funcName === "toString") {
63 return;
64 }
65 // xx console.log("xxx in installProxyMethods replaceObjectMethod",func_name);
66 that.replaceObjectMethod(obj, funcName);
67
68 });
69
70
71 }
72
73 prepareObject(obj, cmd, uuid, index) {
74

Callers 1

prepareObjectMethod · 0.95

Calls 1

replaceObjectMethodMethod · 0.80

Tested by

no test coverage detected