OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_backend; | 5 import '../common.dart'; |
| 6 import '../common/names.dart' show Identifiers, Names, Selectors, Uris; |
| 7 import '../compiler.dart' show Compiler; |
| 8 import '../elements/elements.dart'; |
| 9 import '../tree/tree.dart'; |
| 10 import '../types/types.dart'; |
| 11 |
| 12 import 'backend.dart'; |
6 | 13 |
7 /** | 14 /** |
8 * Categorizes `noSuchMethod` implementations. | 15 * Categorizes `noSuchMethod` implementations. |
9 * | 16 * |
10 * If user code includes `noSuchMethod` implementations, type inference is | 17 * If user code includes `noSuchMethod` implementations, type inference is |
11 * hindered because (for instance) any selector where the type of the | 18 * hindered because (for instance) any selector where the type of the |
12 * receiver is not known all implementations of `noSuchMethod` must be taken | 19 * receiver is not known all implementations of `noSuchMethod` must be taken |
13 * into account when inferring the return type. | 20 * into account when inferring the return type. |
14 * | 21 * |
15 * The situation can be ameliorated with some heuristics for disregarding some | 22 * The situation can be ameliorated with some heuristics for disregarding some |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 if (body.statements.nodes.head is ExpressionStatement) { | 265 if (body.statements.nodes.head is ExpressionStatement) { |
259 ExpressionStatement stmt = body.statements.nodes.head; | 266 ExpressionStatement stmt = body.statements.nodes.head; |
260 return stmt.expression is Throw; | 267 return stmt.expression is Throw; |
261 } | 268 } |
262 } | 269 } |
263 return false; | 270 return false; |
264 } | 271 } |
265 } | 272 } |
266 | 273 |
267 enum NsmCategory { DEFAULT, THROWING, NOT_APPLICABLE, OTHER, } | 274 enum NsmCategory { DEFAULT, THROWING, NOT_APPLICABLE, OTHER, } |
OLD | NEW |