mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
28 lines
474 B
TypeScript
28 lines
474 B
TypeScript
//// [tests/cases/conformance/es6/for-ofStatements/for-of26.ts] ////
|
|
|
|
//// [for-of26.ts]
|
|
class MyStringIterator {
|
|
next() {
|
|
return x;
|
|
}
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
var x: any;
|
|
for (var v of new MyStringIterator) { }
|
|
|
|
//// [for-of26.js]
|
|
"use strict";
|
|
class MyStringIterator {
|
|
next() {
|
|
return x;
|
|
}
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
var x;
|
|
for (var v of new MyStringIterator) { }
|