vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java
branchreflection
changeset 659 7c0eb1a5d0b8
parent 655 044c72732424
child 666 8338ab1991e6
     1.1 --- a/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java	Sun Feb 03 23:18:47 2013 +0100
     1.2 +++ b/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java	Mon Feb 04 22:03:49 2013 +0100
     1.3 @@ -1705,16 +1705,22 @@
     1.4              int depth;
     1.5              
     1.6              @Override
     1.7 -            protected void visitAnnotationStart(String type) throws IOException {
     1.8 +            protected void visitAnnotationStart(String attrType, boolean top) throws IOException {
     1.9 +                final String slashType = attrType.substring(1, attrType.length() - 1);
    1.10 +                requireReference(slashType);
    1.11 +                
    1.12                  if (cnt[depth]++ > 0) {
    1.13                      out.append(",");
    1.14                  }
    1.15 -                out.append('"').append(type).append("\" : {\n");
    1.16 +                if (top) {
    1.17 +                    out.append('"').append(attrType).append("\" : ");
    1.18 +                }
    1.19 +                out.append("{\n");
    1.20                  cnt[++depth] = 0;
    1.21              }
    1.22  
    1.23              @Override
    1.24 -            protected void visitAnnotationEnd(String type) throws IOException {
    1.25 +            protected void visitAnnotationEnd(String type, boolean top) throws IOException {
    1.26                  out.append("\n}\n");
    1.27                  depth--;
    1.28              }