ChaoquanTao opened a new issue, #16534:
URL: https://github.com/apache/dolphinscheduler/issues/16534

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar feature requirement.
   
   
   ### Description
   
   I want to execute condition like `['abc','def'].includes(${output})` in 
switch task, but error occurs:
   ```
   javax.script.ScriptException: TypeError: ["abc", "efg"].includes is not a 
function in <eval> at line number 1
        at 
jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470)
        at 
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:454)
        at 
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
        at 
jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
        at 
jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
        at 
org.apache.dolphinscheduler.server.master.utils.SwitchTaskUtils.evaluate(SwitchTaskUtils.java:35)
   ```
   Actually the includes function can be supported by using polyfills as 
https://stackoverflow.com/questions/47543566/scriptengine-javascript-doesnt-support-includes
 mentioned.
   
   ### Are you willing to submit a PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
commits-unsubscr...@dolphinscheduler.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to