Skip to content

Instantly share code, notes, and snippets.

@mdproctor
Created September 17, 2021 19:13
Show Gist options
  • Save mdproctor/357c73e89f1fd6eeedf5d7959f4f0c57 to your computer and use it in GitHub Desktop.
Save mdproctor/357c73e89f1fd6eeedf5d7959f4f0c57 to your computer and use it in GitHub Desktop.
String a = code("import jsinterop.annotations.JsType;import jsinterop.annotations.JsMethod;import jsinterop.annotations.JsProperty;",
"public class A {",
" public void foo() {}",
"}");
String b = code("import jsinterop.annotations.JsType;import jsinterop.annotations.JsMethod;import jsinterop.annotations.JsProperty;",
"public class B extends A{",
"}");
String c = code("import jsinterop.annotations.JsType;import jsinterop.annotations.JsMethod;import jsinterop.annotations.JsProperty;",
"public class C {",
" public void bar() {" +
" B b = new B();",
" b.foo();",
" }",
"}");
-------------
➜ output cat library_info_debug.json
{
"typeMap": ["\u003cno-type\u003e", "test.A", "test.B", "test.C"],
"type": [{
"typeId": 1,
"member": [{
"name": "constructor",
"position": {
"start": 6,
"end": 10
}
}, {
"name": "$create__",
"static": true,
"invokedMethods": [{
"method": "constructor",
"enclosingType": 1
}, {
"method": "$ctor__test_A___$i",
"enclosingType": 1
}],
"position": {
"start": 10,
"end": 17
}
}, {
"name": "$ctor__test_A___$i",
"position": {
"start": 17,
"end": 21
}
}, {
"name": "m_foo___$i",
"position": {
"start": 21,
"end": 23
}
}, {
"name": "$clinit",
"static": true,
"position": {
"start": 23,
"end": 29
}
}],
"headerSourceFilePath": "test/A.java.js",
"implSourceFilePath": "test/A.impl.java.js"
}, {
"typeId": 2,
"extendsType": 1,
"member": [{
"name": "constructor",
"invokedMethods": [{
"method": "constructor",
"enclosingType": 1
}],
"position": {
"start": 6,
"end": 10
}
}, {
"name": "$create__",
"static": true,
"invokedMethods": [{
"method": "constructor",
"enclosingType": 2
}, {
"method": "$ctor__test_B___$i",
"enclosingType": 2
}],
"position": {
"start": 10,
"end": 17
}
}, {
"name": "$ctor__test_B___$i",
"invokedMethods": [{
"method": "$ctor__test_A___$i",
"enclosingType": 1
}],
"position": {
"start": 17,
"end": 21
}
}, {
"name": "$clinit",
"static": true,
"invokedMethods": [{
"method": "$clinit",
"enclosingType": 1
}],
"position": {
"start": 21,
"end": 27
}
}],
"headerSourceFilePath": "test/B.java.js",
"implSourceFilePath": "test/B.impl.java.js"
}, {
"typeId": 3,
"member": [{
"name": "constructor",
"position": {
"start": 8,
"end": 12
}
}, {
"name": "$create__",
"static": true,
"invokedMethods": [{
"method": "constructor",
"enclosingType": 3
}, {
"method": "$ctor__test_C___$i",
"enclosingType": 3
}],
"position": {
"start": 12,
"end": 19
}
}, {
"name": "$ctor__test_C___$i",
"position": {
"start": 19,
"end": 23
}
}, {
"name": "m_bar___$i",
"invokedMethods": [{
"method": "$create__",
"enclosingType": 2
}, {
"method": "m_foo___$i",
"enclosingType": 1
}],
"position": {
"start": 23,
"end": 28
}
}, {
"name": "$clinit",
"static": true,
"position": {
"start": 28,
"end": 34
}
}],
"headerSourceFilePath": "test/C.java.js",
"implSourceFilePath": "test/C.impl.java.js"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment