第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

按源代碼復(fù)制 執(zhí)行報錯, 求解答

http://img1.sycdn.imooc.com//5df367f60001cb1405630125.jpg

//=實戰(zhàn)?探測器
!function(global)?{
function?DetectorBase(configs)?{
if?(!this?instanceof?DetectorBase)?{
throw?new?Error('Do?not?invoke?without?new.');
}
this.configs?=?configs;
this.analyze();
}
DetectorBase.prototype.dectect?=?function?()?{
throw?new?Error('Not?implemented!');
}
DetectorBase.prototype.analyze?=?function()?{
console.log('analyzing...');
this.data?=?'###data###';
}
function?LinkDetector(links)?{
if?(!this?instanceof?LinkDetector)?{
throw?new?Error('Do?not?invoke?without?new.');
}
this.links?=?links;
DetectorBase.apply(this,?arguments);
}
function?ContainerDetetor(containers)?{
if?(!this?instanceof?ContainerDetetor)?{
throw?new?Error('Do?not?invoke?without?new.');
}
this.containers?=?containers;
DetectorBase.apply(this,?arguments);
}
//inherit?first
inherit(LinkDetector,?DetectorBase);
inherit(ContainerDetetor,?DetectorBase);
//expand?later
LinkDetector.prototype.dectect?=?function()?{
console.log('Loading?data:'?+?this.data);
console.log('Link?detection?started');
console.log('Scanding?links:'?+?this.links);
}
ContainerDetetor.prototype.dectect?=?function()?{
console.log('Loading?data:'?+?this.data);
console.log('containers?detection?started');
console.log('Scanding?containers:'?+?this.containers);
}
//prevent?from?being?altered
Object.freeze(DetectorBase);
Object.freeze(DetectorBase.prototype);
Object.freeze(LinkDetector);
Object.freeze(LinkDetector.prototype);
Object.freeze(ContainerDetetor);
Object.freeze(ContainerDetetor.prototype);
//export?to?global?object
Object.defineProperties(global,?{
LinkDetector:{value:?LinkDetector},
ContainerDetetor:{value:?ContainerDetetor},
DetectorBase:{value:?DetectorBase}
});
function?inherit(subClass,?superClass)?{
superClass.prototype?=?Object.create(superClass.prototype);
superClass.prototype.constructor?=?subClass;
}
}(this);
var?cd?=?new?ContainerDetetor('#abc?#def?#ghi');
var?ld?=?new?LinkDetector('https://www.taobao.com/?https://www.tmall.com/?https://www.baidu.com/');
cd.dectect();
ld.dectect();


正在回答

1 回答

function?inherit(subClass,?superClass)?{

????????????superClass.prototype?=?Object.create(superClass.prototype);

????????????superClass.prototype.constructor?=?subClass;

????????}

寫錯了? 應(yīng)該為

subClass.prototype?=?Object.create(superClass.prototype);

subClass.prototype.constructor?=?subClass;

注意形參


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

按源代碼復(fù)制 執(zhí)行報錯, 求解答

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號