Replies: 1 comment
-
Sorry, I don't follow the question, the text is mangled. I'm not sure what you mean by layer of G. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
`package com.major.j2cl;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsType;
import java.util.ArrayList;
import java.util.List;
@jstype
public class A {
private B myB;
private List myList=new ArrayList();
public A(){
B b=new B();
myList.add(b);
}
@JsMethod
public void setB(B var1){
myB = var1;
}
@JsMethod
public List getMyListB(){
return myList;
}
@JsMethod
public String getMyBMessage(){
return myB.getMyName();
}
}
`
`package com.major.j2cl;
/**
*/
public class B {
private String name="myName";
public B(){}
public String getMyName(){
return name;
}
}
`
goog.module("App1") const A = goog.require("com.major.j2cl.A"); goog.exportSymbol("A",A) goog.exportSymbol("A.prototype.setB",Exported.prototype.setB) goog.exportSymbol("A.prototype.getMyListB",Exported.prototype.getMyListB) goog.exportSymbol("A.prototype.getMyBMessage",Exported.prototype.getMyBMessage)
When I package the above code to use
const myA = new A() const list = myA.getMyListB() myA.setB(list.g[0]) myA.getMyBMessage()
The first question is why the outer layer of the list is wrapped with a layer of G. Can g be removed or changed to other values?
The second problem is why myA.getMyBMessage() is not called. The investigation found that it was because there was also an extra layer of g packaging after class B packaging. How can I solve this problem?
Thank you very much
Beta Was this translation helpful? Give feedback.
All reactions