7

I am trying to understand more the structure of javascript functions in SharePoint. Why does every function begin with som value than colon and semicolon like ULSrE8:; in spgridview.debug.js:

function ULSrE8(){
  var o=new Object;
  o.ULSTeamName="Microsoft SharePoint Foundation";
  o.ULSFileName="spgridview.debug.js";
  return o;
}
var SPGridView_CallbackContext=null;
function SPGridView_FilterPreMenuOpen(gridViewClientId, 
                                     templateClientId, 
                                     menuClientId, 
                                     dataFieldName, e)
{ULSrE8:;
    var gridView=document.getElementById(gridViewClientId);
...

What does {ULSrE8:; do?

2
  • 1
    Also, in SP.debug.js an object called ULS5V1 is cleared and instantiated in a similar way before every single function. Mystifying myself, too, as I can't find any definition of what :; does in JavaScript... Commented Oct 13, 2011 at 10:57
  • Indeed a mystery. Commented Oct 13, 2011 at 11:41

1 Answer 1

11

A similar question was asked on StackOverflow some time ago (just found it).

This answer provides the information you are searching.

To provide a short version of the answer: strictly talking, the line "ULSrE8:;" does nothing (it does not execute the function) BUT the label is used by some intricate diagnostic/error logging code that parses the function and searches token labels in that format.

You can read a more precise description in the the above link (I won't copy the full answer - please refer to the original post by Paul Lucas).

(Note: I don't know if there is a way or the need to mark this quesion as a partial duplicate as the original question is on another stackexchange site)

6
  • 1
    Want a realistic perception of SharePoint from other developers? Have a read at all the comments ;) Commented Oct 13, 2011 at 13:30
  • 4
    ... and why you think my user name is SPArchaeologist? I'm still searching for my personal version of the Rosetta stone to decode the ancient languages and criptography of MSDN documentation... Commented Oct 13, 2011 at 13:33
  • I like it! Setting up a museum to SharePoint, running on Tahoe? :P Commented Oct 13, 2011 at 13:37
  • Thank you very much for the answer for the provided, @SPArchaeologist. due to ":;" it was hard to google it. I hade never seen this before I started developing for Sharepoint, so I thought it was only Sharepoint stuff. Now I know what it is it does feel good. Commented Oct 13, 2011 at 13:51
  • +1 Good find! I can't really close a dupe across SE sites easily.. so let's just leave it for now. :) Commented Oct 13, 2011 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.