Problem with Cursor class: 'lockCursor' is not a member of 'UnityEngine.Cursor'.

Good night,
I’m trying to use the Cursor class, but I’m having problems when using Cursor.lockState and then get the following message: “Assets / MouseLock.js (13.24): BCE0019: ‘lockCursor’ is not a member of ‘UnityEngine.Cursor’.”

I can not understand why the Unity does not recognize the ‘lockCursor’ as a member of the 'UnityEngine.Cursor "can someone help me? Below is my code. Thanks!

#pragma strict

var teste : boolean = false;

function Start () {
 
}

function Update () {
    if(Input.GetKey(KeyCode.Escape) && teste == false)
    {
        Cursor.lockState = CursorLockMode.Locked;
     
        teste = true;
    }
}

lockCursor has been deprecated. Use cursor.lockState instead.