static JsExpression getRTTClassId( TranslationContext translationContext, ClassElement classElement) { JsName classJsName = translationContext.getNames().getName(classElement); JsProgram program = translationContext.getProgram(); JsStringLiteral clsid = program.getStringLiteral(classJsName.getShortIdent()); return call(null, nameref(null, "$cls"), clsid); }
private void injectInterfaceMarkers(ClassElement classElement, SourceInfo srcRef) { JsProgram program = translationContext.getProgram(); JsName classJsName = translationContext.getNames().getName(classElement); for (InterfaceType iface : getAllInterfaces(classElement)) { JsStatement assignment = (JsStatement) newAssignment( newNameRef( newNameRef(new JsNameRef(classJsName), "prototype"), "$implements$" + translationContext .getMangler() .mangleClassName(iface.getElement())), program.getNumberLiteral(1)) .makeStmt() .setSourceRef(srcRef); globalBlock.getStatements().add(assignment); } }
private JsNameRef getRTTAddToMethodName(ClassElement classElement) { return nameref(null, translationContext.getNames().getName(classElement), "$addTo"); }
private JsNameRef getRTTImplementsMethodName(ClassElement classElement) { return nameref(null, translationContext.getNames().getName(classElement), "$RTTimplements"); }
private JsNameRef getRTTLookupMethodName(ClassElement classElement) { return nameref(null, translationContext.getNames().getName(classElement), "$lookupRTT"); }