//--------------------------------------------------------------------------------------- // HandleError // // Handle an error. There are two actions that can be taken when an error occurs: // - throwing an exception with no recovering action (eval case) // - notify the host that an error occurred and let the host decide whether or not // parsing has to continue (the host returns true when parsing has to continue) //--------------------------------------------------------------------------------------- internal void HandleError(JsException error) { if (m_parser != null) { if (!m_parser.OnCompilerError(error)) { throw new EndOfStreamException(); // this exception terminates the parser } } }
internal void HandleError(JsError errorId, bool forceToError) { if ((errorId != JsError.UndeclaredVariable && errorId != JsError.UndeclaredFunction) || !Document.HasAlreadySeenErrorFor(Code)) { var error = new JsException(errorId, this); if (forceToError) { error.IsError = true; } else { error.IsError = error.Severity < 2; } Document.HandleError(error); } }
public JScriptExceptionEventArgs(JsException exception, MinifierError error) { Error = error; Exception = exception; }