Is there a way to declare a class inside a try and catch block in jscript?

60 Views Asked by At

I want to use System.Threading methods provided by the .NET. for creating 2 test conditions that must happen simultaneously.

Using this solution to put the function in a class I was able to create 2 threads and run them parallely in jsc compiler.

But the environment I am writing my test scripts in, places my entire code in a try block and then compiles, which throws the

error:JS1109: Class definition not allowed in this context.

Is there anyway to make multithreading possible without the use of classes in JScript?

0

There are 0 best solutions below