| 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 /** | 5 /** |
| 6 * A function element that represents a closure call. The signature is copied | 6 * A function element that represents a closure call. The signature is copied |
| 7 * from the given element. | 7 * from the given element. |
| 8 */ | 8 */ |
| 9 class ClosureInvocationElement extends FunctionElement { | 9 class ClosureInvocationElement extends FunctionElement { |
| 10 ClosureInvocationElement(SourceString name, | 10 ClosureInvocationElement(SourceString name, |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 if (!checkedSetters.isEmpty()) { | 654 if (!checkedSetters.isEmpty()) { |
| 655 buffer.add(',\n'); | 655 buffer.add(',\n'); |
| 656 buffer.add('${Strings.join(checkedSetters, ",\n")}'); | 656 buffer.add('${Strings.join(checkedSetters, ",\n")}'); |
| 657 } | 657 } |
| 658 emitInstanceMembers(classElement, buffer, true); | 658 emitInstanceMembers(classElement, buffer, true); |
| 659 buffer.add('\n};\n\n'); | 659 buffer.add('\n};\n\n'); |
| 660 } | 660 } |
| 661 | 661 |
| 662 void generateTypeTests(ClassElement cls, | 662 void generateTypeTests(ClassElement cls, |
| 663 void generateTypeTest(ClassElement element)) { | 663 void generateTypeTest(ClassElement element)) { |
| 664 if (compiler.codegenWorld.isChecks.contains(cls)) { | 664 if (compiler.codegenWorld.checkedClasses.contains(cls)) { |
| 665 generateTypeTest(cls); | 665 generateTypeTest(cls); |
| 666 } | 666 } |
| 667 generateInterfacesIsTests(cls, generateTypeTest, new Set<Element>()); | 667 generateInterfacesIsTests(cls, generateTypeTest, new Set<Element>()); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void generateInterfacesIsTests(ClassElement cls, | 670 void generateInterfacesIsTests(ClassElement cls, |
| 671 void generateTypeTest(ClassElement element), | 671 void generateTypeTest(ClassElement element), |
| 672 Set<Element> alreadyGenerated) { | 672 Set<Element> alreadyGenerated) { |
| 673 for (DartType interfaceType in cls.interfaces) { | 673 for (DartType interfaceType in cls.interfaces) { |
| 674 Element element = interfaceType.element; | 674 Element element = interfaceType.element; |
| 675 if (!alreadyGenerated.contains(element) && | 675 if (!alreadyGenerated.contains(element) && |
| 676 compiler.codegenWorld.isChecks.contains(element)) { | 676 compiler.codegenWorld.checkedClasses.contains(element)) { |
| 677 alreadyGenerated.add(element); | 677 alreadyGenerated.add(element); |
| 678 generateTypeTest(element); | 678 generateTypeTest(element); |
| 679 } | 679 } |
| 680 generateInterfacesIsTests(element, generateTypeTest, alreadyGenerated); | 680 generateInterfacesIsTests(element, generateTypeTest, alreadyGenerated); |
| 681 } | 681 } |
| 682 } | 682 } |
| 683 | 683 |
| 684 void emitClasses(CodeBuffer buffer) { | 684 void emitClasses(CodeBuffer buffer) { |
| 685 Set<ClassElement> instantiatedClasses = | 685 Set<ClassElement> instantiatedClasses = |
| 686 compiler.codegenWorld.instantiatedClasses; | 686 compiler.codegenWorld.instantiatedClasses; |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 sourceName = token.slowToString(); | 1297 sourceName = token.slowToString(); |
| 1298 } | 1298 } |
| 1299 sourceMapBuilder.addMapping( | 1299 sourceMapBuilder.addMapping( |
| 1300 sourceFile, token.charOffset, sourceName, offset); | 1300 sourceFile, token.charOffset, sourceName, offset); |
| 1301 }); | 1301 }); |
| 1302 return sourceMapBuilder.build(compiledFile); | 1302 return sourceMapBuilder.build(compiledFile); |
| 1303 } | 1303 } |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); | 1306 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); |
| OLD | NEW |