fmgasparino / google-gin

Automatically exported from code.google.com/p/google-gin
Apache License 2.0
0 stars 0 forks source link

Easier JSNI with GIN #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just had the following (very rough) idea.

BEFORE
======
Java:
public class JSNIExample {
  void instanceFoo(String s) {
    // use s
  }
}

JSNI:
// Call instance method instanceFoo()
this.@com.google.gwt.examples.JSNIExample::instanceFoo(Ljava/lang/String;)(s);

AFTER
=====
Java:
public class JSNIExample {
  // Use @Named to distinguish overloads
  @Named("instanceFooWithMyName")
  void instanceFoo(String s) {
    // use s
  }
}

$(this).named("instanceFooWithMyName").(s);

We could basically rewrite JSNI at compile time, based on annotations in
the Java code. Maybe we can use some kind of matcher system much like Guice
AOP does. 

Setting this to low priority... I'd implement AOP first.

Original issue reported on code.google.com by robbie.v...@gmail.com on 5 Oct 2008 at 1:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Looks like no one is really interested in this at this time... it would also 
require some serious messing with GWT internals. 

Original comment by aragos on 4 Apr 2011 at 7:16