On this topic , one way I generally use to verify which functions are available in javascript objects in ISAM mapping rule is to
get the Object.getOwnPropertyNames for that object and trace it :
IDMappingExtUtils.traceString("print functions for Array.prototype : " + Object.getOwnPropertyNames(Array.prototype));
in this case in 9060 It says :
... functions for Array.prototype : constructor,toString,toLocaleString,toSource,join,reverse,sort,push,pop,shift,unshift,splice,concat,slice,indexOf,lastIndexOf,every,filter,forEach,map,some,find,findIndex,reduce,reduceRight,,length
------------------------------
Gianluca Gargaro
IBM
Roma
------------------------------
Original Message:
Sent: 03-12-2019 07:53 PM
From: Mikael Lindblad
Subject: javascript version isam 9.0.6.0
Hi,
Thanks for the information and tips on on how to solve it.
------------------------------
Regards Mikael
Original Message:
Sent: 03-12-2019 05:15 AM
From: Kristof Goossens
Subject: javascript version isam 9.0.6.0
Hi Mikael,
Whenever you wish to use functions that are not supported, I recommend looking for them at MDN.
Usually, there is a "polyfill" for it there. A Polyfill is a function definition that extends the prototype. All you need to do is paste it in your script and you'll be able to use it as if you where working in a JS engine that supports it.
For the includes example, you can find the polyfill code here: https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Polyfill
Cheers
------------------------------
Kristof Goossens
Original Message:
Sent: 03-11-2019 10:22 AM
From: Mikael Lindblad
Subject: javascript version isam 9.0.6.0
Hi,
What javascript version is included in isam 9.0.6.0
It says in the lmi that it uses ES 6.
I wish to use this.
['a', 'b', 'c'].includes('b')
But gets:
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot find function includes in object a,b,c. (InfoMap#4)
------------------------------
Regards Mikael
------------------------------