cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Debugging Expression libraries in eclipse (or other editor) using Javascript

Tim
New Contributor

I would like to be able to write tests for my expression libraries using and editor and javascript.
I have tried require() and import, but have not been successful

6 REPLIES 6

cjhoward18
Employee
Employee

Hi @Tim,

The Snaplogic Expression Language is an in-house-built custom language that is behaviorally mostly like Javascript however, it is not Javascript and can not be used as so in a Javascript editor.

Maybe a unit test/validation pipeline is your best way to achieve this.

Tim
New Contributor

Thank you for the response.

I did learn through more research that the engine is the Nashorn engine and due to the fact that it is deprecated in Java 11 there will not be support for it in VScode. Some people have made some progress.

I do have a test pipeline right now. I am finding more discrepancies between Javascript the language spec and Nashorn the implementation. (which is why it is deprecated). That has to be a hard place for you to be in, a new engine could be a backwards compatibility nightmare.

Actually, our Expression Language is not built on top of Nashorn at all. You may have been reading a post about the script snap using a Javascript setting, which is not involved with the expression language.

The Expression Language is a completely custom-built language that actually gets compiled into Java Byte code to be executed on the JCC.

Tim
New Contributor

That is good information. I would prefer to write expressions and expression libs than script snaps.

I do wish there was a way to test them from Javascript or Java in a local editor. Something to consider. Probably a lot of work when many of your users may not use a lot of local coding practices?