| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.google.javascript.jscomp.parsing; |
| 18 |
|
| 19 |
import com.google.javascript.rhino.ErrorReporter; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
public abstract class NullErrorReporter { |
| 26 |
private NullErrorReporter() { |
| 27 |
} |
| 28 |
|
| 29 |
public void error(String message, String sourceName, int line, |
| 30 |
int lineOffset) { |
| 31 |
} |
| 32 |
|
| 33 |
public void warning(String message, String sourceName, int line, |
| 34 |
int lineOffset) { |
| 35 |
} |
| 36 |
|
| 37 |
public static ErrorReporter forOldRhino() { |
| 38 |
return new OldRhinoNullReporter(); |
| 39 |
} |
| 40 |
|
| 41 |
public static com.google.javascript.rhino.head.ErrorReporter |
| 42 |
forNewRhino() { |
| 43 |
return new NewRhinoNullReporter(); |
| 44 |
} |
| 45 |
|
| 46 |
private static class NewRhinoNullReporter extends NullErrorReporter |
| 47 |
implements com.google.javascript.rhino.head.ErrorReporter { |
| 48 |
@Override |
| 49 |
public com.google.javascript.rhino.head.EvaluatorException |
| 50 |
runtimeError(String message, String sourceName, int line, |
| 51 |
String lineSource, int lineOffset) { |
| 52 |
return new com.google.javascript.rhino.head.EvaluatorException( |
| 53 |
message); |
| 54 |
} |
| 55 |
|
| 56 |
@Override |
| 57 |
public void error(String message, String sourceName, int line, |
| 58 |
String sourceLine, int lineOffset) { |
| 59 |
super.error(message, sourceName, line, lineOffset); |
| 60 |
} |
| 61 |
|
| 62 |
@Override |
| 63 |
public void warning(String message, String sourceName, int line, |
| 64 |
String sourceLine, int lineOffset) { |
| 65 |
super.warning(message, sourceName, line, lineOffset); |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
private static class OldRhinoNullReporter extends NullErrorReporter |
| 70 |
implements ErrorReporter { |
| 71 |
} |
| 72 |
} |