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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to