001 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
002 // for details. All rights reserved. Use of this source code is governed by a
003 // BSD-style license that can be found in the LICENSE file.
004
005 package com.google.dart.compiler.backend.js.ast;
006
007 import com.google.dart.compiler.common.Symbol;
008 import org.jetbrains.annotations.NotNull;
009
010 /**
011 * A JavaScript parameter.
012 */
013 public final class JsParameter extends SourceInfoAwareJsNode implements HasName {
014 @NotNull
015 private final JsName name;
016
017 public JsParameter(@NotNull JsName name) {
018 this.name = name;
019 }
020
021 @Override
022 @NotNull
023 public JsName getName() {
024 return name;
025 }
026
027 @Override
028 @NotNull
029 public Symbol getSymbol() {
030 return name;
031 }
032
033 @Override
034 public void accept(JsVisitor v) {
035 v.visitParameter(this);
036 }
037
038 @Override
039 public void traverse(JsVisitorWithContext v, JsContext ctx) {
040 v.visit(this, ctx);
041 v.endVisit(this, ctx);
042 }
043
044 @NotNull
045 @Override
046 public JsParameter deepCopy() {
047 return new JsParameter(name).withMetadataFrom(this);
048 }
049 }