@rdeangelis83
private void emitMethodImplementation(JMethod method, JsNameRef functionNameRef,
JsExprStmt methodDefinitionStatement) {
addMethodDefinitionStatement(method, methodDefinitionStatement);
if (shouldEmitDisplayNames()) {
addMethodDefinitionStatement(method, outputDisplayName(functionNameRef, method));
addMethodDefinitionStatement(method, outputFunctionNameProperty(functionNameRef, method));
}
}
private void generatePrototypeDefinitionAlias(JMethod method, JsName alias) {
JsName polyName = polymorphicNames.get(method);
JsExpression bridge = JsUtils.createBridge(method, polyName, topScope);
// Aliases are never property accessors.
generatePrototypeAssignment(method, alias, bridge, JsMemberType.NONE);
}
private JsExprStmt outputDisplayName(JsNameRef function, JMethod method) {
JsNameRef displayName = new JsNameRef(function.getSourceInfo(), "displayName");
displayName.setQualifier(function);
String displayStringName = getDisplayName(method);
JsStringLiteral displayMethodName =
new JsStringLiteral(function.getSourceInfo(), displayStringName);
return createAssignment(displayName, displayMethodName).makeStmt();
}
private JsExprStmt outputFunctionNameProperty(JsNameRef function, JMethod method) {
String displayStringName = getDisplayName(method);
JsStringLiteral displayMethodName =
new JsStringLiteral(function.getSourceInfo(), displayStringName);
JsObjectLiteral descriptor = JsObjectLiteral.builder(function.getSourceInfo())
.add("value", displayMethodName)
.build();
JsStringLiteral prop = new JsStringLiteral(function.getSourceInfo(), "name");
return constructInvocation(function.getSourceInfo(), "Object.defineProperty", function, prop, descriptor).makeStmt();
}
try that out, i think it is close (plus or minus formatting)
https://github.com/tbroyer/gwt-relocation-tests#experiment-4 says
...with an additional relocation from org.gwtproject to com.google.gwt for version 2.9.0
which seems like "extra relocations", no?
Yes, that's what I was trying to say in the early conclusions with:
Using the org.gwtproject:gwt:2.9.0 BOM helps stay on GWT 2.9.0 without risking mixed com.google.gwt and org.gwtproject dependencies, by automatically downgrading the latter (to 2.9.0, which relocates to the former).