Background
Before Simplifier Release 8 EHP 1, only ECMAScript 5 was supported within Server Side Business Objects. But additionally to ECMAScript 5, there were some non-standardized supported features.
With Release 8 EHP 1 we started support for ECMAScript 2022, which brings a lot more and more modern features to Simplifier SBOs. But with this switch, support for these non-standardized features was dropped.
If you used some of these features, you need to rewrite your code. For most of them, there are multiple ways to implement an alternative. The given example is just one of these many possibilities.
Wrong use of Simplifier API, which can be replaced
Non-stringified values for string values
Old | ECMAScript compliant Alternative |
All Log functions (debug, error, info, critical). E.g.
|
or
|
Non-standard features, which can be replaced
Conditional Catch Clauses
Old | ECMAScript compliant Alternative |
try { func() } |
try { func() } |
Function closure expressions
Old | ECMAScript compliant Alternative |
function square(x) x*x |
const square = x => x * x; |
for each
Old | ECMAScript compliant Alternative |
for each (a in arr) { |
for (let a of arr) { |
Not found handlers
Old | ECMAScript compliant Alternative |
|
|
Bind object properties
Old | ECMAScript compliant Alternative |
Object.bindProperties(obj, obj2); |
Object.assign(obj, obj2); Another alternative with more control: Object.keys(obj2).forEach(key => { |
Error properties
Old | ECMAScript compliant Alternative |
try { ... } |
try { ... } |
Non-standard features, without replacement
There were some very specific features which had their own problems and were always discouraged to be used. For these features, we do not provide an alternative. These include:
Access Java Classes, e.g. Java arrays
var JArray = Java.type("int[]");
var arr = new JArray(10);
or
var System = Java.type("java.lang.System")
Loading external ressources
load("http://www.example.com/t.js");