1.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java Tue Feb 26 16:54:16 2013 +0100
1.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java Wed Feb 27 14:38:16 2013 +0100
1.3 @@ -132,6 +132,10 @@
1.4 for (FieldData v : jc.getFields()) {
1.5 if (v.isStatic()) {
1.6 out.append("\n CLS.").append(v.getName()).append(initField(v));
1.7 + out.append("\n c._").append(v.getName()).append(" = function (v) {")
1.8 + .append(" if (arguments.length == 1) CLS.").append(v.getName())
1.9 + .append(" = v; return CLS.").
1.10 + append(v.getName()).append("; };");
1.11 } else {
1.12 out.append("\n c._").append(v.getName()).append(" = function (v) {")
1.13 .append(" if (arguments.length == 1) this.fld_").
1.14 @@ -1244,7 +1248,7 @@
1.15 int indx = readIntArg(byteCodes, i);
1.16 String[] fi = jc.getFieldInfoName(indx);
1.17 final int type = VarType.fromFieldType(fi[2].charAt(0));
1.18 - emit(out, "var @1 = @2(false).constructor.@3;",
1.19 + emit(out, "var @1 = @2(false)._@3();",
1.20 smapper.pushT(type),
1.21 accessClass(fi[0].replace('/', '_')), fi[1]);
1.22 i += 2;
1.23 @@ -1255,7 +1259,7 @@
1.24 int indx = readIntArg(byteCodes, i);
1.25 String[] fi = jc.getFieldInfoName(indx);
1.26 final int type = VarType.fromFieldType(fi[2].charAt(0));
1.27 - emit(out, "@1(false).constructor.@2 = @3;",
1.28 + emit(out, "@1(false)._@2(@3);",
1.29 accessClass(fi[0].replace('/', '_')), fi[1],
1.30 smapper.popT(type));
1.31 i += 2;