BreakLocation.cs 730 B

12345678910111213141516171819202122232425262728
  1. namespace Jint.Runtime.Debugger;
  2. /// <summary>
  3. /// BreakLocation is a combination of an Esprima position (line and column) and a source (path or identifier of script).
  4. /// Like Esprima, first column is 0 and first line is 1.
  5. /// </summary>
  6. public sealed record BreakLocation
  7. {
  8. public BreakLocation(string? source, int line, int column)
  9. {
  10. Source = source;
  11. Line = line;
  12. Column = column;
  13. }
  14. public BreakLocation(int line, int column) : this(null, line, column)
  15. {
  16. }
  17. public BreakLocation(string? source, Position position) : this(source, position.Line, position.Column)
  18. {
  19. }
  20. public string? Source { get; }
  21. public int Line { get; }
  22. public int Column { get; }
  23. }