| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart' show Identifiers; | 8 import '../common/names.dart' show Identifiers; |
| 9 import '../common/resolution.dart' show Resolution, ParsingContext; | 9 import '../common/resolution.dart' show Resolution, ParsingContext; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 * system. | 1338 * system. |
| 1339 * | 1339 * |
| 1340 * The [functionSignature] is not available until the typedef element has been | 1340 * The [functionSignature] is not available until the typedef element has been |
| 1341 * resolved. | 1341 * resolved. |
| 1342 */ | 1342 */ |
| 1343 FunctionSignature functionSignature; | 1343 FunctionSignature functionSignature; |
| 1344 | 1344 |
| 1345 ResolutionTypedefType computeType(Resolution resolution) { | 1345 ResolutionTypedefType computeType(Resolution resolution) { |
| 1346 if (thisTypeCache != null) return thisTypeCache; | 1346 if (thisTypeCache != null) return thisTypeCache; |
| 1347 Typedef node = parseNode(resolution.parsingContext); | 1347 Typedef node = parseNode(resolution.parsingContext); |
| 1348 setThisAndRawTypes(createTypeVariables(node.templateParameters)); | 1348 setThisAndRawTypes(createTypeVariables(node.typeParameters)); |
| 1349 ensureResolved(resolution); | 1349 ensureResolved(resolution); |
| 1350 return thisTypeCache; | 1350 return thisTypeCache; |
| 1351 } | 1351 } |
| 1352 | 1352 |
| 1353 void ensureResolved(Resolution resolution) { | 1353 void ensureResolved(Resolution resolution) { |
| 1354 if (resolutionState == STATE_NOT_STARTED) { | 1354 if (resolutionState == STATE_NOT_STARTED) { |
| 1355 resolution.resolveTypedef(this); | 1355 resolution.resolveTypedef(this); |
| 1356 } | 1356 } |
| 1357 } | 1357 } |
| 1358 | 1358 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1736 * kept to provide full information about parameter names through the mirror | 1736 * kept to provide full information about parameter names through the mirror |
| 1737 * system. | 1737 * system. |
| 1738 */ | 1738 */ |
| 1739 FunctionSignature _functionSignatureCache; | 1739 FunctionSignature _functionSignatureCache; |
| 1740 | 1740 |
| 1741 FormalElementX(ElementKind elementKind, FunctionTypedElement enclosingElement, | 1741 FormalElementX(ElementKind elementKind, FunctionTypedElement enclosingElement, |
| 1742 this.definitions, Identifier identifier) | 1742 this.definitions, Identifier identifier) |
| 1743 : this.identifier = identifier, | 1743 : this.identifier = identifier, |
| 1744 super(identifier.source, elementKind, enclosingElement); | 1744 super(identifier.source, elementKind, enclosingElement); |
| 1745 | 1745 |
| 1746 FormalElementX.unnamed(ElementKind elementKind, | |
| 1747 FunctionTypedElement enclosingElement, | |
| 1748 this.definitions) | |
| 1749 : this.identifier = null, | |
| 1750 super("<unnamed>", elementKind, enclosingElement); | |
| 1751 | |
| 1752 /// Whether this is an unnamed parameter in a Function type. | |
| 1753 bool get isUnnamed => identifier == null; | |
| 1754 | |
| 1755 FunctionTypedElement get functionDeclaration => enclosingElement; | 1746 FunctionTypedElement get functionDeclaration => enclosingElement; |
| 1756 | 1747 |
| 1757 Modifiers get modifiers => definitions.modifiers; | 1748 Modifiers get modifiers => definitions.modifiers; |
| 1758 | 1749 |
| 1759 Token get position => identifier.getBeginToken(); | 1750 Token get position => identifier.getBeginToken(); |
| 1760 | 1751 |
| 1761 Node parseNode(ParsingContext parsing) => definitions; | 1752 Node parseNode(ParsingContext parsing) => definitions; |
| 1762 | 1753 |
| 1763 ResolutionDartType computeType(Resolution resolution) { | 1754 ResolutionDartType computeType(Resolution resolution) { |
| 1764 assert(invariant(this, type != null, | 1755 assert(invariant(this, type != null, |
| (...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3430 body = node.asFunctionExpression().body; | 3421 body = node.asFunctionExpression().body; |
| 3431 } | 3422 } |
| 3432 return new ParsedResolvedAst( | 3423 return new ParsedResolvedAst( |
| 3433 declaration, | 3424 declaration, |
| 3434 node, | 3425 node, |
| 3435 body, | 3426 body, |
| 3436 definingElement.treeElements, | 3427 definingElement.treeElements, |
| 3437 definingElement.compilationUnit.script.resourceUri); | 3428 definingElement.compilationUnit.script.resourceUri); |
| 3438 } | 3429 } |
| 3439 } | 3430 } |
| OLD | NEW |