oojs
oojs copied to clipboard
第6章 继承--6.3 uber—子对象访问父对象的方式
P182 var const = this.constructor; return const.uber ? this.const.uber.toString() + ', ' + this.name : this.name;
=>(Uncaught TypeError: Cannot read property 'uber' of undefined)
var result = []; if(this.constructor.uber){ result[result.length] = this.constructor.uber.toString(); } result[result.length] = this.name; return result.join(',');