Login  Register

Re: Returning an array in Javascript

Posted by ctrueden on Aug 25, 2015; 12:49pm
URL: http://imagej.273.s1.nabble.com/Returning-an-array-in-Javascript-tp5014124p5014141.html

Hi Avital,

> The reason I didn't share the code is that I'm having trouble
> reproducing the error message. That is - it disappeared and it's
> likely to reappear, because I didn't do anything to solve it.

OK. Well, it's definitely related to the last statement of your script. The
script framework implicitly stores the script's return value in an output
called "result" which it then tries to display. If you see the error again,
maybe that helps to boil it down to a minimal example.

One potential fix for this "bug" might be to ignore values in the "result"
output when they cannot be displayed, rather than to issue that warning.

Regards,
Curtis

On Tue, Aug 25, 2015 at 7:04 AM, Avital Steinberg <[hidden email]
> wrote:

> Hi Curtis,
> I'm using ImageJ 2.0.0-rc-30/1.50a on a 10.9.5 mac. The reason I didn't
> share the code is that I'm having trouble reproducing the error message.
> That is - it disappeared and it's likely to reappear, because I didn't do
> anything to solve it.
>
> Thanks,
> Avital
>
> On Mon, Aug 24, 2015 at 10:36 PM, Curtis Rueden <[hidden email]> wrote:
>
> > Hi Avital,
> >
> > > [WARNING] Ignoring unsupported output: result
> > > [sun.org.mozilla.javascript.internal.NativeArray]
> >
> > This warning comes from the SciJava script framework -- part of ImageJ2.
> It
> > means that the last computation of your script produced an array of
> values,
> > which the system wants to display, but doesn't know how.
> >
> > Any chance you could share a minimal script which illustrates the issue?
> >
> > Also, which version of Java and which OS are you using?
> >
> > Regards,
> > Curtis
> >
> > On Mon, Aug 24, 2015 at 7:02 AM, Avital Steinberg <
> > [hidden email]
> > > wrote:
> >
> > > Hi,
> > > I'm having a problem returning arrays in Javascript. I have a function
> > that
> > > calculates things and returns an array of values. When I try to return
> an
> > > array, I get the following red warning message in the console:
> > >
> > > [WARNING] Ignoring unsupported output: result
> > > [sun.org.mozilla.javascript.internal.NativeArray]
> > >
> > > Also, I'm having trouble reproducing the problem, since it often
> > disappears
> > > for an unknown reason, and then I can't reproduce it.
> > >
> > > Thanks,
> > > Avital
> > >
> > > --
> > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html