Surely you are guaranteed that the instance slots have their initial value before the user constructor gets its hands on the instance? That's all I'm doing here, to work around the current bug in the js1 back-ends. As long as you are not allowed to refer to the (proto) instance in any initial value (I don't know of any language that allows that), you're safe.

This is certainly what JS2 does already, which is why I put my work- around inside if ($js1) [which André pointed out was not doing what I really intended].

On 2009-01-09, at 15:24EST, Donald Anderson wrote:

This raises the question of constructor ordering for either this case (existing super call) or when we insert a super call. It sounds like we want any 'extra' initialization to happen before anything in the constructor happens, including the super call. I'm not sure that jives with
most OO logic...

On Jan 9, 2009, at 2:54 PM, P T Withington wrote:

Yeah, we had better not complain until 5232 is fixed, because it is the only work-around!

The situation was that the super call called an overridden method to initialize the instance which was depending on an instance var that had not yet been given its initial value.

On 2009-01-09, at 14:47EST, Donald Anderson wrote:

I guess we don't complain about code before a super call.
It probably doesn't matter for workaround code, so approved.


- Don

On Jan 9, 2009, at 1:36 PM, P T Withington wrote:

[Checking in ahead of review, you can review after you wash your dog]

Change 20090109-ptw-F by [email protected] on 2009-01-09 13:01:30 EST
in /Users/ptw/OpenLaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix brain-oh in work-around for LPP-5232

Bugs Fixed: LPP-5232 initial value of instance vars incorrectly shared (workaround)

Technical Reviewer: [email protected] (pending)

Details:
Instance var initial values should be installed before the super call

Tests:
Test case in LPP-7514 no longer crashes in DHTML

Files:
M      WEB-INF/lps/lfc/debugger/LzMessage.lzs


Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090109-ptw-F.tar


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-306-2057
email: [email protected]
www: http://www.ddanderson.com








--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-306-2057
email: [email protected]
www: http://www.ddanderson.com







Reply via email to