[touch-events] Index TouchList as array

myTouchList[123] is allowed as an alias for myTouchList.item(123).

https://developer.mozilla.org/en-US/docs/Web/API/TouchList
and
http://www.w3.org/TR/touch-events/#idl-def-TouchList
This commit is contained in:
Hraban Luyat 2014-12-26 21:52:44 +01:00
parent 0b6a5fb4e0
commit b2a9fc564e
2 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@ flag = touchEvent.shiftKey;
var len:number = list.length;
touch = list.item(0);
touch == list[0];
var x: number;
var y: number;

View File

@ -16,6 +16,7 @@ interface TouchEvent extends UIEvent {
interface TouchList {
length: number;
item: (index: number) => Touch;
[index: number]: Touch;
}
interface Touch {