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

Unified Diff: tests/language/syncstar_less_than_test.dart

Issue 1235793006: Allow `return <expr>` in sync* and async* javascript. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address review. Added test. Created 5 years, 5 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
« no previous file with comments | « tests/compiler/dart2js/async_await_js_transform_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/syncstar_less_than_test.dart
diff --git a/tests/language/syncstar_less_than_test.dart b/tests/language/syncstar_less_than_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b0551a8750816f430f3ff26a963350b47f9b6b7a
--- /dev/null
+++ b/tests/language/syncstar_less_than_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2015, the Dart Team. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+
+import "package:expect/expect.dart";
+
+confuse(x) => [1, 'x', true, null, x].last;
floitsch 2015/07/15 14:55:00 The expect package has annotations to assume 'dyna
+
+Iterable<int> foo() sync* {
+ var a = confuse(1);
+ if (a < 10) {
+ yield 2;
+ }
+}
+
+main() {
+ Expect.listEquals(foo().toList(), [2]);
+}
« no previous file with comments | « tests/compiler/dart2js/async_await_js_transform_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698