Java Code Examples for jdk.nashorn.internal.runtime.ErrorManager#setLimit()
The following examples show how to use
jdk.nashorn.internal.runtime.ErrorManager#setLimit() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParserTest.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = sourceFor(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { exp.printStackTrace(); log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }
Example 2
Source File: ParserTest.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = sourceFor(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { exp.printStackTrace(); log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }
Example 3
Source File: ParserTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = sourceFor(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { exp.printStackTrace(); log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }
Example 4
Source File: ParserTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = sourceFor(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { exp.printStackTrace(); log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }
Example 5
Source File: ParserTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = sourceFor(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { exp.printStackTrace(); log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }
Example 6
Source File: ParserTest.java From hottub with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = sourceFor(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { exp.printStackTrace(); log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }
Example 7
Source File: ParserTest.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = Source.readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = new Source(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }
Example 8
Source File: ParserTest.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = Source.readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = new Source(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }
Example 9
Source File: ParserTest.java From jdk8u_nashorn with GNU General Public License v2.0 | 4 votes |
private void parseJSFile(final File file, final TestFilter filter) { if (VERBOSE) { log("Begin parsing " + file.getAbsolutePath()); } try { final char[] buffer = readFully(file); boolean excluded = false; if (filter != null) { final String content = new String(buffer); excluded = filter.exclude(file, content); } if (excluded) { if (VERBOSE) { log("Skipping " + file.getAbsolutePath()); } skipped++; return; } final ErrorManager errors = new ErrorManager() { @Override public void error(final String msg) { log(msg); } }; errors.setLimit(0); final Source source = sourceFor(file.getAbsolutePath(), buffer); new Parser(context.getEnv(), source, errors, context.getEnv()._strict, null).parse(); if (errors.getNumberOfErrors() > 0) { log("Parse failed: " + file.getAbsolutePath()); failed++; } else { passed++; } } catch (final Throwable exp) { exp.printStackTrace(); log("Parse failed: " + file.getAbsolutePath() + " : " + exp); if (VERBOSE) { exp.printStackTrace(System.out); } failed++; } if (VERBOSE) { log("Done parsing " + file.getAbsolutePath()); } }