10

So I was going through init.js and sp.js and found out that nearly all of the SharePoint OOB JS functions start with the following line: "ULSxSy:;"

For example:

function ctxInitItemState(ctxCur)
{ULSxSy:;
    ctxCur.TotalListItems=0;
    ctxCur.CurrentSelectedItems=0;
    ctxCur.LastSelectableRowIdx=0;
    ctxCur.StateInitDone=true;
}
function STSPageUrlValidation(url)
{ULSxSy:;
    return PageUrlValidation(url);
}

I could not find any documentation regarding why this might be. Anybody have an idea?

2

A similar question was asked on StackOverflow earlier, here you'll find a short answer.

This answer provides the detailed information for your question.

This line

{ULSxSy:;

is inserted into functions to allow collect diagnostic information on the client which includes the ability to send a JavaScript callstack (including function name, and javascript file) back to the server.

In your case label ULSxSy correspond to function declaration

function ULSxSy(){
   var o=new Object;
   o.ULSTeamName="Microsoft SharePoint Foundation";
   o.ULSFileName="init.debug.js";
   return o;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.