OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library _js_helper; | 5 library _js_helper; |
6 | 6 |
7 import 'dart:_js_embedded_names' show | 7 import 'dart:_js_embedded_names' show |
8 GET_TYPE_FROM_NAME, | 8 GET_TYPE_FROM_NAME, |
9 GET_ISOLATE_TAG, | 9 GET_ISOLATE_TAG, |
10 INTERCEPTED_NAMES, | 10 INTERCEPTED_NAMES, |
(...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1939 /** | 1939 /** |
1940 * Global counter to prevent reusing function code objects. | 1940 * Global counter to prevent reusing function code objects. |
1941 * | 1941 * |
1942 * V8 will share the underlying function code objects when the same string is | 1942 * V8 will share the underlying function code objects when the same string is |
1943 * passed to "new Function". Shared function code objects can lead to | 1943 * passed to "new Function". Shared function code objects can lead to |
1944 * sub-optimal performance due to polymorhism, and can be prevented by | 1944 * sub-optimal performance due to polymorhism, and can be prevented by |
1945 * ensuring the strings are different. | 1945 * ensuring the strings are different. |
1946 */ | 1946 */ |
1947 static int functionCounter = 0; | 1947 static int functionCounter = 0; |
1948 | 1948 |
| 1949 Closure get call => this; |
| 1950 |
1949 Closure(); | 1951 Closure(); |
1950 | 1952 |
1951 /** | 1953 /** |
1952 * Creates a new closure class for use by implicit getters associated with a | 1954 * Creates a new closure class for use by implicit getters associated with a |
1953 * method. | 1955 * method. |
1954 * | 1956 * |
1955 * In other words, creates a tear-off closure. | 1957 * In other words, creates a tear-off closure. |
1956 * | 1958 * |
1957 * Called from [closureFromTearOff] as well as from reflection when tearing | 1959 * Called from [closureFromTearOff] as well as from reflection when tearing |
1958 * of a method via [:getField:]. | 1960 * of a method via [:getField:]. |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3720 // This is a function that will return a helper function that does the | 3722 // This is a function that will return a helper function that does the |
3721 // iteration of the sync*. | 3723 // iteration of the sync*. |
3722 // | 3724 // |
3723 // Each invocation should give a helper with fresh state. | 3725 // Each invocation should give a helper with fresh state. |
3724 final dynamic /* js function */ _outerHelper; | 3726 final dynamic /* js function */ _outerHelper; |
3725 | 3727 |
3726 SyncStarIterable(this._outerHelper); | 3728 SyncStarIterable(this._outerHelper); |
3727 | 3729 |
3728 Iterator get iterator => new SyncStarIterator(JS('', '#()', _outerHelper)); | 3730 Iterator get iterator => new SyncStarIterator(JS('', '#()', _outerHelper)); |
3729 } | 3731 } |
OLD | NEW |