4c0de8ed89
Change the calling convention of the sync* body to fix bugs and avoid allocations. - Body takes the controlling _SyncStarIterator as a parameter. - `yield` assigns directly to the `_current` field and returns. - `yield*` calls a method on the controlling iterator (rather than returning the iterable). This avoids an allocation to wrap the iterable, a type test to distinguish `yield` from `yield*`, and allows the `get:iterator` call to happen in the dynamic scope of try-catch surrounding the `yield*` to that it will catch any exceptions. - Avoid using IIFE to bind constants just to call the body. - Use a dummy body to avoid the need to testing termination of the body. Tests now passing: co19_2/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_sync_t05 language_2/sync_star/move_past_end_test language_2/sync_star/sync_star_exception_current_test language_2/sync_star/sync_star_exception_iterator_test language_2/sync_star/sync_star_exception_nested_test language_2/sync_star/sync_star_exception_test Bug: #51992 Change-Id: I397b470e121b8d71242ac28b3130637b78a1d0dc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294685 Reviewed-by: Mayank Patke <fishythefish@google.com> Commit-Queue: Stephen Adams <sra@google.com>
20 lines
645 B
JSON
20 lines
645 B
JSON
{
|
|
"org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_helper.dart": {
|
|
"Dynamic access of 'length'.": 2
|
|
},
|
|
"org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_patch.dart": {
|
|
"Dynamic invocation of '[]'.": 1
|
|
},
|
|
"org-dartlang-sdk:///lib/convert/json.dart": {
|
|
"Dynamic invocation of 'toJson'.": 1
|
|
},
|
|
"org-dartlang-sdk:///lib/core/errors.dart": {
|
|
"Dynamic access of 'length'.": 2
|
|
},
|
|
"org-dartlang-sdk:///lib/html/dart2js/html_dart2js.dart": {
|
|
"Dynamic access of 'attributes'.": 1,
|
|
"Dynamic invocation of '[]'.": 1,
|
|
"Dynamic invocation of 'call'.": 2,
|
|
"Dynamic invocation of 'toLowerCase'.": 1
|
|
}
|
|
} |