1.1 --- a/vm/src/main/java/org/apidesign/vm4brwsr/GenJS.java Sun Sep 30 19:40:04 2012 -0700
1.2 +++ b/vm/src/main/java/org/apidesign/vm4brwsr/GenJS.java Wed Oct 03 08:05:24 2012 -0700
1.3 @@ -48,24 +48,18 @@
1.4 }
1.5 if (name.startsWith("java/")
1.6 && !name.equals("java/lang/Object")
1.7 - && !name.equals("java/lang/String")
1.8 && !name.equals("java/lang/StringBuilder")
1.9 && !name.equals("java/lang/AbstractStringBuilder")
1.10 ) {
1.11 continue;
1.12 }
1.13 - InputStream emul = GenJS.class.getResourceAsStream("emulation/" + name.replace('/', '_') + ".js");
1.14 - if (emul != null) {
1.15 - readResource(emul, out);
1.16 - continue;
1.17 - }
1.18 -
1.19 InputStream is = GenJS.class.getClassLoader().getResourceAsStream(name + ".class");
1.20 if (is == null) {
1.21 throw new IOException("Can't find class " + name);
1.22 }
1.23 + LinkedList<String> scripts = new LinkedList<String>();
1.24 try {
1.25 - ByteCodeToJavaScript.compile(is, out, toProcess);
1.26 + ByteCodeToJavaScript.compile(is, out, toProcess, scripts);
1.27 } catch (RuntimeException ex) {
1.28 if (out instanceof CharSequence) {
1.29 CharSequence seq = (CharSequence)out;
1.30 @@ -84,6 +78,13 @@
1.31 );
1.32 }
1.33 }
1.34 + for (String resource : scripts) {
1.35 + InputStream emul = GenJS.class.getResourceAsStream(resource);
1.36 + if (emul == null) {
1.37 + throw new IOException("Can't find " + resource);
1.38 + }
1.39 + readResource(emul, out);
1.40 + }
1.41 }
1.42 }
1.43 private static void readResource(InputStream emul, Appendable out) throws IOException {