Re: SuperDevMode stuck on compiling

2012-11-08 Thread Sandro Munda


On Wednesday, July 11, 2012 5:46:16 PM UTC+2, Chris Gamache wrote:


 I am using Ext-Js LGPL via GWT-Ext, and they have indeed modified the 
 Array prototype. Not much I can do about that. I'm stuck there.

 I hacked in the modification, and it will get through to compile now. Is 
 there already an issue in the tracker for the xsiframe generator bug/bad 
 practice?

 On Wednesday, July 11, 2012 10:02:57 AM UTC-4, Thomas Broyer wrote:


 On Wednesday, July 11, 2012 3:27:13 PM UTC+2, Chris Gamache wrote:

 Stopped on that line above when propName == 'remove' here's the call 
 stack:

  console.trace()
   (anonymous function)
   (anonymous function)
   evaluate
   InjectedScript._evaluateOn
   InjectedScript._evaluateAndWrap
   InjectedScript.evaluateOnCallFrame
   computePropValue mymodule.nocache.js:326
   mymodule.__getPropMap mymodule.nocache.js:389
   getBindingParameters dev_mode_on.js:324
   compile dev_mode_on.js:388
   runBookmarklet dev_mode_on.js:414
   (anonymous function) dev_mode_on.js:427
   (anonymous function)


 Are you using any third-party lib? One that would manipulate the 
 Array.prototype?
 There's a small bug in the xsiframe linker generated script, rather a 
 bad practice than a bug actually: using an Array as if it were an Object 
 first, and using a for…in on it without checking hasOwnProperty; and when 
 combined with the other bad practice of augmenting prototypes, it breaks!
 Not really a bug in the generated script, just that it can break 
 relatively easily if there are bugs/bad practices elsewhere.

 I just tried it in Chrome dev tools' console:
 var values = [];
 values['foo'] = 'foo';
 values['bar'] = 'bar';
 for (var key in values) { console.log(key); }

 The above should print foo and bar.

 Now, add the following and then start the for loop again:
 Array.prototype.remove = function() { console.log(remove); }
 (using Array.prototype here, because 'values' is an array; would be true 
 with Obejct.prototype if 'values' had been initialized with {})
 It'll now print foo, bar, remove.

 Should be relatively easy to hack around it: locate __getPropMap in your 
 nocache.js and change the for-loop to add the following if:
 for (key in values) {
   if (values.hasOwnProperty(key)) {
 ...
   }
 }


Hi ! I exactly have the same problem. Do you have a fix ? Thanks. 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/wRoC8yYTn0kJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: JavaScriptObject generate a json with a Integer field

2012-03-21 Thread Sandro Munda
Thanks ! Exactly.

Sandro Munda
munda.san...@gmail.com



On Tue, Mar 20, 2012 at 2:28 PM, Thomas Broyer t.bro...@gmail.com wrote:

 On Tuesday, March 20, 2012 12:49:10 PM UTC+1, Sandro Munda wrote:

 Hello everybody !

 I have a subclass of a JavaScriptObject with a generic type T.

 public class FooT extends JavaScriptObject {
   // ...
 }

 In this class, I have a getValue() method that returns a T value.

 private final native T getValue() /*-{
   return this.value;
 }-*/;

 In my situation, T is an Integer. When I running the code I have the
 following exception :

  Caused by: java.lang.ClassCastException: Cannot cast
 java.lang.Integer to com.google.gwt.core.client.JavaScriptObject

 Is the value is a 'int', it works well. But not the Integer.

 How can I fix the problem ?
 Any workarrounds ?

 You cannot use Integer as a generic parameter in this case; you have to code
 specifically for the integer or other primitive wrapper) case; something
 like:

 public final Integer getValue() {
     return hasValue() ? Integer.valueOf(getValueInt()) : null;
 }

 private final native boolean hasValue() /*-{
     return this.value == null;
 }-*/;

 private final native int getValueInt() /*-{
     return Number(this.value);
 }-*/;

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/nrBiWtOwQqcJ.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



JavaScriptObject generate a json with a Integer field

2012-03-20 Thread Sandro Munda
Hello everybody !

I have a subclass of a JavaScriptObject with a generic type T.

public class FooT extends JavaScriptObject {
  // ...
}

In this class, I have a getValue() method that returns a T value.

private final native T getValue() /*-{
  return this.value;
}-*/;

In my situation, T is an Integer. When I running the code I have the
following exception :

 Caused by: java.lang.ClassCastException: Cannot cast
java.lang.Integer to com.google.gwt.core.client.JavaScriptObject

Is the value is a 'int', it works well. But not the Integer.

How can I fix the problem ?
Any workarrounds ?

Thanks !

Sandro Munda
munda.san...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: FF10, here we go again

2012-02-07 Thread Sandro Munda
Thanks, it works well for me ! Maybe, can you provide a small tutorial
for building the plugin when a new firefox version arrived ? I would
like to contribute !

On Feb 6, 7:06 pm, Filipe Sousa nat...@gmail.com wrote:
 ...and for fedora 16 i686 (no 
 tested)http://dl.dropbox.com/u/5176435/gwt-dev-plugin-i686.xpi

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.