Author Topic: Warning in Background Neutralization  (Read 3037 times)

Offline Leandro VARGAS

  • Member
  • *
  • Posts: 51
Warning in Background Neutralization
« on: 2014 May 23 20:56:37 »
Hello,

I have the next warning in Background Neutralization each time I use the option Aggregated :

** Warning [156]: C:/Program Files/PixInsight/src/scripts/PreviewAggregator.js, line 293: assignment to undeclared variable n

This is normal warning ?

Thank you,

Leandro

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Warning in Background Neutralization
« Reply #1 on: 2014 May 24 02:43:33 »
No, it is not 'normal'. But in this case the warning can be ignored (I checked the code).

Unfortunately many scripts do not have a "use strict" directive or equivalent and have minor problems that generate warnings or could cause error if the script is run in strict mode (either because it is a new default or you ran a strict using strict mode before and PJSR remember it). So eventually this should be corrected.

If you want to remove the warning you can change the line 293 and add a missing 'var' on it (tested on PI 1.8 1092 it does the trick).
     
Code: [Select]
for (var n = 0; n < this.dialog.target_List.numberOfChildren; n++)but it is not required.

-- bitli


Offline Leandro VARGAS

  • Member
  • *
  • Posts: 51
Re: Warning in Background Neutralization
« Reply #2 on: 2014 May 24 05:37:41 »
Bello Bitli,

Thank you for your comments, but the error was display when I run the process Pix BN.

Regards,

Leandro

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Warning in Background Neutralization
« Reply #3 on: 2014 May 24 08:07:37 »
that does not make sense, as the error has come from the script PreviewAggregator. maybe you ran it right before BN and did not notice it's output on the console until after you did BN?

rob

Offline Leandro VARGAS

  • Member
  • *
  • Posts: 51
Re: Warning in Background Neutralization
« Reply #4 on: 2014 May 24 08:26:32 »
Hi

The step

- Sript Aggregator, no error durimg the process in console
- Process BN and during this process display the warning.

Leandro

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Warning in Background Neutralization
« Reply #5 on: 2014 May 24 13:08:56 »
Maybe the console was not flushed (not scrolled to the bottom, not visible when you ran the script, or something like that).  But the error
Code: [Select]
** Warning [156]: C:/Program Files/PixInsight/src/scripts/PreviewAggregator.js, line 293: assignment to undeclared variable n definitely come from PreviewAggregator and is easily reproduced (just add the "use strict"; at the first line to make it fatal).

Some scripts show or hide the console window depending on the fancy of the script programmer. Some of us make it  always visible on their desktop so we see warning immediately. May be BN is showing the console and this is why you see the warning only then.

There is always some logic to the behavior of PI.

-- bitli