Author Topic: syntax error in psjr file crashes javascript engine  (Read 2844 times)

ruediger

  • Guest
syntax error in psjr file crashes javascript engine
« on: 2011 August 27 06:06:28 »
Hi,
after starting the following javascript from the script editor you will immediately get "out of memory" and afterwards it's impossible to run any other psjr file. The whole PixInsight application has to be restarted. PixInsight version 01.07.00.0702 Starbuck (eng x86_64) on a Windows 7 notebook with 8GB RAM.

Code: [Select]
var maskFilter = new MorphologicalTransformation;

with ( maskFilter ) {
operator = MorphologicalTransformation.prototype.Median;
interlacingDistance = 1;
lowThreshold = 0.000000;
highThreshold = 0.000000;
numberOfIterations = 1;
amount = 1.00;
selectionPoint = 0.50;
structureName = "";
structureSize = 3;
structureWayTable = [ // mask
   [[
      0x01,0x01,0x01,
      0x01,0x01,0x01,
      0x01,0x01,0x01
   ]]
];

// }  <-- syntax error

function weightedMedian( vArr, mArr )
{
}

function median6( vArr )
{
}

function DemosaicWMHOI( img )
{
}

Regards
 RĂ¼diger

Edit: It's probably the same reason like in this thread: http://pixinsight.com/forum/index.php?topic=3356.0. Didn't check the older threads carefully enough before posting. :-[
« Last Edit: 2011 August 27 07:07:39 by ruediger »

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: syntax error in psjr file crashes javascript engine
« Reply #1 on: 2011 August 28 03:31:09 »
Hi RĂ¼diger,

This is the same bug reported by Geert. Please read my answer in the corresponding thread:

http://pixinsight.com/forum/index.php?topic=3356.msg23191#new

and be careful with these syntax errors. It seems that if you forget a closing bracket in the middle of a script, the bug is not so dangerous as if it happens at the end of the compilation unit, but I still have to confirm this. Sorry for this issue.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/