| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
| 7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 8 import 'mock_compiler.dart'; | 8 import 'mock_compiler.dart'; |
| 9 import 'package:compiler/src/js/js.dart' as jsAst; | 9 import 'package:compiler/src/js/js.dart' as jsAst; |
| 10 import 'package:compiler/src/js/js.dart' show js; | 10 import 'package:compiler/src/js/js.dart' show js; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 testExpression('!x == false'), | 130 testExpression('!x == false'), |
| 131 testExpression('var foo = void 0'), | 131 testExpression('var foo = void 0'), |
| 132 testExpression('delete foo.bar'), | 132 testExpression('delete foo.bar'), |
| 133 testExpression('delete foo'), | 133 testExpression('delete foo'), |
| 134 testExpression('x in y'), | 134 testExpression('x in y'), |
| 135 testExpression('x instanceof y'), | 135 testExpression('x instanceof y'), |
| 136 testExpression('a * b in c * d'), | 136 testExpression('a * b in c * d'), |
| 137 testExpression('a * b instanceof c * d'), | 137 testExpression('a * b instanceof c * d'), |
| 138 testError('x typeof y', 'Unparsed junk'), | 138 testError('x typeof y', 'Unparsed junk'), |
| 139 testExpression('x &= ~mask'), | 139 testExpression('x &= ~mask'), |
| 140 // Await is parsed as an unary prefix operator. |
| 141 testExpression('var foo = await 0'), |
| 142 testExpression('await x++'), |
| 143 testExpression('void (await (x++))', 'void await x++'), |
| 144 testExpression('void (await x)++'), |
| 145 testExpression('++(await x)++'), |
| 140 // Adjacent tokens. | 146 // Adjacent tokens. |
| 141 testExpression('foo[x[bar]]'), | 147 testExpression('foo[x[bar]]'), |
| 142 testExpression('foo[[bar]]'), | 148 testExpression('foo[[bar]]'), |
| 143 // Prefix ++ etc. | 149 // Prefix ++ etc. |
| 144 testExpression("++x"), | 150 testExpression("++x"), |
| 145 testExpression("++foo.bar"), | 151 testExpression("++foo.bar"), |
| 146 testExpression("+x"), | 152 testExpression("+x"), |
| 147 testExpression("+foo.bar"), | 153 testExpression("+foo.bar"), |
| 148 testExpression("-x"), | 154 testExpression("-x"), |
| 149 testExpression("-foo.bar"), | 155 testExpression("-foo.bar"), |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 testExpression("y = a == null ? b + c : a + c"), | 193 testExpression("y = a == null ? b + c : a + c"), |
| 188 testExpression("foo = a ? b : c ? d : e"), | 194 testExpression("foo = a ? b : c ? d : e"), |
| 189 testExpression("foo = a ? b ? c : d : e"), | 195 testExpression("foo = a ? b ? c : d : e"), |
| 190 testExpression("foo = (a = v) ? b = w : c = x ? d = y : e = z"), | 196 testExpression("foo = (a = v) ? b = w : c = x ? d = y : e = z"), |
| 191 testExpression("foo = (a = v) ? b = w ? c = x : d = y : e = z"), | 197 testExpression("foo = (a = v) ? b = w ? c = x : d = y : e = z"), |
| 192 // Stacked assignment. | 198 // Stacked assignment. |
| 193 testExpression("a = b = c"), | 199 testExpression("a = b = c"), |
| 194 testExpression("var a = b = c"), | 200 testExpression("var a = b = c"), |
| 195 ])); | 201 ])); |
| 196 } | 202 } |
| OLD | NEW |