1.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java Sun Feb 16 23:56:01 2014 +0100
1.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java Mon Feb 17 07:54:35 2014 +0100
1.3 @@ -1938,6 +1938,13 @@
1.4 return ",";
1.5 }
1.6
1.7 + final void emitNoFlush(
1.8 + StackMapper sm,
1.9 + final Appendable out,
1.10 + final String format, final CharSequence... params
1.11 + ) throws IOException {
1.12 + emitImpl(out, format, params);
1.13 + }
1.14 final void emit(
1.15 StackMapper sm,
1.16 final Appendable out,
1.17 @@ -2127,12 +2134,12 @@
1.18 private void generateCheckcast(int indx, final StackMapper smapper) throws IOException {
1.19 final String type = jc.getClassName(indx);
1.20 if (!type.startsWith("[")) {
1.21 - emit(smapper, out,
1.22 + emitNoFlush(smapper, out,
1.23 "if (@1 !== null && !@1.$instOf_@2) throw vm.java_lang_ClassCastException(true);",
1.24 - smapper.getA(0), type.replace('/', '_'));
1.25 + smapper.getT(0, VarType.REFERENCE, false), type.replace('/', '_'));
1.26 } else {
1.27 - emit(smapper, out, "vm.java_lang_Class(false).forName__Ljava_lang_Class_2Ljava_lang_String_2('@2').cast__Ljava_lang_Object_2Ljava_lang_Object_2(@1);",
1.28 - smapper.getA(0), type
1.29 + emitNoFlush(smapper, out, "vm.java_lang_Class(false).forName__Ljava_lang_Class_2Ljava_lang_String_2('@2').cast__Ljava_lang_Object_2Ljava_lang_Object_2(@1);",
1.30 + smapper.getT(0, VarType.REFERENCE, false), type
1.31 );
1.32 }
1.33 }