forked from PureKrome/EcmaScript.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorReporter.cs
More file actions
91 lines (84 loc) · 3.66 KB
/
Copy pathErrorReporter.cs
File metadata and controls
91 lines (84 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//------------------------------------------------------------------------------
// <license file="ErrorReporter.cs">
//
// The use and distribution terms for this software are contained in the file
// named 'LICENSE', which can be found in the resources directory of this
// distribution.
//
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// </license>
//------------------------------------------------------------------------------
using System;
namespace EcmaScript.NET
{
/// <summary> This is interface defines a protocol for the reporting of
/// errors during JavaScript translation or execution.
///
/// </summary>
public interface ErrorReporter
{
/// <summary> Report a warning.
///
/// The implementing class may choose to ignore the warning
/// if it desires.
///
/// </summary>
/// <param name="message">a String describing the warning
/// </param>
/// <param name="sourceName">a String describing the JavaScript source
/// where the warning occured; typically a filename or URL
/// </param>
/// <param name="line">the line number associated with the warning
/// </param>
/// <param name="lineSource">the text of the line (may be null)
/// </param>
/// <param name="lineOffset">the offset into lineSource where problem was detected
/// </param>
void Warning (string message, string sourceName, int line, string lineSource, int lineOffset);
/// <summary> Report an error.
///
/// The implementing class is free to throw an exception if
/// it desires.
///
/// If execution has not yet begun, the JavaScript engine is
/// free to find additional errors rather than terminating
/// the translation. It will not execute a script that had
/// errors, however.
///
/// </summary>
/// <param name="message">a String describing the error
/// </param>
/// <param name="sourceName">a String describing the JavaScript source
/// where the error occured; typically a filename or URL
/// </param>
/// <param name="line">the line number associated with the error
/// </param>
/// <param name="lineSource">the text of the line (may be null)
/// </param>
/// <param name="lineOffset">the offset into lineSource where problem was detected
/// </param>
void Error (string message, string sourceName, int line, string lineSource, int lineOffset);
/// <summary> Creates an EvaluatorException that may be thrown.
///
/// runtimeErrors, unlike errors, will always terminate the
/// current script.
///
/// </summary>
/// <param name="message">a String describing the error
/// </param>
/// <param name="sourceName">a String describing the JavaScript source
/// where the error occured; typically a filename or URL
/// </param>
/// <param name="line">the line number associated with the error
/// </param>
/// <param name="lineSource">the text of the line (may be null)
/// </param>
/// <param name="lineOffset">the offset into lineSource where problem was detected
/// </param>
/// <returns> an EvaluatorException that will be thrown.
/// </returns>
EcmaScriptRuntimeException RuntimeError (string message, string sourceName, int line, string lineSource, int lineOffset);
}
}