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 JsPostfixOperation extends JsUnaryOperation {
011      public JsPostfixOperation(JsUnaryOperator op) {
012        this(op, null);
013      }
014    
015      public JsPostfixOperation(JsUnaryOperator op, JsExpression arg) {
016        super(op, arg);
017      }
018    
019      @Override
020      public void accept(JsVisitor v) {
021        v.visitPostfixOperation(this);
022      }
023    
024        @Override
025        public void traverse(JsVisitorWithContext v, JsContext ctx) {
026            if (v.visit(this, ctx)) {
027                super.traverse(v, ctx);
028            }
029            v.endVisit(this, ctx);
030        }
031    
032        @NotNull
033        @Override
034        public JsPostfixOperation deepCopy() {
035            return new JsPostfixOperation(getOperator(), AstUtil.deepCopy(getArg())).withMetadataFrom(this);
036        }
037    }