1.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java Sun Mar 10 21:27:06 2013 +0100
1.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java Thu Mar 21 18:48:46 2013 +0100
1.3 @@ -28,7 +28,11 @@
1.4 public VM(Appendable out) {
1.5 super(out);
1.6 }
1.7 -
1.8 +
1.9 + private VM(Appendable out, ObfuscationDelegate obfuscationDelegate) {
1.10 + super(out, obfuscationDelegate);
1.11 + }
1.12 +
1.13 static {
1.14 // uses VMLazy to load dynamic classes
1.15 boolean assertsOn = false;
1.16 @@ -47,6 +51,12 @@
1.17 static void compile(Bck2Brwsr.Resources l, Appendable out, StringArray names) throws IOException {
1.18 new VM(out).doCompile(l, names);
1.19 }
1.20 +
1.21 + static void compile(Bck2Brwsr.Resources l, Appendable out, StringArray names,
1.22 + ObfuscationDelegate obfuscationDelegate) throws IOException {
1.23 + new VM(out, obfuscationDelegate).doCompile(l, names);
1.24 + }
1.25 +
1.26 protected void doCompile(Bck2Brwsr.Resources l, StringArray names) throws IOException {
1.27 out.append("(function VM(global) {var fillInVMSkeleton = function(vm) {");
1.28 StringArray processed = new StringArray();
1.29 @@ -230,4 +240,9 @@
1.30 String accessClass(String className) {
1.31 return "vm." + className;
1.32 }
1.33 +
1.34 + @Override
1.35 + String getVMObject() {
1.36 + return "vm";
1.37 + }
1.38 }