[OH4 JavaScript] Correct JavaScript version?

What is the correct version for JavaSript Scripting rules (ECMA Sript 2022+) ?

Rules imported from a 3.4 setup have the following setting:

type: application/javascript;version=ECMAScript-2021

while newly created rules are missing the “version=…” part.
Both rule-types are working.
Installed is only JavaSript Scripting (according to bundle:list).

Does the “version=…” part have an effect at all if only one JavaScript version is installed?

Open the rule and choose

“application/javascript” is now 262 Edition 11. The version is only needed if you install the Nashorn addon and want to use 5.1.

application/javascript;version=ECMAScript-2021 was the MIME type for JavaScript Scripting in openHAB 3.4 and is still supported in 4.0, but in 4.0 JavaScript Scripting took application/javascript from NashornJS and made it is‘s primary MIME type.

FYI NashornJS has application/javascript;version=ECMAScript-5.1, and in general the version part does matter as it is part of the MIME type.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.