Open EdwardZZZ opened 6 years ago
class A { onLoad() { // TODO;;;; console.log(111); } } const a = new A(); // const onLoad = A.prototype.onLoad.toString().replace(/[\r|\t|\n]/g, ''); const onLoad = A.prototype.onLoad.toString().match(/\{([\s\S]*)\}$/i)[1]; console.log(onLoad); const newOnLoad = new Function(onLoad); newOnLoad();