@@ -23436,14 +23436,19 @@ var ts;
2343623436 function writeJavaScriptFile(emitOutput, writeByteOrderMark) {
2343723437 writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark);
2343823438 }
23439- function createTempVariable(location, forLoopVariable) {
23440- var _name = forLoopVariable ? "_i" : undefined;
23441- while (true) {
23442- if (_name && !isExistingName(location, _name)) {
23443- break;
23439+ function createTempVariable(location, preferredName) {
23440+ var _name = preferredName;
23441+ for (; !_name || isExistingName(location, _name); tempCount++) {
23442+ var char = 97 + tempCount;
23443+ if (char === 105 || char === 110) {
23444+ continue;
23445+ }
23446+ if (tempCount < 26) {
23447+ _name = "_" + String.fromCharCode(char);
23448+ }
23449+ else {
23450+ _name = "_" + (tempCount - 26);
2344423451 }
23445- _name = "_" + (tempCount < 25 ? String.fromCharCode(tempCount + (tempCount < 8 ? 0 : 1) + 97) : tempCount - 25);
23446- tempCount++;
2344723452 }
2344823453 recordNameInCurrentScope(_name);
2344923454 var result = ts.createSynthesizedNode(64);
@@ -23456,8 +23461,8 @@ var ts;
2345623461 }
2345723462 tempVariables.push(name);
2345823463 }
23459- function createAndRecordTempVariable(location) {
23460- var temp = createTempVariable(location, false );
23464+ function createAndRecordTempVariable(location, preferredName ) {
23465+ var temp = createTempVariable(location, preferredName );
2346123466 recordTempDeclaration(temp);
2346223467 return temp;
2346323468 }
@@ -24540,9 +24545,9 @@ var ts;
2454024545 write(" ");
2454124546 endPos = emitToken(16, endPos);
2454224547 var rhsIsIdentifier = node.expression.kind === 64;
24543- var counter = createTempVariable(node, true );
24544- var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node, false );
24545- var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, false ) : undefined;
24548+ var counter = createTempVariable(node, "_i" );
24549+ var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(node);
24550+ var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(node, "_n" ) : undefined;
2454624551 emitStart(node.expression);
2454724552 write("var ");
2454824553 emitNodeWithoutSourceMap(counter);
@@ -24601,7 +24606,7 @@ var ts;
2460124606 }
2460224607 }
2460324608 else {
24604- emitNodeWithoutSourceMap(createTempVariable(node, false ));
24609+ emitNodeWithoutSourceMap(createTempVariable(node));
2460524610 write(" = ");
2460624611 emitNodeWithoutSourceMap(rhsIterationValue);
2460724612 }
@@ -25071,7 +25076,7 @@ var ts;
2507125076 if (languageVersion < 2 && ts.hasRestParameters(node)) {
2507225077 var restIndex = node.parameters.length - 1;
2507325078 var restParam = node.parameters[restIndex];
25074- var tempName = createTempVariable(node, true ).text;
25079+ var tempName = createTempVariable(node, "_i" ).text;
2507525080 writeLine();
2507625081 emitLeadingComments(restParam);
2507725082 emitStart(restParam);
0 commit comments