| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of js; | 5 part of js; |
| 6 | 6 |
| 7 abstract class NodeVisitor<T> { | 7 abstract class NodeVisitor<T> { |
| 8 T visitProgram(Program node); | 8 T visitProgram(Program node); |
| 9 | 9 |
| 10 T visitBlock(Block node); | 10 T visitBlock(Block node); |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 | 858 |
| 859 int get precedenceLevel => PRIMARY; | 859 int get precedenceLevel => PRIMARY; |
| 860 } | 860 } |
| 861 | 861 |
| 862 Prefix typeOf(Expression argument) => new Prefix('typeof', argument); | 862 Prefix typeOf(Expression argument) => new Prefix('typeof', argument); |
| 863 | 863 |
| 864 Binary equals(Expression left, Expression right) { | 864 Binary equals(Expression left, Expression right) { |
| 865 return new Binary('==', left, right); | 865 return new Binary('==', left, right); |
| 866 } | 866 } |
| 867 | 867 |
| 868 Binary strictEquals(Expression left, Expression right) { |
| 869 return new Binary('===', left, right); |
| 870 } |
| 871 |
| 868 LiteralString string(String value) => new LiteralString('"$value"'); | 872 LiteralString string(String value) => new LiteralString('"$value"'); |
| 869 | 873 |
| 870 If if_(Expression condition, Node then, [Node otherwise]) { | 874 If if_(Expression condition, Node then, [Node otherwise]) { |
| 871 return (otherwise == null) | 875 return (otherwise == null) |
| 872 ? new If.noElse(condition, then) | 876 ? new If.noElse(condition, then) |
| 873 : new If(condition, then, otherwise); | 877 : new If(condition, then, otherwise); |
| 874 } | 878 } |
| 875 | 879 |
| 876 Return return_([Expression value]) => new Return(value); | 880 Return return_([Expression value]) => new Return(value); |
| 877 | 881 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 894 Fun fun(List<String> parameterNames, Block body) { | 898 Fun fun(List<String> parameterNames, Block body) { |
| 895 return new Fun(parameterNames.mappedBy((n) => new Parameter(n)).toList(), | 899 return new Fun(parameterNames.mappedBy((n) => new Parameter(n)).toList(), |
| 896 body); | 900 body); |
| 897 } | 901 } |
| 898 | 902 |
| 899 Assignment assign(Expression leftHandSide, Expression value) { | 903 Assignment assign(Expression leftHandSide, Expression value) { |
| 900 return new Assignment(leftHandSide, value); | 904 return new Assignment(leftHandSide, value); |
| 901 } | 905 } |
| 902 | 906 |
| 903 Expression undefined() => new Prefix('void', new LiteralNumber('0')); | 907 Expression undefined() => new Prefix('void', new LiteralNumber('0')); |
| OLD | NEW |