private object DeserializeInternal(int depth)
        {
            if (++depth > _depthLimit)
            {
                throw new ArgumentException(_s.GetDebugString(AtlasWeb.JSON_DepthLimitExceeded));
            }

            Nullable <Char> c = _s.GetNextNonEmptyChar();

            if (c == null)
            {
                return(null);
            }

            _s.MovePrev();

            if (IsNextElementDateTime())
            {
                return(DeserializeStringIntoDateTime());
            }

            if (IsNextElementObject(c))
            {
                IDictionary <string, object> dict = DeserializeDictionary(depth);
                // Try to coerce objects to the right type if they have the __serverType
                if (dict.ContainsKey(JavaScriptSerializer.ServerTypeFieldName))
                {
                    return(ObjectConverter.ConvertObjectToType(dict, null, _serializer));
                }
                return(dict);
            }

            if (IsNextElementArray(c))
            {
                return(DeserializeList(depth));
            }

            if (IsNextElementString(c))
            {
                return(DeserializeString());
            }

            return(DeserializePrimitiveObject());
        }