Function Parameters

When defining a function in my form I wanted to specify the parameters like so:

function myFunction(id, pageCount)
{
...
}

But Servoy (v4.1.0 rc1 at least) doesn’t seem to like this syntax and “eats” the parameters as soon as I save(!). Any ideas why this syntax isn’t allowed? It much less verbose and cleaner than (IMO):

function myFunction()
{
  var id = arguments[0]
  var pageCount = arguments[1]
...
}

As far as I can tell Rhino (the javascript implementation used by Servoy) supports this syntax.

Is this a bug?

Hi Yeroc,

Yeroc:
As far as I can tell Rhino (the javascript implementation used by Servoy) supports this syntax.

Is this a bug?

It’s a ‘feature’ ;)
It’s the way Servoy always worked but I understand that they will support it in some future version.
So it’s on the list.

Right now you can use function parameters with functions INSIDE your methods but the methods themselves you need to use the arguments array approach.

Hope this helps