Chromium Code Reviews| 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 library dart2js.resolution.members; | 5 library dart2js.resolution.members; |
| 6 | 6 |
| 7 import '../common/names.dart' show | 7 import '../common/names.dart' show |
| 8 Selectors; | 8 Selectors; |
| 9 import '../compiler.dart' show | 9 import '../compiler.dart' show |
| 10 Compiler; | 10 Compiler; |
| (...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1946 MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER, | 1946 MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER, |
| 1947 {'typeVariableName': name}, | 1947 {'typeVariableName': name}, |
| 1948 isError: true); | 1948 isError: true); |
| 1949 registry.registerCompileTimeError(error); | 1949 registry.registerCompileTimeError(error); |
| 1950 semantics = new StaticAccess.invalid(error); | 1950 semantics = new StaticAccess.invalid(error); |
| 1951 // TODO(johnniwinther): Clean up registration of elements and selectors | 1951 // TODO(johnniwinther): Clean up registration of elements and selectors |
| 1952 // for this case. | 1952 // for this case. |
| 1953 } else { | 1953 } else { |
| 1954 semantics = new StaticAccess.typeParameterTypeLiteral(element); | 1954 semantics = new StaticAccess.typeParameterTypeLiteral(element); |
| 1955 } | 1955 } |
| 1956 registry.registerClassUsingVariableExpression(element.enclosingClass); | 1956 registry.registerTypeVariableExpression(element); |
| 1957 registry.registerTypeVariableExpression(); | |
| 1958 | 1957 |
| 1959 registry.useElement(node, element); | 1958 registry.useElement(node, element); |
| 1960 registry.registerTypeLiteral(node, element.type); | 1959 registry.registerTypeLiteral(node, element.type); |
| 1961 | 1960 |
| 1962 if (node.isCall) { | 1961 if (node.isCall) { |
| 1963 CallStructure callStructure = | 1962 CallStructure callStructure = |
| 1964 resolveArguments(node.argumentsNode).callStructure; | 1963 resolveArguments(node.argumentsNode).callStructure; |
| 1965 Selector selector = callStructure.callSelector; | 1964 Selector selector = callStructure.callSelector; |
| 1966 // TODO(23998): Remove this when all information goes through | 1965 // TODO(23998): Remove this when all information goes through |
| 1967 // the [SendStructure]. | 1966 // the [SendStructure]. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2000 MessageKind.IF_NULL_ASSIGNING_TYPE, const {}); | 1999 MessageKind.IF_NULL_ASSIGNING_TYPE, const {}); |
| 2001 // TODO(23998): Remove these when all information goes through | 2000 // TODO(23998): Remove these when all information goes through |
| 2002 // the [SendStructure]. | 2001 // the [SendStructure]. |
| 2003 registry.useElement(node.selector, element); | 2002 registry.useElement(node.selector, element); |
| 2004 } else { | 2003 } else { |
| 2005 error = reportAndCreateErroneousElement( | 2004 error = reportAndCreateErroneousElement( |
| 2006 node.selector, name.text, | 2005 node.selector, name.text, |
| 2007 MessageKind.ASSIGNING_TYPE, const {}); | 2006 MessageKind.ASSIGNING_TYPE, const {}); |
| 2008 } | 2007 } |
| 2009 | 2008 |
| 2009 if (node.isComplex) { | |
|
Johnni Winther
2015/09/15 13:23:40
Maybe add the comment: "We read the type variable
| |
| 2010 registry.registerTypeVariableExpression(element); | |
| 2011 } | |
| 2012 | |
| 2010 // TODO(23998): Remove this when all information goes through | 2013 // TODO(23998): Remove this when all information goes through |
| 2011 // the [SendStructure]. | 2014 // the [SendStructure]. |
| 2012 registry.useElement(node, error); | 2015 registry.useElement(node, error); |
| 2013 registry.registerTypeLiteral(node, element.type); | 2016 registry.registerTypeLiteral(node, element.type); |
| 2014 registry.registerThrowNoSuchMethod(); | 2017 registry.registerThrowNoSuchMethod(); |
| 2015 semantics = new StaticAccess.typeParameterTypeLiteral(element); | 2018 semantics = new StaticAccess.typeParameterTypeLiteral(element); |
| 2016 } | 2019 } |
| 2017 return handleUpdate(node, name, semantics); | 2020 return handleUpdate(node, name, semantics); |
| 2018 } | 2021 } |
| 2019 | 2022 |
| (...skipping 2644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4664 } | 4667 } |
| 4665 return const NoneResult(); | 4668 return const NoneResult(); |
| 4666 } | 4669 } |
| 4667 } | 4670 } |
| 4668 | 4671 |
| 4669 /// Looks up [name] in [scope] and unwraps the result. | 4672 /// Looks up [name] in [scope] and unwraps the result. |
| 4670 Element lookupInScope(Compiler compiler, Node node, | 4673 Element lookupInScope(Compiler compiler, Node node, |
| 4671 Scope scope, String name) { | 4674 Scope scope, String name) { |
| 4672 return Elements.unwrap(scope.lookup(name), compiler, node); | 4675 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4673 } | 4676 } |
| OLD | NEW |