diff -r 151f4ccd7673 -r 8d29792a09c6 rt/vm/src/main/java/org/apidesign/vm4brwsr/VMLazy.java --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/VMLazy.java Thu Mar 21 18:48:46 2013 +0100 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/VMLazy.java Thu Sep 12 14:15:47 2013 +0200 @@ -130,6 +130,14 @@ @Override protected void requireScript(String resourcePath) throws IOException { + if (!resourcePath.startsWith("/")) { + resourcePath = "/" + resourcePath; + } + String code = readCode(resourcePath); + applyCode(lazy.loader, null, code, false); + } + + private String readCode(String resourcePath) throws IOException { InputStream is = getClass().getResourceAsStream(resourcePath); StringBuilder sb = new StringBuilder(); for (;;) { @@ -139,7 +147,7 @@ } sb.append((char)ch); } - applyCode(lazy.loader, null, sb.toString(), false); + return sb.toString(); } @Override