[JS SCRIPT] Fix IrScript visit order
This commit is contained in:
@@ -139,6 +139,15 @@ fun BodyLoweringPass.runOnFilePostfix(irFile: IrFile, withLocalDeclarations: Boo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun visitScript(declaration: IrScript, data: IrDeclaration?) {
|
||||||
|
ArrayList(declaration.declarations).forEach { it.accept(this, declaration) }
|
||||||
|
if (withLocalDeclarations) {
|
||||||
|
declaration.statements.forEach { it.accept(this, null) }
|
||||||
|
}
|
||||||
|
declaration.thisReceiver.accept(this, declaration)
|
||||||
|
}
|
||||||
|
|
||||||
}, null)
|
}, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,6 +248,17 @@ fun DeclarationTransformer.runPostfix(withLocalDeclarations: Boolean = false): D
|
|||||||
|
|
||||||
declaration.declarations.transformFlat(this@runPostfix::transformFlatRestricted)
|
declaration.declarations.transformFlat(this@runPostfix::transformFlatRestricted)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun visitScript(declaration: IrScript) {
|
||||||
|
ArrayList(declaration.declarations).forEach { it.accept(this, null) }
|
||||||
|
declaration.declarations.transformFlat(this@runPostfix::transformFlatRestricted)
|
||||||
|
|
||||||
|
if (withLocalDeclarations) {
|
||||||
|
declaration.statements.forEach { it.accept(this, null) }
|
||||||
|
}
|
||||||
|
|
||||||
|
declaration.thisReceiver.accept(this, null)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return this@runPostfix.transformFlatRestricted(declaration)
|
return this@runPostfix.transformFlatRestricted(declaration)
|
||||||
|
|||||||
Reference in New Issue
Block a user