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