0Day Forums
Can I somehow use modern objects with WSH's JScript? - Printable Version

+- 0Day Forums (https://zeroday.vip)
+-- Forum: Coding (https://zeroday.vip/Forum-Coding)
+--- Forum: JScript (https://zeroday.vip/Forum-JScript)
+--- Thread: Can I somehow use modern objects with WSH's JScript? (/Thread-Can-I-somehow-use-modern-objects-with-WSH-39-s-JScript)



Can I somehow use modern objects with WSH's JScript? - gayzqyfx - 07-24-2023

I've been meaning to create a file organizing / monitoring tool that would cut my usual amount of work tremendously.

Due to my workplace's extremely close-circuit network, I am forced to make it in WSH, the language of choice being JScript, Microsoft's ancient dialect of ECMAScript.

I am also using a customized version of Windows XP.

However, it seems the seemingly-usual JavaScript objects that we know and love don't work there.
For example:


var a = {
test: 'Hello, world!'
};


Yields an "; exptected" type of error.

This wouldn't seem like such a big deal not being able to use these sorts of objects, however it is actually crucial since I already have a large dataset which was organized in that matter (I used JavaScript on an old version of Chrome before I realized I might be able to use WSH instead: can you feel my pain?!).

So... What do you say?
Is there anything I can do about it?
Is there another way to define objects in JScript that would allow me to keep using WSH? (I am willing to convert my dataset to another format if possible).

Maybe there's an alternative to WSH that I could use for this sort of work, taking into consideration that I cannot download anything from the net?

Thanks in advance for your assistance!