>
> I've fixed two Gin generator related breakages like this so far. Are you 
> sure this is occurring with HEAD? If so then there's definitely a bug in 
> the "stale types marking" code that needs finding. If you can make a repro 
> case I'll figure it out.
>

Hey John, I have to say that we still see issues with UiBinder + 
compilePerFile in GWT trunk from 09.09.2014. We have a UiBinder Composite, 
lets call it "MyComposite", that has 

<ui:style type="com.example.MyComposite.Style" field="style"> ... some css 
... </ui:style> 

in its XML file and

interface Style extends CssResource {
  ....
}

@UiField
Style style;

in the corresponding Java class. This MyComposite is used in a different 
Composite (GenericCustomComposite) that has a sub class 
(SpecificCustomComposite).

If we add a new accessor method to the Style interface of MyComposite then 
compilation still works but the app fails at runtime with:

com.google.gwt.core.client.JavaScriptException: (TypeError) : undefined is 
not a function
at Unknown.UIObject_1_g$(app-0.js@10:19605)
at Unknown.Widget_1_g$(app-0.js@19:20155)
at Unknown.Composite_1_g$(app-0.js@17:109460)
at Unknown.GenericCustomComposite_1_g$(app-0.js@20:479016)
at Unknown.SpecificCustomComposite_1_g$(app-0.js@23:477194)
at Unknown.generateUiEntries_0_g$(app-0.js@29:221296)
at Unknown.setData_0_g$(app-0.js@14:221535)
at Unknown.success_60_g$(app-0.js@25:221911)
at Unknown.success_61_g$(app-0.js@10:221921)
at Unknown.onSuccess_7_g$(app-0.js@10:213650)

So instantiating of SpecificCustomComposite (whose super class uses the 
modified MyComposite) fails. I debugged it a bit with the following 
information (some stuff renamed):

function SpecificCustomComposite_1_g$(param1_0_g$, param2_0_g$, param3
_0_g$){
  try {
    $clinit_SpecificCustomComposite_0_g$();
    // Here *"this" points to __proto__: F_0_g$* which contains all the 
methods 
    // of SpecificCustomComposite_1_g as well as *$init_13782_g$()* called 
below.
    GenericCustomComposite_1_g$.call(*this*, param1_0_g$, param2_0_g$);
    *this.$init_13782_g$();*
    this. param3_1_g$ = param3_0_g$;
  }
   catch (e_0_g$) {
    throw e_0_g$;
  }
}


function GenericCustomComposite_1_g$(param1_0_g$, param2_0_g$){
  try {
    $clinit_GenericCustomComposite_0_g$();
    var someVar_0_g$;
    // Here *"this" still points to __proto__: F_0_g$ *which contains all 
the methods
    // of SpecificCustomComposite_1_g as well as *$init_13782_g$()*.
    Composite_1_g$.call(*this*);
    *this.$init_13781_g$(); // technically the correct init method but 
"this" does not have it.*
    .... 
    this.initWidget_3_g$(this.container_66_g$);
  }
   catch (e_0_g$) {
    throw e_0_g$;
  }
}

function Composite_1_g$(){
  try {
    $clinit_Composite_0_g$();
    *// "this" is still the same F_0_g$*
    Widget_1_g$.call(this);
    *this.$init_10766_g$(); **// technically the correct init method but 
"this" does not have it.*
  }
   catch (e_0_g$) {
    throw e_0_g$;
  }
}

function Widget_1_g$(){
  try {
    $clinit_Widget_0_g$();
*    // "this" is still the same F_0_g$*
    UIObject_1_g$.call(this);
    *this.$init_10009_g$(); // technically the correct init method but 
"this" does not have it.*
  }
   catch (e_0_g$) {
    throw e_0_g$;
  }
}

function UIObject_1_g$(){
  try {
    $clinit_UIObject_0_g$();
*    // "this" is still the same F_0_g$*
    Object_1_g$.call(this);
    *this.$init_10008_g$(); **// causes undefined error because "this" does 
not contain the init method of UIObject*
  }
   catch (e_0_g$) {
    throw e_0_g$;
  }
}

So it seems like the "this" pointer somehow gets messed up after recompile.

The try/catch block in all these code blocks above are from our custom GWT 
build as we need to disable JIT on safari permutation (iOS 6.x JIT bugs) 
and wrapping everything with try/catch was the safest solution so far (even 
though it is not nice). To do so we have a custom Visitor in 
JavaToJavaScriptCompiler.PermutationCompiler.compilePermutation() that 
executes between calls to optimizeJs() and JsStackEmulator.exec(). 


Maybe this info helps you to spot the issue.


-- J.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/931e7562-ee5d-41a6-a41c-2ab70b4bcabd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to