Forum Discussion

daniel_dewinter's avatar
daniel_dewinter
Contributor
5 years ago

strictEqual ---> 'Object Expected'

Hi All,

 

I ve a question,

When running the function below, an error occurs: Object expected

=============================

function equal()
{
Log.Message(strictEqual(2, 2))
}

=============================

I can't figure out what's wrong whith this code. Even when running it without the Log.Message, it still fails. I'm on TestComplete Desktop 14.3

 

 

1 - code

2 - error

 

Originally I started with more complicated code, using the strictequal method, as used in this example:

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/findfolders.html

 

next, I'm narrowing down the problem to the 'strictEqual' function, as used in the example below:

https://support.smartbear.com/testcomplete/docs/reference/language/javascript/strictequal-method.html

 

 

  • Hi,


    I think because "strictEqual" is not compatible with Jscript.


    I was trying to run this code on my JavaScript project and evrything was fine.


    On newly project with JScript i dont event have this function in intellisense and in documentation it's for JavaScript not for JScript.


    I think this is the problem.

     

     

  • Wamboo's avatar
    Wamboo
    Community Hero

    Hi,


    I think because "strictEqual" is not compatible with Jscript.


    I was trying to run this code on my JavaScript project and evrything was fine.


    On newly project with JScript i dont event have this function in intellisense and in documentation it's for JavaScript not for JScript.


    I think this is the problem.

     

     

      • Wamboo's avatar
        Wamboo
        Community Hero

        I am happy to help Daniel.

         

        Yes, you can convert it, but remember that there are many differences between Jscript and JavaScript.