Hi Yves,
You are using this in Process script, correct?
I tried your code and I get this error, at each setVariable().
org.runmyprocess.json.JSONException: Illegal class : org.mozilla.javascript.NativeDate
org.runmyprocess.json.JSONException: Illegal class : org.mozilla.javascript.NativeNumber
Javascript inclusion is executed as server-side Javascript, and inside the script Javascript data types are okay, but once it tries to send as process variable it errors.
This is because process variable is JSON based, and only data type supported are number, string, boolean, array.
Related to this section in Wikipedia
(but please note, data types like null and undefined are also not supported)
And this should happen for all browsers because it is server-side javascript, it is not running in browser.
I hope this makes sense.
Best regards,
Taka