ECMAScript 262 Edition 11 or ECMA - 262 Edition 5.1?

ECMAScript 262 Edition 11 or ECMA - 262 Edition 5.1? where is the difference, and which would be preferable for OH4?

The first one is the default for openHAB 4 and is preferred. See https://www.openhab.org/addons/automation/jsscripting/

1 Like

As for what’s the difference, 5.1 (Nashorn) is really old and lacks many features that have been standard to JavaScript for nearly a decade now.

The helper library for Nashorn never got added to the OH project, never really became complete, and isn’t really maintained any more. The helper library for 11 (GraalJS) comes with the add-on, is just of the openHAB project, it’s quite complete and will maintained.

Over all, creating rules in GraalJS is a much better experience. Nashorn should be treated as legacy and deprecated.

1 Like

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