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 dart2js; | 5 part of dart2js; |
6 | 6 |
7 /** | 7 /** |
8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
9 * compiled. | 9 * compiled. |
10 */ | 10 */ |
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 // position. So we use the enclosing element instead. It is | 1949 // position. So we use the enclosing element instead. It is |
1950 // not a good error location, but cancel really is "internal | 1950 // not a good error location, but cancel really is "internal |
1951 // error" or "not implemented yet", so the vicinity is good | 1951 // error" or "not implemented yet", so the vicinity is good |
1952 // enough for now. | 1952 // enough for now. |
1953 element = element.enclosingElement; | 1953 element = element.enclosingElement; |
1954 // TODO(ahe): I plan to overhaul this infrastructure anyways. | 1954 // TODO(ahe): I plan to overhaul this infrastructure anyways. |
1955 } | 1955 } |
1956 if (element == null) { | 1956 if (element == null) { |
1957 element = currentElement; | 1957 element = currentElement; |
1958 } | 1958 } |
| 1959 if (element == null) { |
| 1960 return null; |
| 1961 } |
| 1962 |
1959 if (element.sourcePosition != null) { | 1963 if (element.sourcePosition != null) { |
1960 return element.sourcePosition; | 1964 return element.sourcePosition; |
1961 } | 1965 } |
1962 Token position = element.position; | 1966 Token position = element.position; |
1963 Uri uri = element.compilationUnit.script.readableUri; | 1967 Uri uri = element.compilationUnit.script.readableUri; |
1964 return (position == null) | 1968 return (position == null) |
1965 ? new SourceSpan(uri, 0, 0) | 1969 ? new SourceSpan(uri, 0, 0) |
1966 : spanFromTokens(position, position, uri); | 1970 : spanFromTokens(position, position, uri); |
1967 } | 1971 } |
1968 | 1972 |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 return futureClass.computeType(compiler).createInstantiation([elementType]); | 2477 return futureClass.computeType(compiler).createInstantiation([elementType]); |
2474 } | 2478 } |
2475 | 2479 |
2476 @override | 2480 @override |
2477 InterfaceType streamType([DartType elementType = const DynamicType()]) { | 2481 InterfaceType streamType([DartType elementType = const DynamicType()]) { |
2478 return streamClass.computeType(compiler).createInstantiation([elementType]); | 2482 return streamClass.computeType(compiler).createInstantiation([elementType]); |
2479 } | 2483 } |
2480 } | 2484 } |
2481 | 2485 |
2482 typedef void InternalErrorFunction(Spannable location, String message); | 2486 typedef void InternalErrorFunction(Spannable location, String message); |
OLD | NEW |