TypeScript/tests/baselines/reference/noCrashOnNoLib.js
Ron Buckton 44ec8ddaee
Fix array spread with sideeffects (#41523)
* Fix array spread with sideeffects

* Minor cleanup, ensure multiple emit helpers for outfile tests
2021-01-05 17:24:21 -08:00

24 lines
521 B
TypeScript

//// [noCrashOnNoLib.ts]
export function f() {
let e: {}[];
while (true) {
e = [...(e || [])];
}
}
//// [noCrashOnNoLib.js]
"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
exports.__esModule = true;
exports.f = void 0;
function f() {
var e;
while (true) {
e = __spreadArray([], (e || []));
}
}
exports.f = f;