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 public final class JsExpressionStatement extends AbstractNode implements JsStatement { 008 private JsExpression expression; 009 010 public JsExpressionStatement(JsExpression expression) { 011 this.expression = expression; 012 } 013 014 public JsExpression getExpression() { 015 return expression; 016 } 017 018 @Override 019 public void accept(JsVisitor v) { 020 v.visitExpressionStatement(this); 021 } 022 023 @Override 024 public void acceptChildren(JsVisitor visitor) { 025 visitor.accept(expression); 026 } 027 028 @Override 029 public Object getSource() { 030 return null; 031 } 032 033 @Override 034 public void setSource(Object info) { 035 throw new IllegalStateException("You must not set source info for JsExpressionStatement, set for expression"); 036 } 037 038 @Override 039 public JsNode source(Object info) { 040 throw new IllegalStateException("You must not set source info for JsExpressionStatement, set for expression"); 041 } 042 }