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.util.AstUtil;
008 import org.jetbrains.annotations.NotNull;
009
010 public final class JsPrefixOperation extends JsUnaryOperation {
011 public JsPrefixOperation(JsUnaryOperator op, JsExpression arg) {
012 super(op, arg);
013 }
014
015 @Override
016 public void accept(JsVisitor v) {
017 v.visitPrefixOperation(this);
018 }
019
020 @Override
021 public void traverse(JsVisitorWithContext v, JsContext ctx) {
022 if (v.visit(this, ctx)) {
023 super.traverse(v, ctx);
024 }
025 v.endVisit(this, ctx);
026 }
027
028 @NotNull
029 @Override
030 public JsPrefixOperation deepCopy() {
031 return new JsPrefixOperation(getOperator(), AstUtil.deepCopy(getArg())).withMetadataFrom(this);
032 }
033 }