2015-03-26 01:36:47 +01:00
|
|
|
//// [iterableArrayPattern19.ts]
|
|
|
|
function fun([[a], b]: Bar[][]) { }
|
|
|
|
fun(new FooArrayIterator);
|
|
|
|
class Bar { x }
|
|
|
|
class Foo extends Bar { y }
|
|
|
|
class FooArrayIterator {
|
|
|
|
next() {
|
|
|
|
return {
|
|
|
|
value: [new Foo],
|
|
|
|
done: false
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
[Symbol.iterator]() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [iterableArrayPattern19.js]
|
2015-04-09 01:41:56 +02:00
|
|
|
function fun([[a], b]) { }
|
2015-03-26 01:36:47 +01:00
|
|
|
fun(new FooArrayIterator);
|
|
|
|
class Bar {
|
|
|
|
}
|
|
|
|
class Foo extends Bar {
|
|
|
|
}
|
|
|
|
class FooArrayIterator {
|
|
|
|
next() {
|
|
|
|
return {
|
2015-04-09 01:41:56 +02:00
|
|
|
value: [new Foo],
|
2015-03-26 01:36:47 +01:00
|
|
|
done: false
|
|
|
|
};
|
|
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|