Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1340)

Unified Diff: pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.expect

Issue 2939533002: Apply transformations after comparing to golden files. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.expect
diff --git a/pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.expect b/pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.expect
index 7f01bfa60d6c705db30b1cb7a0f778db55be60e1..110cf0f7699b0e9189b28380233babdaa80bf232 100644
--- a/pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.expect
@@ -8,120 +8,19 @@ static method main() → dynamic {
function a() → (core::int) → core::int {
return (dynamic x) → dynamic => x;
}
- function b() → asy::Future<(core::int) → core::int> /* originally async */ {
- final asy::Completer<asy::FutureOr<(core::int) → core::int>> :completer = asy::Completer::sync<asy::FutureOr<(core::int) → core::int>>();
- asy::FutureOr<(core::int) → core::int> :return_value;
- dynamic :async_op_then;
- dynamic :async_op_error;
- dynamic :await_jump_var = 0;
- dynamic :await_ctx_var;
- function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
- try {
- #L1:
- {
- :return_value = (dynamic x) → dynamic => x;
- break #L1;
- }
- :completer.complete(:return_value);
- return;
- }
- on dynamic catch(dynamic :exception, dynamic :stack_trace) {
- :completer.completeError(:exception, :stack_trace);
- }
- :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
- :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
- asy::Future::microtask<dynamic>(:async_op);
- return :completer.future;
+ function b() → asy::Future<(core::int) → core::int> async {
+ return (dynamic x) → dynamic => x;
}
- function c() → core::Iterable<(core::int) → core::int> /* originally sync* */ {
- dynamic :await_jump_var = 0;
- dynamic :await_ctx_var;
- function :sync_op(core::Iterator<dynamic> :iterator) → core::bool yielding {
- {
- {
- :iterator._current = (dynamic x) → dynamic => x;
- [yield] true;
- }
- }
- return false;
- }
- return new core::_SyncIterable::•(:sync_op);
+ function c() → core::Iterable<(core::int) → core::int> sync* {
+ yield(dynamic x) → dynamic => x;
}
- function d() → core::Iterable<(core::int) → core::int> /* originally sync* */ {
- dynamic :await_jump_var = 0;
- dynamic :await_ctx_var;
- function :sync_op(core::Iterator<dynamic> :iterator) → core::bool yielding {
- {
- {
- :iterator.isYieldEach = true;
- :iterator._current = <dynamic>[(dynamic x) → dynamic => x];
- [yield] true;
- }
- }
- return false;
- }
- return new core::_SyncIterable::•(:sync_op);
+ function d() → core::Iterable<(core::int) → core::int> sync* {
+ yield*<dynamic>[(dynamic x) → dynamic => x];
}
- function e() → asy::Stream<(core::int) → core::int> /* originally async* */ {
- dynamic :controller;
- dynamic :async_op_then;
- dynamic :async_op_error;
- dynamic :await_jump_var = 0;
- dynamic :await_ctx_var;
- dynamic :saved_try_context_var0;
- dynamic :saved_try_context_var1;
- function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
- try
- try {
- #L2:
- {
- if(:controller.add((dynamic x) → dynamic => x))
- return null;
- else
- [yield] null;
- }
- return;
- }
- on dynamic catch(dynamic :exception, dynamic :stack_trace) {
- :controller.addError(:exception, :stack_trace);
- }
- finally {
- :controller.close();
- }
- :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
- :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
- :controller = new asy::_AsyncStarStreamController::•(:async_op);
- return :controller.stream;
+ function e() → asy::Stream<(core::int) → core::int> async* {
+ yield(dynamic x) → dynamic => x;
}
- function f() → asy::Stream<(core::int) → core::int> /* originally async* */ {
- dynamic :controller;
- dynamic :async_op_then;
- dynamic :async_op_error;
- dynamic :await_jump_var = 0;
- dynamic :await_ctx_var;
- dynamic :saved_try_context_var0;
- dynamic :saved_try_context_var1;
- function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
- try
- try {
- #L3:
- {
- if(:controller.addStream(asy::Stream::fromIterable<dynamic>(<dynamic>[(dynamic x) → dynamic => x])))
- return null;
- else
- [yield] null;
- }
- return;
- }
- on dynamic catch(dynamic :exception, dynamic :stack_trace) {
- :controller.addError(:exception, :stack_trace);
- }
- finally {
- :controller.close();
- }
- :async_op_then = asy::_asyncThenWrapperHelper(:async_op);
- :async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
- :controller = new asy::_AsyncStarStreamController::•(:async_op);
- return :controller.stream;
+ function f() → asy::Stream<(core::int) → core::int> async* {
+ yield* asy::Stream::fromIterable<dynamic>(<dynamic>[(dynamic x) → dynamic => x]);
}
}

Powered by Google App Engine
This is Rietveld 408576698