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

Unified Diff: pkg/front_end/testcases/inference/top_level_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/top_level_return_and_yield.dart.direct.expect
diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.direct.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.direct.expect
index 1a86291a96214f186a4ee643a6dccc1a10908e0b..7a615f9bf58c1d70ef04e1da357c9e50d30f42df 100644
--- a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.direct.expect
@@ -7,120 +7,19 @@ typedef IntToInt = (core::int) → core::int;
static method a() → (core::int) → core::int {
return (dynamic x) → dynamic => x;
}
-static method 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;
+static method b() → asy::Future<(core::int) → core::int> async {
+ return (dynamic x) → dynamic => x;
}
-static method 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);
+static method c() → core::Iterable<(core::int) → core::int> sync* {
+ yield(dynamic x) → dynamic => x;
}
-static method 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);
+static method d() → core::Iterable<(core::int) → core::int> sync* {
+ yield*<dynamic>[(dynamic x) → dynamic => x];
}
-static method 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;
+static method e() → asy::Stream<(core::int) → core::int> async* {
+ yield(dynamic x) → dynamic => x;
}
-static method 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;
+static method f() → asy::Stream<(core::int) → core::int> async* {
+ yield* asy::Stream::fromIterable<dynamic>(<dynamic>[(dynamic x) → dynamic => x]);
}
static method main() → dynamic {}

Powered by Google App Engine
This is Rietveld 408576698