fix ts iterations

This commit is contained in:
Anton Lavrenov
2020-10-12 08:49:18 -05:00
parent 58f18c268a
commit 64373c7eac
4 changed files with 52 additions and 1323 deletions

View File

@@ -2280,7 +2280,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
}
}
_getListeners(eventType) {
_getProtoListeners(eventType) {
let listeners = this._cache.get(ALL_LISTENERS);
// if no cache for listeners, we need to pre calculate it
if (!listeners) {
@@ -2309,7 +2309,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
evt.currentTarget = this;
evt.type = eventType;
const topListeners = this._getListeners(eventType);
const topListeners = this._getProtoListeners(eventType);
if (topListeners) {
for (var i = 0; i < topListeners.length; i++) {
topListeners[i].handler.call(this, evt);

View File

@@ -18,6 +18,8 @@ import { IRect, RGB, RGBA, Vector2d } from './types';
export class Collection<Child extends Node> {
[index: number]: Child;
// @ts-ignore
[Symbol.iterator](): Iterator<T>;
// @ts-ignore
length: number;
// @ts-ignore