IdScriptableObject & native objects - some questions

16 views
Skip to first unread message

Ian Sollars

unread,
Feb 26, 2012, 2:54:01 PM2/26/12
to mozill...@googlegroups.com
Hi Hannes, everyone,

I'm progressing (ultra-slowly) on the IdScriptableObject thing, but I
have a few questions. I see that the new implementation returns null
if the method tag isn't recognised, whereas the old implementation
threw an IllegalStateException instead. Is there a preference between
the two?

Secondly, concerning testing,can I just run the normal test-suites and
assume that if I've messed up, something will show up? Or should I
write test-cases for each object I'm changing?

Thanks in advance, best regards,

- Ian

--
Blog: http://ianso.blogspot.com/
Script social interactions on Twitter: http://ianso.github.com/scriptus/
Profile:http://www.google.com/profiles/ian.sollars

Hannes Wallnoefer

unread,
Feb 28, 2012, 4:23:24 AM2/28/12
to mozilla-rhino
On Feb 26, 8:54 pm, Ian Sollars <ian.soll...@gmail.com> wrote:
> Hi Hannes, everyone,
>
> I'm progressing (ultra-slowly) on the IdScriptableObject thing, but I
> have a few questions. I see that the new implementation returns null
> if the method tag isn't recognised, whereas the old implementation
> threw an IllegalStateException instead. Is there a preference between
> the two?

I'd say throwing IllegalStateException is the correct behaviour.
Returning null if a method is not understood/implemented is definitely
not acceptable - is that what's happening?

> Secondly, concerning testing,can I just run the normal test-suites and
> assume that if I've messed up, something will show up? Or should I
> write test-cases for each object I'm changing?

Running the normal test suite is a good start, but it's not a
guarantee by itself. One simple way to find if your code is covered is
to break it and see which tests are affected. Actually I think we have
Emma code coverage in Rhino build but I must confess I haven't looked
at it recently.

Hannes

Ian Sollars

unread,
Feb 29, 2012, 3:45:30 PM2/29/12
to mozill...@googlegroups.com
On 28 Feb 2012, at 10:23, Hannes Wallnoefer <han...@gmail.com> wrote:
> I'd say throwing IllegalStateException is the correct behaviour.
> Returning null if a method is not understood/implemented is definitely
> not acceptable - is that what's happening?

Yup, so IllegalStateException it is then.

> Running the normal test suite is a good start, but it's not a
> guarantee by itself. One simple way to find if your code is covered is
> to break it and see which tests are affected. Actually I think we have
> Emma code coverage in Rhino build but I must confess I haven't looked
> at it recently.

Emma is nice. I'll see what I can do.

- I
>>
>>

Reply all
Reply to author
Forward
0 new messages