diff -r f395bd3e477c -r 42c2ceb1e160 vm/src/main/java/org/apidesign/vm4brwsr/GenJS.java --- a/vm/src/main/java/org/apidesign/vm4brwsr/GenJS.java Thu Nov 29 10:47:49 2012 +0100 +++ b/vm/src/main/java/org/apidesign/vm4brwsr/GenJS.java Tue Dec 04 12:06:27 2012 +0100 @@ -91,19 +91,20 @@ ); } } - for (String resource : js.scripts.toArray()) { - while (resource.startsWith("/")) { - resource = resource.substring(1); - } - InputStream emul = l.getResourceAsStream(resource); - if (emul == null) { - throw new IOException("Can't find " + resource); - } - readResource(emul, out); - } - js.scripts = new StringArray(); } + for (String resource : js.scripts.toArray()) { + while (resource.startsWith("/")) { + resource = resource.substring(1); + } + InputStream emul = l.getResourceAsStream(resource); + if (emul == null) { + throw new IOException("Can't find " + resource); + } + readResource(emul, out); + } + js.scripts = new StringArray(); + StringArray toInit = StringArray.asList(js.references.toArray()); toInit.reverse();