Why are 'let' and 'const' not working in javascript

'let' and 'const' do not work in Directory Opus javascript scripts. Some questions, all related.
Why is this?
Can we have local scope variables using 'var'?
Are there any other reserved javascript words or standard javascript methods that are not supported?
Shouldn't Directory Opus be advertised as a file manager And awesome IDE, for increased sales?

Because it’s JScript and those things probably didn’t exist back then.

JScript is part of Windows, not something Opus defines.

Yeah, unfortunately the JScript available in the Opus is not the same JavaScript (ES6) supported by the web browsers, but some extremely outdated Microsoft's implementation which is built-in to Windows.

From what I've read, it looks like Microsoft abandoned all interest in it, it won't be updated, and it exists for historical compatibility.

That's why it would be neat if Opus in the future would provide a built-in scripting language such as Lua (which is extremely small and easy to integrate, wouldn't bloat Opus at all!). Lua appeared nearly 30 years ago and is still actively developed and is used everywhere for scripting (often in games).

Alternative to it would be for Opus to integrate some small non-bloaty JavaScript engine which implements (at least) a minimum ES6 specification (so you'd have let and const).

The possibility to use the full ES6 JavaScript in Opus however, would be a dream (you'd have support for lambdas and predicates for iterable objects just like in C++ or C#).

Do you mean 'Microsoft Office JScript' ?
Documentation Here

They're all connected but, no. It's part of Windows ActiveScripting, not Office. I don't know how (or whether) Office's JScript differs.

Are the documentations in this post the correct documentations ?

Looks correct, assuming the links still work (Microsoft are terrible at running websites).

1 Like