BreakLocation.cs 758 B

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