diff -r 7665471a56c1 -r 752f48257d4a rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java Tue May 27 12:25:41 2014 +0200 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/Bck2Brwsr.java Wed May 28 10:47:18 2014 +0200 @@ -26,7 +26,7 @@ * be used to bootstrap and load the virtual machine:
* var vm = bck2brwsr(); * var main = vm.loadClass('org.your.pkg.Main'); - * main.main__V_3Ljava_lang_String_2(null); + * main.invoke('main'); ** In case one wants to initialize the virtual machine with ability to * load classes lazily when needed, one can provide a loader function to @@ -39,15 +39,27 @@ * function is asked for its byte code and the system dynamically transforms * it to JavaScript. *
- * Instead of a loader function, one can also provide a URL to a JAR file.
+ * Instead of a loader function, one can also provide a URL to a JAR file
+ * or a library JavaScript file generated with {@link #library(java.lang.String...)}
+ * option on.
* The bck2brwsr
system will do its best to download the file
- * and provide loader function for it automatically.
+ * and provide loader function for it automatically. In order to use
+ * the JAR file emul.zip
module needs to be available in the system.
*
- * One can provide as many loader functions and JAR URL references as necessary. + * One can provide as many loader functions and URL references as necessary. * Then the initialization code would look like:
* var vm = bck2brwsr(url1, url2, fnctn1, url3, functn2); ** The provided URLs and loader functions will be consulted one by one. + *
+ * The initialization of the Bck2Brwsr is done asynchronously since + * version 0.9. E.g. call to
+ * var vm = bck2brwsr('myapp.js'); + * var main = vm.loadClass('org.your.pkg.Main'); + * main.invoke('main'); + *+ * returns immediately and the call to the static main method will happen + * once the virtual machine is initialized and the class available. * * @author Jaroslav Tulach