Files
tsgo/testdata/baselines/reference/submodule/conformance/for-of17.js

34 lines
612 B
TypeScript

//// [tests/cases/conformance/es6/for-ofStatements/for-of17.ts] ////
//// [for-of17.ts]
class NumberIterator {
next() {
return {
value: 0,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
var v: string;
for (v of new NumberIterator) { } // Should succeed
//// [for-of17.js]
"use strict";
class NumberIterator {
next() {
return {
value: 0,
done: false
};
}
[Symbol.iterator]() {
return this;
}
}
var v;
for (v of new NumberIterator) { } // Should succeed