Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
Rhino JavaScript Java Library Source Code
Rhino JavaScript Java Library is an open-source implementation of JavaScript written entirely in Java.
Rhino JavaScript Java Library Source Code files are provided in binary package (rhino-1.7.14.zip).
You can also browse the source code below:
✍: FYIcenter.com
⏎ org/mozilla/javascript/DefaultErrorReporter.java
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.javascript; /** * This is the default error reporter for JavaScript. * * @author Norris Boyd */ class DefaultErrorReporter implements ErrorReporter { static final DefaultErrorReporter instance = new DefaultErrorReporter(); private boolean forEval; private ErrorReporter chainedReporter; private DefaultErrorReporter() { } static ErrorReporter forEval(ErrorReporter reporter) { DefaultErrorReporter r = new DefaultErrorReporter(); r.forEval = true; r.chainedReporter = reporter; return r; } @Override public void warning(String message, String sourceURI, int line, String lineText, int lineOffset) { if (chainedReporter != null) { chainedReporter.warning( message, sourceURI, line, lineText, lineOffset); } else { // Do nothing } } @Override public void error(String message, String sourceURI, int line, String lineText, int lineOffset) { if (forEval) { // Assume error message strings that start with "TypeError: " // should become TypeError exceptions. A bit of a hack, but we // don't want to change the ErrorReporter interface. String error = "SyntaxError"; final String TYPE_ERROR_NAME = "TypeError"; final String DELIMETER = ": "; final String prefix = TYPE_ERROR_NAME + DELIMETER; if (message.startsWith(prefix)) { error = TYPE_ERROR_NAME; message = message.substring(prefix.length()); } throw ScriptRuntime.constructError(error, message, sourceURI, line, lineText, lineOffset); } if (chainedReporter != null) { chainedReporter.error( message, sourceURI, line, lineText, lineOffset); } else { throw runtimeError( message, sourceURI, line, lineText, lineOffset); } } @Override public EvaluatorException runtimeError(String message, String sourceURI, int line, String lineText, int lineOffset) { if (chainedReporter != null) { return chainedReporter.runtimeError(message, sourceURI, line, lineText, lineOffset); } return new EvaluatorException(message, sourceURI, line, lineText, lineOffset); } }
⏎ org/mozilla/javascript/DefaultErrorReporter.java
Or download all of them as a single archive file:
File name: rhino-1.7.14-sources.jar File size: 1029165 bytes Release date: 2022-01-06 Download
⇒ Example code to Test rhino-runtime-1.7.14.jar
⇐ Download Rhino JavaScript Binary Package
2022-05-03, 35577👍, 1💬
Popular Posts:
JDK 11 java.security.jgss.jmod is the JMOD file for JDK 11 Security JGSS (Java Generic Security Serv...
What Is jtds-1.2.2.jar? jtds-1.2.2.jar is the JAR files of jTDS Java library 1.2.2, which is a JDBC ...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...
Provides support for the runtime platform, core utility methods and the extension registry. JAR File...
maven-core-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Core module. Apache Maven is a software ...