I can't find any place where it is documented as a public API
(finding it in the debugger does not count as documentation), so I
see no need to deprecate it.
We're trying _not_ to pollute each instance with random internal
properties. Since each instance already is required by ECMAScript to
have a `constructor` property through which it can get all the
details of its class, it is superfluous to put the classname on the
instance. And, as you will read later in this thread, the code that
'broke' was always broken: it really wanted the _tag_ name that the
instance was created with, not the _class_ name (because it is trying
to build child specs, to pass to another internal API `makeChild`).
[Which makes me think this whole component needs a thorough review.
We can't have components that depend on private LFC interfaces.]
On 2006-10-25, at 00:38 EDT, Max Carlson wrote:
Classname isn't a private variable - anyone could find it by
exploring in the debugger. Can we deprecate before we remove it?
Also, having a classname on the instance sounds useful to me...
-Max
P T Withington wrote:
Ah. classname is no longer in the instance. It needs to be
replaced with constructor.classname. I did this in the LFC, but I
guess it did not occur to me that this was used externally to the
LFC. What exactly is grid trying to do? (That is, perhaps there
is a better way than using classname.)
I think it is an error that there is a classname on the instance.
I'll remove that.
On 2006-10-24, at 17:22 EDT, Philip Romanik wrote:
Hi Tucker,
I tracked down a grid problem involving the classname variable in
LzNode. In legals, classname is always 'Object' (see Class.lzs).
In trunk classname is the correct classname. Here's some code
that shows classname is wrong. At first I thought this was an
initialization issue, but the classname never changes.
Phil
<canvas>
<view name="view">
<method name="init">
super.init();
Debug.write("view::init", this.classname);
</method>
<method event="oninit">
Debug.write("view::oninit", this.classname);
</method>
</view>
<class name="testclass" extends="text">
<method name="init">
super.init();
Debug.write("testclass::init", this.classname);
</method>
<view name="nested_view">
<method name="init">
super.init();
Debug.write("nested_view::init", this.classname);
</method>
<method event="oninit">
Debug.write("nested_view::oninit called",
this.classname);
</method>
</view>
</class>
<testclass/>
</canvas>