protected internal virtual StackFrame TryParseSingleStackFrame()

in src/SourceMapToolkit.CallstackDeminifier/StackTraceParser.cs [136:164]


		protected internal virtual StackFrame TryParseSingleStackFrame(string frame)
		{
			if (frame == null)
			{
				throw new ArgumentNullException(nameof(frame));
			}

			Match lineNumberMatch = _lineNumberRegex.Match(frame);

			if (!lineNumberMatch.Success)
			{
				return null;
			}

			StackFrame result = new StackFrame {MethodName = TryExtractMethodNameFromFrame(frame)};

			if (lineNumberMatch.Success)
			{
				result.FilePath = lineNumberMatch.Groups[1].Value;
				result.SourcePosition = new SourcePosition(
					// The browser provides one-based line and column numbers, but the
					// rest of this library uses zero-based values. Normalize to make
					// the stack frames zero based.
					zeroBasedLineNumber: int.Parse(lineNumberMatch.Groups[2].Value, CultureInfo.InvariantCulture) - 1,
					zeroBasedColumnNumber: int.Parse(lineNumberMatch.Groups[3].Value, CultureInfo.InvariantCulture) -1);
			}

			return result;
		}