| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 if (!checkedSetters.isEmpty()) { | 657 if (!checkedSetters.isEmpty()) { |
| 658 buffer.add(',\n'); | 658 buffer.add(',\n'); |
| 659 buffer.add('${Strings.join(checkedSetters, ",\n")}'); | 659 buffer.add('${Strings.join(checkedSetters, ",\n")}'); |
| 660 } | 660 } |
| 661 emitInstanceMembers(classElement, buffer, true); | 661 emitInstanceMembers(classElement, buffer, true); |
| 662 buffer.add('\n};\n\n'); | 662 buffer.add('\n};\n\n'); |
| 663 } | 663 } |
| 664 | 664 |
| 665 void generateTypeTests(ClassElement cls, | 665 void generateTypeTests(ClassElement cls, |
| 666 void generateTypeTest(ClassElement element)) { | 666 void generateTypeTest(ClassElement element)) { |
| 667 if (compiler.codegenWorld.checkedClasses.contains(cls)) { | 667 if (compiler.codegenWorld.isChecks.contains(cls)) { |
| 668 generateTypeTest(cls); | 668 generateTypeTest(cls); |
| 669 } | 669 } |
| 670 generateInterfacesIsTests(cls, generateTypeTest, new Set<Element>()); | 670 generateInterfacesIsTests(cls, generateTypeTest, new Set<Element>()); |
| 671 } | 671 } |
| 672 | 672 |
| 673 void generateInterfacesIsTests(ClassElement cls, | 673 void generateInterfacesIsTests(ClassElement cls, |
| 674 void generateTypeTest(ClassElement element), | 674 void generateTypeTest(ClassElement element), |
| 675 Set<Element> alreadyGenerated) { | 675 Set<Element> alreadyGenerated) { |
| 676 for (DartType interfaceType in cls.interfaces) { | 676 for (DartType interfaceType in cls.interfaces) { |
| 677 Element element = interfaceType.element; | 677 Element element = interfaceType.element; |
| 678 if (!alreadyGenerated.contains(element) && | 678 if (!alreadyGenerated.contains(element) && |
| 679 compiler.codegenWorld.checkedClasses.contains(element)) { | 679 compiler.codegenWorld.isChecks.contains(element)) { |
| 680 alreadyGenerated.add(element); | 680 alreadyGenerated.add(element); |
| 681 generateTypeTest(element); | 681 generateTypeTest(element); |
| 682 } | 682 } |
| 683 generateInterfacesIsTests(element, generateTypeTest, alreadyGenerated); | 683 generateInterfacesIsTests(element, generateTypeTest, alreadyGenerated); |
| 684 } | 684 } |
| 685 } | 685 } |
| 686 | 686 |
| 687 void emitClasses(CodeBuffer buffer) { | 687 void emitClasses(CodeBuffer buffer) { |
| 688 Set<ClassElement> instantiatedClasses = | 688 Set<ClassElement> instantiatedClasses = |
| 689 compiler.codegenWorld.instantiatedClasses; | 689 compiler.codegenWorld.instantiatedClasses; |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 sourceName = token.slowToString(); | 1297 sourceName = token.slowToString(); |
| 1298 } | 1298 } |
| 1299 int totalOffset = bufferOffset + offset; | 1299 int totalOffset = bufferOffset + offset; |
| 1300 sourceMapBuilder.addMapping( | 1300 sourceMapBuilder.addMapping( |
| 1301 sourceFile, token.charOffset, sourceName, totalOffset); | 1301 sourceFile, token.charOffset, sourceName, totalOffset); |
| 1302 }); | 1302 }); |
| 1303 } | 1303 } |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); | 1306 typedef void DefineMemberFunction(String invocationName, CodeBuffer definition); |
| OLD | NEW |