Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2013 Douglas Campos, and individual contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.dynjs.parser.ast;
public class FunctionDeclaration extends AbstractStatement {
    private FunctionDescriptor descriptor;
    public FunctionDeclaration(FunctionDescriptor descriptor) {
        this. = descriptor;
    public Position getPosition() {
        return this..getPosition();
    public String getIdentifier() {
        return this..getIdentifier();
    public String[] getFormalParameters() {
        return this..getFormalParameterNames();
    public BlockStatement getBlock() {
        return this..getBlock();
    public boolean isStrict() {
        return this..isStrict();
    public int getSizeMetric() {
        return this..getSizeMetric();
    public String toString() {
        return this..toString();
        return .getBlock().getFunctionDeclarations();
    public String toIndentedString(String indent) {
        StringBuffer buf = new StringBuffer();
        buf.append(indent).append("function").append(this..getIdentifier() == null ? "" : " " + this..getIdentifier()).append("(");
        String[] params = this..getFormalParameterNames();
        for (int i = 0; i < params.length; ++i) {
            if (i > 0) {
                buf.append(", ");
        buf.append(") {\n");
        buf.append(this..getBlock().toIndentedString(indent + "  "));
        return buf.toString();
    public void accept(ExecutionContext contextCodeVisitor visitorboolean strict) {
New to GrepCode? Check out our FAQ X