TypeScript/tests/baselines/reference/ES5For-of34.js
2019-08-06 10:46:17 -07:00

38 lines
1 KiB
TypeScript

//// [ES5For-of34.ts]
function foo() {
return { x: 0 };
}
for (foo().x of ['a', 'b', 'c']) {
var p = foo().x;
}
//// [ES5For-of34.js]
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var e_1, _a;
function foo() {
return { x: 0 };
}
try {
for (var _b = __values(['a', 'b', 'c']), _c = _b.next(); !_c.done; _c = _b.next()) {
foo().x = _c.value;
var p = foo().x;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
//# sourceMappingURL=ES5For-of34.js.map