(subscription)
| 128 | // TODO(qard): should there be a C++ channel interface? |
| 129 | class ActiveChannel { |
| 130 | subscribe(subscription) { |
| 131 | validateFunction(subscription, 'subscription'); |
| 132 | this._subscribers = ArrayPrototypeSlice(this._subscribers); |
| 133 | ArrayPrototypePush(this._subscribers, subscription); |
| 134 | channels.incRef(this.name); |
| 135 | if (this._index !== undefined) subscriberCounts[this._index]++; |
| 136 | } |
| 137 | |
| 138 | unsubscribe(subscription) { |
| 139 | const index = ArrayPrototypeIndexOf(this._subscribers, subscription); |