Hi Fabian,
I agree that it is not "very easy" to detect the access violation. It was only
a wish that can be ignored, if too expensive to implement ;)
But a clearer overview of what Mixins can do, what they can't and what they
shouldn't do would be nice. When I read the documentation and API (both only
for Version 1.0) I come to the following overview:
* A mixin may not access private or protected members that were not defined in
the mixin itself.
* A mixin can not overwrite methods/properties of the class that it will be
merged into. (Except if applied to a class via qx.Class.patch())
Is this correct? Please _do_ correct any false statement!
Thanks
Peter
P.S.: If those statements were already valid for qooxdoo 0.7.x, or if they do
vary, please make a note on that.
-------- Original --------
From: Fabian Jakobs
Date: 25.01.2010 09:47
> Peter Schneider schrieb:
>> Hi Derrell,
>>
>>
>>
>>> [...]
>>> Unfortunately that won't work in the "build" version. Mixins can't currently
>>> touch private members (those with leading double underscores). It will work
>>> fine in the source version, but then fail with the build version.
>>>
>>> See the comments others have made for alternative solutions.
>>>
>>> Derrell
>>> [...]
>>>
>> Thanks a lot for that info! Is there any documentation on this behavior?
>> I can't find it. Neither for 0.8 nor for 1.0 ...
>> It should be mentioned here [1] & [2].
>> Is it a "normal" behavior of Mixins in other languages to disallow for
>> private access? If that is the case and this behavior is wanted in qooxdoo,
>> the
>> generator should inform about mis-use. A warning would be nice.
>>
>> Peter
>>
> Hi Peter,
>
> it is the private optimizer, which will make this fail. It you turn it
> off for your build your mixin will work in the build version as well.
> Since JavaScript is dynamically typed, the generator cannot "know" that
> two private in different files refer to the same field - it can only
> guess. The guessing works only reasonably well within a single file. For
> this reason it is hard to print useful error messages.
>
> Best Fabian
>
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel