What is the value of nen.setters.setNodeName at the call site?

On 2006-08-21, at 00:52 EDT, Henry Minsky wrote:

> So there's been this one test failing in the data test suite for a  
> long time
> , and I finally tracked it down to
> what seems to be this problem; the setter function (setNodename)  
> for  the
> "nodeName" attribute does not seem to be getting called
> on LzDataElement
>
>
> In the test case this line of code
>
>      nen.setAttribute( 'nodeName' , "bar" );
>
> doesn't call the setNodeName setter on LzDataElement. It does  
> directly set
> the nodeName property though.
>
> But  if I replace the call above with this line which calls the setter
> directly, then everything  works (i.e., some other
> important events are sent by the setter function)
>            nen.setNodeName( "bar" );
>
> So, the question is why isn't this setter getting dispatched to by
> setAttribute. I haven't gotten that far yet, but
> I wonder if it has something to do with LzDataElement being defined  
> by a
> trait.
> The trait is defined in LzDataElement.lzs with an initializer like  
> this
>
> LzDataElementTrait = Trait.make(
>    "LzDataElementTrait",
>    null,
>    // N.B.: LzDataElementTrait may or may not be an LzNode, so
>    // _if_ it were to have an initialize method, it would have to
>    // match LzNode.initialize's signature.
>    null,
>    function LzDataElementTraitInitialize (prototype) {
>      // There will be no setters property in the trait prototype,
>      // (and you don't want one there! as it would shadow the one
>      // from LzNode) but it will be there after LzNode.initialize
>      // runs
>      if (prototype.hasOwnProperty('setters')) {
>        // since you can't assign directly to these slots...
>        // until LzNode.initialize has run
>        prototype.setters.attributes = "setAttrs";
>        prototype.setters.childNodes = "setChildNodes";
>        prototype.setters.nodeName = "setNodeName";
>        // Shouldn't be directliy settable
>        prototype.setters.ownerDocument = "setOwnerDocument";
>      }
>    }
>    );
>
>
> Maybe there's something wrong with the way this is trying to add  
> setters?
>
>
> -- 
> Henry Minsky
> Software Architect
> [EMAIL PROTECTED]

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to