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