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/NativeFunction.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; import org.mozilla.javascript.debug.DebuggableScript; /** * This class implements the Function native object. * See ECMA 15.3. * @author Norris Boyd */ public abstract class NativeFunction extends BaseFunction { private static final long serialVersionUID = 8713897114082216401L; public final void initScriptFunction(Context cx, Scriptable scope) { initScriptFunction(cx, scope, isGeneratorFunction()); } public final void initScriptFunction(Context cx, Scriptable scope, boolean es6GeneratorFunction) { ScriptRuntime.setFunctionProtoAndParent(this, scope, es6GeneratorFunction); } /** * @param indent How much to indent the decompiled result * * @param flags Flags specifying format of decompilation output */ @Override final String decompile(int indent, int flags) { String encodedSource = getEncodedSource(); if (encodedSource == null) { return super.decompile(indent, flags); } UintMap properties = new UintMap(1); properties.put(Decompiler.INITIAL_INDENT_PROP, indent); return Decompiler.decompile(encodedSource, flags, properties); } @Override public int getLength() { int paramCount = getParamCount(); if (getLanguageVersion() != Context.VERSION_1_2) { return paramCount; } Context cx = Context.getContext(); NativeCall activation = ScriptRuntime.findFunctionActivation(cx, this); if (activation == null) { return paramCount; } return activation.originalArgs.length; } @Override public int getArity() { return getParamCount(); } /** * @deprecated Use {@link BaseFunction#getFunctionName()} instead. * For backwards compatibility keep an old method name used by * Batik and possibly others. */ @Deprecated public String jsGet_name() { return getFunctionName(); } /** * Get encoded source string. */ public String getEncodedSource() { return null; } public DebuggableScript getDebuggableView() { return null; } /** * Resume execution of a suspended generator. * @param cx The current context * @param scope Scope for the parent generator function * @param operation The resumption operation (next, send, etc.. ) * @param state The generator state (has locals, stack, etc.) * @param value The return value of yield (if required). * @return The next yielded value (if any) */ public Object resumeGenerator(Context cx, Scriptable scope, int operation, Object state, Object value) { throw new EvaluatorException("resumeGenerator() not implemented"); } protected abstract int getLanguageVersion(); /** * Get number of declared parameters. It should be 0 for scripts. */ protected abstract int getParamCount(); /** * Get number of declared parameters and variables defined through var * statements. */ protected abstract int getParamAndVarCount(); /** * Get parameter or variable name. * If <code>index < {@link #getParamCount()}</code>, then return the name of the * corresponding parameter. Otherwise return the name of variable. */ protected abstract String getParamOrVarName(int index); /** * Get parameter or variable const-ness. * If <code>index < {@link #getParamCount()}</code>, then return the const-ness * of the corresponding parameter. Otherwise return whether the variable is * const. */ protected boolean getParamOrVarConst(int index) { // By default return false to preserve compatibility with existing // classes subclassing this class, which are mostly generated by jsc // from earlier Rhino versions. See Bugzilla #396117. return false; } }
⏎ org/mozilla/javascript/NativeFunction.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, 35492👍, 1💬
Popular Posts:
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module. JDK 11 Charsets module compile...
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was develo...
commons-fileupload-1.3.3 -sources.jaris the source JAR file for Apache Commons FileUpload 1.3., whic...
JDK 11 jdk.dynalink.jmod is the JMOD file for JDK 11 Dynamic Linking module. JDK 11 Dynamic Linking ...
Java Advanced Imaging (JAI) is a Java platform extension API that provides a set of object-oriented ...