private void generateVTableAssignment(List<JsStatement> globalStmts, JMethod method,
JsName lhsName, JsExpression rhs) {
SourceInfo sourceInfo = method.getSourceInfo();
JsNameRef lhs = lhsName.makeRef(sourceInfo);
lhs.setQualifier(globalTemp.makeRef(sourceInfo));
JsExprStmt polyAssignment = createAssignment(lhs, rhs).makeStmt();
globalStmts.add(polyAssignment);
vtableInitForMethodMap.put(polyAssignment, method);
if (shouldEmitDisplayNames()) {
JsExprStmt displayNameAssignment = outputDisplayName(lhs, method);
globalStmts.add(displayNameAssignment);
vtableInitForMethodMap.put(displayNameAssignment, method);
}
}