解决办法:
将if (this.hasOwnProperty(k)) {
改为:
if (this.hasOwnProperty && this.hasOwnProperty(k)) {
就可以解决问题了。