JScript version availability for WSH installations

I'm not sure that JScript for WSH is available in every Windows installation.

What version of JScript is available for WSH and in which version of Windows?

Please provide a link to an authoritative source.

+4
source share
2 answers

All versions of JScript and Windows Script Host are stored on MSDN:

+3
source

One not obvious nuance: JScript works like version 5.7 in Windows Script Host 5.8.

From MSDN: note Starting with JScript 5.8, by default the JScript scripting engine supports a set of language functions as it existed in version 5.7. . This must support compatibility with earlier versions of the engine. To use the full set of language features in version 5.8, the Windows Script interface host must call IActiveScriptProperty :: SetProperty. ( MSDN, JScript Version Information )

Even worse, JScript claims version 5.8 (not 5.7) in this case by default (see the output of [ScriptEngineMajorVersion(), ScriptEngineMinorVersion()] ).

JScript 5.8 introduced the following functions : JSON object, JSON.parse method, JSON.stringify method, toJSON method, defineProperty , getOwnPropertyDescriptor method.

Unfortunately, there is no easy way to use these features in the cscript (or wscript ) host version 5.8. Update: One trick was found from @rojo in 2015. This trick is based on the htmlfile COM object, and it allows you to use at least some of the features mentioned.

See also question 19445189 cscript jscript JSON .

+3
source

Source: https://habr.com/ru/post/1346010/


All Articles