Re: Can't coerce to string
Tupshin Harper <[email protected]>
| Newsgroups | gmane.comp.java.xwt.core |
|---|---|
| Message-ID | <[email protected]> |
Brian Alliet wrote:
> On Mar 11, 2004, at 8:22 PM, Charles Goodwin wrote:
>
>> The issue comes when you try to concat a string to a
>> box ("" + box).
>
>
> Why do you need to do that?
>
> -Brian
>
He doesn't need to. The point is that logging a box object succeeds and
returns a string indicating it's a box, but logging ("this is a box: " +
box) fails because you can coerce a box to a string in java space, but
you can't in JS space. This is an understandable, yet surprising
behavior. I have a patch that turns the box to string coercion into a
warning, complete with template name and line number. I believe this is
the most desirable behavior.
-Tupshin