Updates the fileName and lineNumber properties of an Error instance to indicate where the error was thrown instead of where the error was created. Use this function if you are creating custom error types.
Some browsers set the fileName and lineNumber fields of an Error instance based on where the Error instance was created. This can be a problem if an Error instance is thrown outside the scope of the function that created it.
The popStackFrame method is called by exceptions that are thrown by the Microsoft Ajax Library. You call the popStackFrame method only if you are defining your own error types.
When you call the popStackFrame method of the Error instance inside the function that created it, the fileName and lineNumber fields of the error instance are updated. Their values are set based on where the error was thrown instead of where the Error instance was created. The popStackFrame function updates the fileName and lineNumber fields of an Error instance based on the next frame in the browser's stack trace. This provides more accurate error information for debugging your code.
The following example shows a function that creates an Error instance and returns it to the code that invoked it, which in turn throws the Error instance. Because the Error instance is thrown outside the function that created it, the popStackFrame method is called from the function that generated the error and before the error is returned.