| 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 the mask is empty it doesn't contain a noSuchMethod | 
 |  2047           // handler -- not even if it is nullable. | 
 |  2048           if (mask.isEmpty) continue; | 
|  2046           receiverClass = mask.base.element; |  2049           receiverClass = mask.base.element; | 
|  2047         } |  2050         } | 
|  2048  |  2051  | 
|  2049         // If the receiver class is guaranteed to have a member that |  2052         // If the receiver class is guaranteed to have a member that | 
|  2050         // matches what we're looking for, there's no need to |  2053         // matches what we're looking for, there's no need to | 
|  2051         // introduce a noSuchMethod handler. It will never be called. |  2054         // introduce a noSuchMethod handler. It will never be called. | 
|  2052         // |  2055         // | 
|  2053         // As an example, consider this class hierarchy: |  2056         // As an example, consider this class hierarchy: | 
|  2054         // |  2057         // | 
|  2055         //                   A    <-- noSuchMethod |  2058         //                   A    <-- noSuchMethod | 
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2759 """; |  2762 """; | 
|  2760 const String HOOKS_API_USAGE = """ |  2763 const String HOOKS_API_USAGE = """ | 
|  2761 // The code supports the following hooks: |  2764 // The code supports the following hooks: | 
|  2762 // dartPrint(message)   - if this function is defined it is called |  2765 // dartPrint(message)   - if this function is defined it is called | 
|  2763 //                        instead of the Dart [print] method. |  2766 //                        instead of the Dart [print] method. | 
|  2764 // dartMainRunner(main) - if this function is defined, the Dart [main] |  2767 // dartMainRunner(main) - if this function is defined, the Dart [main] | 
|  2765 //                        method will not be invoked directly. |  2768 //                        method will not be invoked directly. | 
|  2766 //                        Instead, a closure that will invoke [main] is |  2769 //                        Instead, a closure that will invoke [main] is | 
|  2767 //                        passed to [dartMainRunner]. |  2770 //                        passed to [dartMainRunner]. | 
|  2768 """; |  2771 """; | 
| OLD | NEW |