Chromium Code Reviews| 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 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2036 | 2036 |
| 2037 // If the selector is typed, we check to see if that type may | 2037 // If the selector is typed, we check to see if that type may |
| 2038 // have a user-defined noSuchMethod implementation. If not, we | 2038 // have a user-defined noSuchMethod implementation. If not, we |
| 2039 // skip the selector altogether. | 2039 // skip the selector altogether. |
| 2040 | 2040 |
| 2041 // TODO(kasperl): This shouldn't depend on the internals of | 2041 // TODO(kasperl): This shouldn't depend on the internals of |
| 2042 // the type mask. Move more of this code to the type mask. | 2042 // the type mask. Move more of this code to the type mask. |
| 2043 ClassElement receiverClass = objectClass; | 2043 ClassElement receiverClass = objectClass; |
| 2044 TypeMask mask = selector.mask; | 2044 TypeMask mask = selector.mask; |
| 2045 if (mask != null) { | 2045 if (mask != null) { |
| 2046 if (mask.isEmpty) continue; | |
|
ngeoffray
2013/03/11 14:52:28
Please add a comment that if the mask is JSNull, w
kasperl
2013/03/12 05:56:56
Done.
| |
| 2046 receiverClass = mask.base.element; | 2047 receiverClass = mask.base.element; |
| 2047 } | 2048 } |
| 2048 | 2049 |
| 2049 // If the receiver class is guaranteed to have a member that | 2050 // If the receiver class is guaranteed to have a member that |
| 2050 // matches what we're looking for, there's no need to | 2051 // matches what we're looking for, there's no need to |
| 2051 // introduce a noSuchMethod handler. It will never be called. | 2052 // introduce a noSuchMethod handler. It will never be called. |
| 2052 // | 2053 // |
| 2053 // As an example, consider this class hierarchy: | 2054 // As an example, consider this class hierarchy: |
| 2054 // | 2055 // |
| 2055 // A <-- noSuchMethod | 2056 // A <-- noSuchMethod |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2758 """; | 2759 """; |
| 2759 const String HOOKS_API_USAGE = """ | 2760 const String HOOKS_API_USAGE = """ |
| 2760 // The code supports the following hooks: | 2761 // The code supports the following hooks: |
| 2761 // dartPrint(message) - if this function is defined it is called | 2762 // dartPrint(message) - if this function is defined it is called |
| 2762 // instead of the Dart [print] method. | 2763 // instead of the Dart [print] method. |
| 2763 // dartMainRunner(main) - if this function is defined, the Dart [main] | 2764 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 2764 // method will not be invoked directly. | 2765 // method will not be invoked directly. |
| 2765 // Instead, a closure that will invoke [main] is | 2766 // Instead, a closure that will invoke [main] is |
| 2766 // passed to [dartMainRunner]. | 2767 // passed to [dartMainRunner]. |
| 2767 """; | 2768 """; |
| OLD | NEW |