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

Unified Diff: test/codegen/expect/syncstar_syntax.js

Issue 1243503007: fixes #221, initial sync*, async, async* implementation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: 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 | « test/codegen/expect/sunflower/sunflower.js ('k') | test/codegen/expect/syncstar_syntax.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/syncstar_syntax.js
diff --git a/test/codegen/expect/syncstar_syntax.js b/test/codegen/expect/syncstar_syntax.js
index 418b39aa9ca49e057438ca9fccbd2cc694d60da7..239db04ea762f35d86c980d4940ffa118aa6ba66 100644
--- a/test/codegen/expect/syncstar_syntax.js
+++ b/test/codegen/expect/syncstar_syntax.js
@@ -1,23 +1,30 @@
dart_library.library('syncstar_syntax', null, /* Imports */[
"dart_runtime/dart",
- 'dart/core'
+ 'dart/core',
+ 'expect/expect'
], /* Lazy imports */[
-], function(exports, dart, core) {
+], function(exports, dart, core, expect) {
'use strict';
let dartx = dart.dartx;
- function* foo() {
- yield 1;
- yield* dart.list([2, 3], core.int);
+ function foo() {
+ return dart.syncStar(function*() {
+ yield 1;
+ yield* dart.list([2, 3], core.int);
+ }, core.int);
}
dart.fn(foo, core.Iterable$(core.int), []);
class Class extends core.Object {
- *bar() {
- yield 1;
- yield* dart.list([2, 3], core.int);
+ bar() {
+ return dart.syncStar(function*() {
+ yield 1;
+ yield* dart.list([2, 3], core.int);
+ }, core.int);
}
- static *baz() {
- yield 1;
- yield* dart.list([2, 3], core.int);
+ static baz() {
+ return dart.syncStar(function*() {
+ yield 1;
+ yield* dart.list([2, 3], core.int);
+ }, core.int);
}
}
dart.setSignature(Class, {
@@ -26,15 +33,17 @@ dart_library.library('syncstar_syntax', null, /* Imports */[
names: ['baz']
});
function main() {
- function* qux() {
- yield 1;
- yield* dart.list([2, 3], core.int);
+ function qux() {
+ return dart.syncStar(function*() {
+ yield 1;
+ yield* dart.list([2, 3], core.int);
+ }, core.int);
}
dart.fn(qux, core.Iterable$(core.int), []);
- foo()[dartx.forEach](core.print);
- new Class().bar()[dartx.forEach](core.print);
- Class.baz()[dartx.forEach](core.print);
- qux()[dartx.forEach](core.print);
+ expect.Expect.listEquals([1, 2, 3], foo()[dartx.toList]());
+ expect.Expect.listEquals([1, 2, 3], new Class().bar()[dartx.toList]());
+ expect.Expect.listEquals([1, 2, 3], Class.baz()[dartx.toList]());
+ expect.Expect.listEquals([1, 2, 3], qux()[dartx.toList]());
}
dart.fn(main);
// Exports:
« no previous file with comments | « test/codegen/expect/sunflower/sunflower.js ('k') | test/codegen/expect/syncstar_syntax.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698