1.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java Thu May 29 09:57:01 2014 +0200
1.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/ByteCodeToJavaScript.java Sun Jun 22 00:09:56 2014 +0200
1.3 @@ -260,15 +260,18 @@
1.4 append("\n c.constructor = CLS;");
1.5 append("\n function fillInstOf(x) {");
1.6 String instOfName = "$instOf_" + className;
1.7 - append("\n x['").append(instOfName).append("'] = true;");
1.8 + append("\n Object.defineProperty(x, '").append(instOfName).append("', { value : true });");
1.9 for (String superInterface : jc.getSuperInterfaces()) {
1.10 String intrfc = superInterface.replace('/', '_');
1.11 append("\n vm.").append(intrfc).append("(false)['fillInstOf'](x);");
1.12 requireReference(superInterface);
1.13 }
1.14 append("\n }");
1.15 - append("\n c['fillInstOf'] = fillInstOf;");
1.16 - append("\n fillInstOf(c);");
1.17 + append("\n try {");
1.18 + append("\n Object.defineProperty(c, 'fillInstOf', { value: fillInstOf });");
1.19 + append("\n fillInstOf(c);");
1.20 + append("\n } catch (ignore) {");
1.21 + append("\n }");
1.22 // obfuscationDelegate.exportJSProperty(this, "c", instOfName);
1.23 append("\n CLS.$class = 'temp';");
1.24 append("\n CLS.$class = ");