| 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 part of js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
| 9 * from the given element. | 9 * from the given element. |
| 10 */ | 10 */ |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 * Invariant: [member] must be a declaration element. | 579 * Invariant: [member] must be a declaration element. |
| 580 */ | 580 */ |
| 581 void addInstanceMember(Element member, | 581 void addInstanceMember(Element member, |
| 582 DefineMemberFunction defineInstanceMember) { | 582 DefineMemberFunction defineInstanceMember) { |
| 583 assert(invariant(member, member.isDeclaration)); | 583 assert(invariant(member, member.isDeclaration)); |
| 584 // TODO(floitsch): we don't need to deal with members of | 584 // TODO(floitsch): we don't need to deal with members of |
| 585 // uninstantiated classes, that have been overwritten by subclasses. | 585 // uninstantiated classes, that have been overwritten by subclasses. |
| 586 | 586 |
| 587 if (member.isFunction() | 587 if (member.isFunction() |
| 588 || member.isGenerativeConstructorBody() | 588 || member.isGenerativeConstructorBody() |
| 589 || member.isGetter() | 589 || member.isAccessor()) { |
| 590 || member.isSetter()) { | 590 if (member.isAbstract(compiler)) return; |
| 591 if (member.modifiers.isAbstract()) return; | |
| 592 CodeBuffer codeBuffer = compiler.codegenWorld.generatedCode[member]; | 591 CodeBuffer codeBuffer = compiler.codegenWorld.generatedCode[member]; |
| 593 if (codeBuffer == null) return; | 592 if (codeBuffer == null) return; |
| 594 defineInstanceMember(namer.getName(member), codeBuffer); | 593 defineInstanceMember(namer.getName(member), codeBuffer); |
| 595 codeBuffer = compiler.codegenWorld.generatedBailoutCode[member]; | 594 codeBuffer = compiler.codegenWorld.generatedBailoutCode[member]; |
| 596 if (codeBuffer != null) { | 595 if (codeBuffer != null) { |
| 597 defineInstanceMember(namer.getBailoutName(member), codeBuffer); | 596 defineInstanceMember(namer.getBailoutName(member), codeBuffer); |
| 598 } | 597 } |
| 599 FunctionElement function = member; | 598 FunctionElement function = member; |
| 600 FunctionSignature parameters = function.computeSignature(compiler); | 599 FunctionSignature parameters = function.computeSignature(compiler); |
| 601 if (!parameters.optionalParameters.isEmpty) { | 600 if (!parameters.optionalParameters.isEmpty) { |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 const String HOOKS_API_USAGE = """ | 1565 const String HOOKS_API_USAGE = """ |
| 1567 // Generated by dart2js, the Dart to JavaScript compiler. | 1566 // Generated by dart2js, the Dart to JavaScript compiler. |
| 1568 // The code supports the following hooks: | 1567 // The code supports the following hooks: |
| 1569 // dartPrint(message) - if this function is defined it is called | 1568 // dartPrint(message) - if this function is defined it is called |
| 1570 // instead of the Dart [print] method. | 1569 // instead of the Dart [print] method. |
| 1571 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1570 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 1572 // method will not be invoked directly. | 1571 // method will not be invoked directly. |
| 1573 // Instead, a closure that will invoke [main] is | 1572 // Instead, a closure that will invoke [main] is |
| 1574 // passed to [dartMainRunner]. | 1573 // passed to [dartMainRunner]. |
| 1575 """; | 1574 """; |
| OLD | NEW |