classCircle{draw(){
console.log('画一个圆形')}}classDecorator{constructor(circle){this.circle = circle
}draw(){this.circle.draw()this.setRedBorder(circle)}setRedBorder(circle){
console.log('设置红色边框')}}// 测试let circle =newCircle()
circle.draw()let dec =newDecorator(circle)
dec.draw()
let person =newPerson();
person.facepalm();// DEPRECATION Person#facepalm: This function will be removed in future versions.
person.facepalmHard();// DEPRECATION Person#facepalmHard: We stopped facepalming
person.facepalmHarder();// DEPRECATION Person#facepalmHarder: We stopped facepalming// See http://knowyourmeme.com/memes/facepalm for more details.