Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
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 (322)
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/ScriptStackElement.java
/* 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;
import java.io.Serializable;
/**
* This class represents an element on the script execution stack.
* @see RhinoException#getScriptStack()
* @author Hannes Wallnoefer
* @since 1.7R3
*/
public final class ScriptStackElement implements Serializable {
private static final long serialVersionUID = -6416688260860477449L;
public final String fileName;
public final String functionName;
public final int lineNumber;
public ScriptStackElement(String fileName, String functionName, int lineNumber) {
this.fileName = fileName;
this.functionName = functionName;
this.lineNumber = lineNumber;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
renderMozillaStyle(sb);
return sb.toString();
}
/**
* Render stack element in Java-inspired style:
* <code> at fileName:lineNumber (functionName)</code>
*
* @param sb the StringBuilder to append to
*/
public void renderJavaStyle(StringBuilder sb) {
sb.append("\tat ").append(fileName);
if (lineNumber > -1) {
sb.append(':').append(lineNumber);
}
if (functionName != null) {
sb.append(" (").append(functionName).append(')');
}
}
/**
* Render stack element in Mozilla/Firefox style:
* <code>functionName()@fileName:lineNumber</code>
*
* @param sb the StringBuilder to append to
*/
public void renderMozillaStyle(StringBuilder sb) {
if (functionName != null) {
sb.append(functionName).append("()");
}
sb.append('@').append(fileName);
if (lineNumber > -1) {
sb.append(':').append(lineNumber);
}
}
/**
* Render stack element in V8 style:
* <code> at functionName (fileName:lineNumber:columnNumber)</code>
* or:
* <code> at fileName:lineNumber:columnNumber</code>
*
* @param sb the StringBuilder to append to
*/
public void renderV8Style(StringBuilder sb) {
sb.append(" at ");
if ((functionName == null) || "anonymous".equals(functionName) || "undefined"
.equals(functionName)) {
// Anonymous functions in V8 don't have names in the stack trace
appendV8Location(sb);
} else {
sb.append(functionName).append(" (");
appendV8Location(sb);
sb.append(')');
}
}
private void appendV8Location(StringBuilder sb) {
sb.append(fileName).append(':');
sb.append(lineNumber > -1 ? lineNumber : 0).append(":0");
}
}
⏎ org/mozilla/javascript/ScriptStackElement.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, ≈205🔥, 1💬
Popular Posts:
JDK 11 java.compiler.jmod is the JMOD file for JDK 11 Compiler module. JDK 11 Compiler module compil...
JDK 11 jdk.management.agent.jmo dis the JMOD file for JDK 11 Management Agent module. JDK 11 Managem...
itextpdf.jar is a component in iText 5 Java library to provide core functionalities. iText Java libr...
Java Cryptography Extension 1.6 JAR File Size and Download Location: File name: jce.jar, jce-1.6.jar...
maven-core-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Core module. Apache Maven is a software ...