-
Couldn't load subscription status.
- Fork 45
Description
If an @Inject property has the same name as a computed property then the injection breaks for that property.
For example:
@Inject
TreeController treeController;
@Computed
public TreeController getTreeController() {
return treeController;
}The problem comes from the Component generated JsType. It in inherits from the Component Class and adds attributes for Computed properties.
It also adds a method to deal with injection. In this method the following code gets generated to copy injected properties on the Component instance at runtime:
treeController = dependencies.treeController;But we should actually generate this, in case a computed property with the same name masks this attribute:
super.treeController = dependencies.treeController;This masking can occur because non JsInterop properties on the Component class get minified whereas name of properties in the JsType are kept. Therefore they are different at runtime.