TypeScript/tests/baselines/reference/for-of21.js
Jason Freeman 3de73e6a1f Merge branch 'master' of https://github.com/Microsoft/TypeScript into for-ofES6
Conflicts:
	src/compiler/checker.ts
	tests/baselines/reference/constDeclarations-errors.errors.txt
2015-02-28 16:30:10 -08:00

41 lines
735 B
JavaScript

//// [for-of21.ts]
for (const v of new FooIterator) {
v;
}
class Foo { }
class FooIterator {
next() {
return {
value: new Foo,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
//// [for-of21.js]
for (const v of new FooIterator) {
v;
}
var Foo = (function () {
function Foo() {
}
return Foo;
})();
var FooIterator = (function () {
function FooIterator() {
}
FooIterator.prototype.next = function () {
return {
value: new Foo,
done: false
};
};
FooIterator.prototype[Symbol.iterator] = function () {
return this;
};
return FooIterator;
})();