diff -r fd3a354d6e8f -r 795b040ac8f2 rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java Sun Nov 09 10:36:08 2014 +0100 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java Thu Nov 27 20:23:35 2014 +0100 @@ -35,6 +35,7 @@ private final ExportedSymbols exportedSymbols; private final StringArray invokerMethods; private final StringArray asBinary; + int exportedCount; private VM( Appendable out, Bck2Brwsr.Resources resources, @@ -160,6 +161,7 @@ .append("'] = ") .append(accessClass(mangledName)) .append(";\n"); + exportedCount++; } } @@ -721,7 +723,7 @@ private Extension(Appendable out, Bck2Brwsr.Resources resources, String[] extClassesArray, StringArray explicitlyExported, StringArray asBinary, StringArray classpath - ) { + ) throws IOException { super(out, resources, explicitlyExported, asBinary); this.extensionClasses = StringArray.asList(extClassesArray); this.classpath = classpath; @@ -766,6 +768,9 @@ @Override protected void generateEpilogue() throws IOException { append("});"); + if (exportedCount == 0) { + throw new IOException("Creating library without any exported symbols is useless!"); + } } @Override