Example #1
0
 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);
 }
Example #2
0
 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);
   }
 }
Example #3
0
 private JsNameRef getRTTAddToMethodName(ClassElement classElement) {
   return nameref(null, translationContext.getNames().getName(classElement), "$addTo");
 }
Example #4
0
 private JsNameRef getRTTImplementsMethodName(ClassElement classElement) {
   return nameref(null, translationContext.getNames().getName(classElement), "$RTTimplements");
 }
Example #5
0
 private JsNameRef getRTTLookupMethodName(ClassElement classElement) {
   return nameref(null, translationContext.getNames().getName(classElement), "$lookupRTT");
 }