Add EnclosingMethod information to bytecode listing tests
This commit is contained in:
+11
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.utils.sure
|
||||
import org.jetbrains.org.objectweb.asm.*
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes.*
|
||||
import java.io.File
|
||||
import kotlin.test.assertNotNull
|
||||
import kotlin.test.assertNull
|
||||
|
||||
abstract class AbstractBytecodeListingTest : CodegenTestCase() {
|
||||
@@ -271,6 +272,16 @@ class BytecodeListingTextCollectingVisitor(val filter: Filter, val withSignature
|
||||
classSignature = signature
|
||||
}
|
||||
|
||||
override fun visitOuterClass(owner: String, name: String?, descriptor: String?) {
|
||||
if (name == null) {
|
||||
assertNull(descriptor)
|
||||
declarationsInsideClass.add(Declaration("enclosing class $owner"))
|
||||
} else {
|
||||
assertNotNull(descriptor)
|
||||
declarationsInsideClass.add(Declaration("enclosing method $owner.$name$descriptor"))
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitInnerClass(name: String, outerName: String?, innerName: String?, access: Int) {
|
||||
if (!filter.shouldWriteInnerClass(name)) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user