Search in sources :

Example 1 with DiagnosticType

use of com.google.javascript.jscomp.DiagnosticType in project closure-compiler by google.

the class GwtRunner method toNativeErrorArray.

/**
 * Convert a list of {@link JSError} instances to a JS array containing plain objects.
 */
private static JavaScriptObject[] toNativeErrorArray(List<JSError> errors) {
    JavaScriptObject[] out = new JavaScriptObject[errors.size()];
    for (int i = 0; i < errors.size(); ++i) {
        JSError error = errors.get(i);
        DiagnosticType type = error.getType();
        out[i] = createError(error.sourceName, error.description, type != null ? type.key : null, error.lineNumber, error.getCharno());
    }
    return out;
}
Also used : JavaScriptObject(com.google.gwt.core.client.JavaScriptObject) DiagnosticType(com.google.javascript.jscomp.DiagnosticType) EntryPoint(com.google.gwt.core.client.EntryPoint) JSError(com.google.javascript.jscomp.JSError)

Aggregations

EntryPoint (com.google.gwt.core.client.EntryPoint)1 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)1 DiagnosticType (com.google.javascript.jscomp.DiagnosticType)1 JSError (com.google.javascript.jscomp.JSError)1