Revert two bad loop conversions in build
parent
b4964bcf35
commit
f28c02195a
|
@ -241,8 +241,8 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
|
|||
function toggleComments(fileContents: string): string {
|
||||
let lines = fileContents.split(/\r\n|\r|\n/);
|
||||
let mode = 0;
|
||||
for (const line of lines) {
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (mode === 0) {
|
||||
if (/\/\/ ESM-comment-begin/.test(line)) {
|
||||
mode = 1;
|
||||
|
|
|
@ -464,7 +464,8 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
|
|||
}
|
||||
|
||||
if (black_queue.length === 0) {
|
||||
for (const node of gray_queue) {
|
||||
for (let i = 0; i< gray_queue.length; i++) {
|
||||
const node = gray_queue[i];
|
||||
const nodeParent = node.parent;
|
||||
if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) {
|
||||
gray_queue.splice(i, 1);
|
||||
|
|
Loading…
Reference in New Issue