예제 #1
0
        internal static JsException Create(JsConvert convert, JsError error)
        {
            string   type            = (string)convert.FromJsValue(error.Type);
            string   resource        = (string)convert.FromJsValue(error.Resource);
            string   message         = (string)convert.FromJsValue(error.Message);
            int      line            = error.Line;
            int      column          = error.Column + 1; // because zero based.
            JsObject nativeException = (JsObject)convert.FromJsValue(error.Exception);

            JsException exception;

            if (type == "SyntaxError")
            {
                exception = new JsSyntaxError(type, resource, message, line, column);
            }
            else
            {
                exception = new JsException(type, resource, message, line, column, nativeException);
            }
            return(exception);
        }
예제 #2
0
        internal static JsException Create(JsConvert convert, JsError error)
        {
            string type = (string)convert.FromJsValue(error.Type);
            string resource = (string)convert.FromJsValue(error.Resource);
            string message = (string)convert.FromJsValue(error.Message);
            int line = error.Line;
            int column = error.Column + 1; // because zero based.
            JsObject nativeException = (JsObject)convert.FromJsValue(error.Exception);

            JsException exception;
            if (type == "SyntaxError")
            {
                exception = new JsSyntaxError(type, resource, message, line, column);
            }
            else
            {
                exception = new JsException(type, resource, message, line, column, nativeException);
            }
            return exception;
        }