Commit a52cc54f authored by pfeldman's avatar pfeldman Committed by Commit bot

DevTools: mute struct-related violations for snippets containing 'Symbol'.

Review-Url: https://codereview.chromium.org/2619933003
Cr-Commit-Position: refs/heads/master@{#442614}
parent beb68480
...@@ -3,6 +3,7 @@ package org.chromium.devtools.compiler; ...@@ -3,6 +3,7 @@ package org.chromium.devtools.compiler;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.io.Resources; import com.google.common.io.Resources;
import com.google.javascript.jscomp.*; import com.google.javascript.jscomp.*;
import com.google.javascript.jscomp.Compiler;
import org.kohsuke.args4j.CmdLineException; import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.CmdLineParser;
...@@ -192,6 +193,21 @@ public class Runner { ...@@ -192,6 +193,21 @@ public class Runner {
options.setCodingConvention(new DevToolsCodingConvention()); options.setCodingConvention(new DevToolsCodingConvention());
} }
@Override
protected Compiler createCompiler() {
Compiler compiler = new Compiler();
final LightweightMessageFormatter formatter = new LightweightMessageFormatter(compiler);
compiler.setErrorManager(new PrintStreamErrorManager(formatter, getErrorPrintStream()) {
@Override
public void report(CheckLevel level, JSError error) {
String text = formatter.formatError(error);
if (text.indexOf("access on a struct") == -1 || text.indexOf("Symbol") == -1)
super.report(level, error);
}
});
return compiler;
}
int execute() { int execute() {
try { try {
return doRun(); return doRun();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment