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/ast/FunctionCall.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.ast; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.mozilla.javascript.Token; /** * AST node for a function call. Node type is {@link Token#CALL}. */ public class FunctionCall extends AstNode { protected static final List<AstNode> NO_ARGS = Collections.unmodifiableList(new ArrayList<AstNode>()); protected AstNode target; protected List<AstNode> arguments; protected int lp = -1; protected int rp = -1; { type = Token.CALL; } public FunctionCall() { } public FunctionCall(int pos) { super(pos); } public FunctionCall(int pos, int len) { super(pos, len); } /** * Returns node evaluating to the function to call */ public AstNode getTarget() { return target; } /** * Sets node evaluating to the function to call, and sets * its parent to this node. * @param target node evaluating to the function to call. * @throws IllegalArgumentException} if target is {@code null} */ public void setTarget(AstNode target) { assertNotNull(target); this.target = target; target.setParent(this); } /** * Returns function argument list * @return function argument list, or an empty immutable list if * there are no arguments. */ public List<AstNode> getArguments() { return arguments != null ? arguments : NO_ARGS; } /** * Sets function argument list * @param arguments function argument list. Can be {@code null}, * in which case any existing args are removed. */ public void setArguments(List<AstNode> arguments) { if (arguments == null) { this.arguments = null; } else { if (this.arguments != null) this.arguments.clear(); for (AstNode arg : arguments) { addArgument(arg); } } } /** * Adds an argument to the list, and sets its parent to this node. * @param arg the argument node to add to the list * @throws IllegalArgumentException} if arg is {@code null} */ public void addArgument(AstNode arg) { assertNotNull(arg); if (arguments == null) { arguments = new ArrayList<AstNode>(); } arguments.add(arg); arg.setParent(this); } /** * Returns left paren position, -1 if missing */ public int getLp() { return lp; } /** * Sets left paren position * @param lp left paren position */ public void setLp(int lp) { this.lp = lp; } /** * Returns right paren position, -1 if missing */ public int getRp() { return rp; } /** * Sets right paren position */ public void setRp(int rp) { this.rp = rp; } /** * Sets both paren positions */ public void setParens(int lp, int rp) { this.lp = lp; this.rp = rp; } @Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(target.toSource(0)); sb.append("("); if (arguments != null) { printList(arguments, sb); } sb.append(")"); if(this.getInlineComment() != null) { sb.append(this.getInlineComment().toSource(depth)).append("\n"); } return sb.toString(); } /** * Visits this node, the target object, and the arguments. */ @Override public void visit(NodeVisitor v) { if (v.visit(this)) { target.visit(v); for (AstNode arg : getArguments()) { arg.visit(v); } } } }
⏎ org/mozilla/javascript/ast/FunctionCall.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, 34647👍, 1💬
Popular Posts:
The Web Services Description Language for Java Toolkit (WSDL4J), Release 1.6.2, allows the creation,...
JDK 11 jdk.jshell.jmod is the JMOD file for JDK 11 JShell tool, which can be invoked by the "jshell"...
JDK 17 jdk.compiler.jmod is the JMOD file for JDK 17 Compiler tool, which can be invoked by the "jav...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
What Is log4j-1.2.15.jar? I got the JAR file from apache-log4j-1.2.15.zip. log4j-1.2.15.jar is the v...