用委托替换超类

refactorgram

class List {...}
class Stack extends List {...}

image/svg+xml

class Stack {
  constructor() {
    this._storage = new List();
  }
}
class List {...}

别名 用委托替换继承