Author Topic: PI 1.8 RC6 Script Error in RepairedHSVSeparation, "let" Javascript statement  (Read 3039 times)

Offline Christoph Puetz

  • PixInsight Addict
  • ***
  • Posts: 150
  • Peterberg Observatory (Germany, Saarland)
    • Fotos
Dear PI users,

I moved the following message from "announcements" to the "Bug reports" section.

I found a script Error in the RepairedHSVSeparation.js File.
Reading image:
N:/astro/2013/CHP_lbn406/2013-04-14/lbn406_v2.fit
Reading FITS: 64-bit floating point, 3 channel(s), 2016x2324 pixels: done

run --execute-mode=auto "C:/Program Files/PixInsight/src/scripts/RepairedHSVSeparation.js"

Processing script file: C:/Program Files/PixInsight/src/scripts/RepairedHSVSeparation.js
** Warning [132]: C:/Program Files/PixInsight/src/scripts/RepairedHSVSeparation.js, line 245: let is a reserved identifier
let suffix = 1;
^
*** Error [109]: C:/Program Files/PixInsight/src/scripts/RepairedHSVSeparation.js, line 245: SyntaxError: missing ; before statement
let suffix = 1;
....^

The cause seems to be the following reason as Juan updated the internal Javascript-engine:
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/let

Therefore this only happens from PI 1.8RC6 and later

Kind regards,
      Christoph
---
ATIK 383L+, Canon EOS 450d, modified,
Canon EOS 500d, 
20" Planewave CDK, 6" APO Starfire Refractor,
Celestron 8", Skywatcher ED80,
Peterberg Observatory (www.sternwarte-peterberg.de)
PixInsight, PHD-Guiding
private URL: www.ccdsky.eu

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Hi Christoph,

This is a little bug that is now fixed. The JavaScript engine "thinks" it's interpreting version 1.5 of the language (where the let keyword was not implemented yet), while it now supports up to version 1.8.6. Of course this won't happen in the official RC6 version, thanks for detecting this problem.

As a temporary workaround, simply replace all instances of "let" with "var" in the script. You can do this with ScriptEditor: select Search > Replace, enter let in the Find field and var in the Replace field, make sure the Match case and Whole words options are checked, and click Replace All. The script should run fine this way.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Christoph Puetz

  • PixInsight Addict
  • ***
  • Posts: 150
  • Peterberg Observatory (Germany, Saarland)
    • Fotos
Thank you very much.
It is fun to help improve PI !
Kind regards,
      Christoph
---
ATIK 383L+, Canon EOS 450d, modified,
Canon EOS 500d, 
20" Planewave CDK, 6" APO Starfire Refractor,
Celestron 8", Skywatcher ED80,
Peterberg Observatory (www.sternwarte-peterberg.de)
PixInsight, PHD-Guiding
private URL: www.ccdsky.eu