Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We added a property in the Servoy global preference page:

When that property is enabled, the validation of javascript through parsing the files is working differently.

It will then not fully parse referenced js files that are references like:

var myVariableFromOtherScope = scopes.otherscope.giveAnObject();

 

Currently if you have this in you js file (form or scope) then that "otherscope.js" is also fully parsed, with that property enabled otherscope.js is only partially parsed by only parsing the function declarations. Because of this @return is very important to have in the JSDoc on all functions that return something. Because the parser will not able able to see it from the function itself because the body is not parsed.

Currently there is also a problem if we parse the otherscope.js file because you are in "currentscope.js" then if otherscope.js also reference again thirthscope.js that scope will not be fully parsed. This is because of performance reasons (parsing one file could result in parsing everything)

And the side effect of that is that if thirthscope.js returns objects again from other files that those objects are not seen by the current file that you are editing (so no code completion or validation). 

With this new property this is also fixed.

If you have constructor functions that assign stuff to the "this" these functions have to have @constructor  in the jsdoc. because those bodies will be parsed. If we wouldn't do that then objects properties wouldn't be seen.

So as long as you document your function correctly by having @return  and @constructor everywhere. The checking of that property could result in a lot less memory usage, and much faster parsing. Besides the fixing of the problem of deeply nested javascript files that resulted in not seen return values that it should see.

We like to have feedback for this property, to see if we can enable this by default in 8.4

 

 

 

Issues fixed in this release:

...