//---------------------------------------------------------------------------------------
        // 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
                }
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
 public JScriptExceptionEventArgs(JsException exception, MinifierError error)
 {
     Error     = error;
     Exception = exception;
 }