On 2007-03-23, at 14:31 EDT, Henry Minsky wrote:

The original code looked like this

var LzRPC = Class( "LzRPC", null, function () { } );

//-------------------------------------------------------------------- ---------- // @param Number num: number to pass down to explicitly cast to a double //-------------------------------------------------------------------- ----------
LzRPC.DoubleWrapper = function(num) {
   this.num = num;
}

So was this trying to define a subclass of LzRPC?

The modern equivalent would be to make it a static function of the class (i.e., a class method). But you will have to update the code that is testing for LzRPC.prototype.DoubleWrapper to LzRPC.DoubleWrapper, too. The __proto__ hacking needs to be replaced with instanceof too.

On 3/23/07, Henry Minsky <[EMAIL PROTECTED]> wrote:

I might've converted this wrong when I updated to use the new class
system.


On 3/23/07, Pablo Kang < [EMAIL PROTECTED]> wrote:
>
> Oops. Thanks, Tucker. :)
>
> On Fri, 23 Mar 2007, P T Withington wrote:
>
> > I posted what may be a work-around.
> >
> > It looks like this mistakenly was spec-ed as an instance function and > > should be a class (static) instead (and the encoder would have to be
> > fixed too).
> >
> > Seems to me the encoder should be using `instanceof` not comparing
> > prototypes.  Not all javascripts support __proto__.  (It never
> > occured to me that we had components that tried to do __proto__
> > hacking!)
> >
> > And, I wonder if Double should be a subclass of Number? (Not sure
> > that will work in JS1.)
> >
> > On 2007-03-23, at 09:02 EDT, Max Carlson wrote:
> >
> > > http://forum.openlaszlo.org/showthread.php?t=8757
> > >
> > > Do we have a testcase that verifies DoubleWrapper works properly?
> > >
> > > --
> > > Regards,
> > > Max Carlson
> > > OpenLaszlo.org
> > >
> >
> >
>



--
Henry Minsky
Software Architect
[EMAIL PROTECTED]




--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to