Object.extend distribution broken

0 views
Skip to first unread message

Laurie Harper

unread,
Sep 19, 2005, 9:40:09 PM9/19/05
to jsan-a...@googlegroups.com
[First off, is there a better way to submit bug reports than this list?]

The current distribution of Object.extend (0.02) appears to be
broken. When I call JSAN.use('Object.extend') it complains that JSAN
must be loaded first. Clearly it was, or the call to use() wouldn't
have worked ;-)

L.
--
Laurie Harper
Open Source advocate, Java geek: http://www.holoweb.net/laurie
Founder, Zotech Software: http://www.zotechsoftware.com/



Rob Kinyon

unread,
Sep 20, 2005, 12:26:55 AM9/20/05
to jsan-a...@googlegroups.com
On 9/19/05, Laurie Harper <lau...@holoweb.net> wrote:
>
> [First off, is there a better way to submit bug reports than this list?]

Nope.

> The current distribution of Object.extend (0.02) appears to be
> broken. When I call JSAN.use('Object.extend') it complains that JSAN
> must be loaded first. Clearly it was, or the call to use() wouldn't
> have worked ;-)

Yeah, I'm running into this bug in Object.extend(),
Number.toColorPart(), and the whole Upgrade suite. I haven't had a
chance to pin down exactly why the bug is happening and Casey's wife
just had a baby, so he's mostly out of it.

Would you be able to create a testcase using Test.Simple for me to try
and patch JSAN against?

Thanks,
Rob

Laurie Harper

unread,
Sep 20, 2005, 8:16:04 AM9/20/05
to jsan-a...@googlegroups.com, Laurie Harper
On 20-Sep-05, at 12:26 AM, Rob Kinyon wrote:
> On 9/19/05, Laurie Harper <lau...@holoweb.net> wrote:
>> [First off, is there a better way to submit bug reports than this
>> list?]
> Nope.

OK, at least I asked ;-)

>> The current distribution of Object.extend (0.02) appears to be
>> broken. When I call JSAN.use('Object.extend') it complains that JSAN
>> must be loaded first. Clearly it was, or the call to use() wouldn't
>> have worked ;-)
>
> Yeah, I'm running into this bug in Object.extend(),
> Number.toColorPart(), and the whole Upgrade suite. I haven't had a
> chance to pin down exactly why the bug is happening and Casey's wife
> just had a baby, so he's mostly out of it.
>
> Would you be able to create a testcase using Test.Simple for me to try
> and patch JSAN against?

I'll take a look at that; in the meantime, I can offer a couple
points of guidance:

1) the use() in Object.extend.js is wrapped in a try/catch which just
assumes *any* error must be due to JSAN not having been loaded. The
right thing to do is probably to change this:

try {
JSAN.use( 'Upgrade.Function.apply' );
} catch (e) {
throw "Object.extend requires JSAN to be loaded";
}

to this:

if (JSAN == undefined) {
throw "Object.extend requires JSAN to be loaded";
}
JSAN.use( 'Upgrade.Function.apply' );

That will let the correct error be propagated. Which leads to the
next problem... That use() call is failing because Upgrade/Function/
apply.js (a) assumes the Upgrade and Upgrade.Function namespaces are
defined (and I can't figure out what does that; the Upgrade package
doesn't, which is where I'd expect it to happen...); and (b) doesn't
define a class, so the result of eval()ing it is not what JSAN
expects. JSAN needs to be made a little more robust against this, and
the apply.js needs to return (or eval to) the right kind of object.

Problems in Number.toColorPar() are probably similar.

Rob Kinyon

unread,
Sep 20, 2005, 11:03:01 AM9/20/05
to jsan-a...@googlegroups.com
Note: Object.extend() will be removed from JSAN in the near future.
This discussion, however, it still relevant as it applies to the
Upgrade and Number.toColorPart distributions. Object.extend() will
still be available through the Prototype distribution, once these
issues are resolved and I am able to release Prototype v0.02

Thanks,
Rob

Laurie Harper

unread,
Sep 20, 2005, 1:48:20 PM9/20/05
to jsan-a...@googlegroups.com, Laurie Harper
OK; the only reason I ran into this was because I was trying to
satisfy the needs of scriptaculous without loading prototype.js due
to my fears about conflicts. If it's going away, I wont worry about
it further ;-)
Reply all
Reply to author
Forward
0 new messages