diff -r d382dacfd73f -r 033ea09379a0 rt/core/src/main/java/org/apidesign/bck2brwsr/core/JavaScriptBody.java
--- a/rt/core/src/main/java/org/apidesign/bck2brwsr/core/JavaScriptBody.java Tue Feb 26 16:54:16 2013 +0100
+++ b/rt/core/src/main/java/org/apidesign/bck2brwsr/core/JavaScriptBody.java Thu Feb 28 20:51:53 2013 +0100
@@ -22,22 +22,17 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-/** Put this method on a method in case it should have a special
- * body in the JavaScript.
+/** Put this annotation on a method to provide its special implementation
+ * in JavaScript. This is a way to define native methods that
+ * interact with the surrounding environment.
*
* @author Jaroslav Tulach
*/
@Retention(RetentionPolicy.CLASS)
@Target({ ElementType.METHOD, ElementType.CONSTRUCTOR })
public @interface JavaScriptBody {
- /** Names of parameters for the method.
- *
- *
+ /** Names of parameters for the method generated method that can
+ * be referenced from {@link #body()}.
*
* @return array of the names of parameters for the method
* in JavaScript
@@ -46,6 +41,12 @@
/** The actual body of the method in JavaScript. This string will be
* put into generated header (ends with '{') and footer (ends with '}').
+ * The body can reference provided arguments. In case of non-static
+ * instance method it may reference this
. It can also
+ * call methods and access fields - if
+ * proper mangling
+ * is used. Methods that return some value should end with return
+ * statement.
*/
public String body();
}