| 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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 classElement.forEachMember(includeBackendMembers: true, | 665 classElement.forEachMember(includeBackendMembers: true, |
| 666 f: (ClassElement enclosing, Element member) { | 666 f: (ClassElement enclosing, Element member) { |
| 667 assert(invariant(classElement, member.isDeclaration)); | 667 assert(invariant(classElement, member.isDeclaration)); |
| 668 if (member.isInstanceMember()) { | 668 if (member.isInstanceMember()) { |
| 669 addInstanceMember(member, defineInstanceMember); | 669 addInstanceMember(member, defineInstanceMember); |
| 670 } | 670 } |
| 671 }); | 671 }); |
| 672 | 672 |
| 673 generateIsTestsOn(classElement, (Element other) { | 673 generateIsTestsOn(classElement, (Element other) { |
| 674 String code; | 674 String code; |
| 675 if (other.isObject(compiler)) return; |
| 675 if (nativeEmitter.requiresNativeIsCheck(other)) { | 676 if (nativeEmitter.requiresNativeIsCheck(other)) { |
| 676 code = 'function() { return true; }'; | 677 code = 'function() { return true; }'; |
| 677 } else { | 678 } else { |
| 678 code = 'true'; | 679 code = 'true'; |
| 679 } | 680 } |
| 680 CodeBuffer typeTestBuffer = new CodeBuffer(); | 681 CodeBuffer typeTestBuffer = new CodeBuffer(); |
| 681 typeTestBuffer.add(code); | 682 typeTestBuffer.add(code); |
| 682 defineInstanceMember(namer.operatorIs(other), typeTestBuffer); | 683 defineInstanceMember(namer.operatorIs(other), typeTestBuffer); |
| 683 }); | 684 }); |
| 684 | 685 |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 const String HOOKS_API_USAGE = """ | 1435 const String HOOKS_API_USAGE = """ |
| 1435 // Generated by dart2js, the Dart to JavaScript compiler. | 1436 // Generated by dart2js, the Dart to JavaScript compiler. |
| 1436 // The code supports the following hooks: | 1437 // The code supports the following hooks: |
| 1437 // dartPrint(message) - if this function is defined it is called | 1438 // dartPrint(message) - if this function is defined it is called |
| 1438 // instead of the Dart [print] method. | 1439 // instead of the Dart [print] method. |
| 1439 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1440 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 1440 // method will not be invoked directly. | 1441 // method will not be invoked directly. |
| 1441 // Instead, a closure that will invoke [main] is | 1442 // Instead, a closure that will invoke [main] is |
| 1442 // passed to [dartMainRunner]. | 1443 // passed to [dartMainRunner]. |
| 1443 """; | 1444 """; |
| OLD | NEW |