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

Side by Side Diff: tests/compiler/dart2js/async_await_js_transform_test.dart

Issue 1018393003: Rename the inner function of async functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "package:compiler/src/js/js.dart"; 6 import "package:compiler/src/js/js.dart";
7 import "package:compiler/src/js/rewrite_async.dart"; 7 import "package:compiler/src/js/rewrite_async.dart";
8 8
9 import "backend_dart/dart_printer_test.dart" show PrintDiagnosticListener; 9 import "backend_dart/dart_printer_test.dart" show PrintDiagnosticListener;
10 10
11 void testTransform(String source, String expected) { 11 void testTransform(String source, String expected) {
12 Fun fun = js(source); 12 Fun fun = js(source);
13 Fun rewritten = new AsyncRewriter( 13 Fun rewritten = new AsyncRewriter(
14 null, // The diagnostic helper should not be used in these tests. 14 null, // The diagnostic helper should not be used in these tests.
15 null, 15 null,
16 asyncHelper: new VariableUse("thenHelper"), 16 asyncHelper: new VariableUse("thenHelper"),
17 newCompleter: new VariableUse("Completer"), 17 newCompleter: new VariableUse("Completer"),
18 safeVariableName: (String name) => "__$name").rewrite(fun); 18 safeVariableName: (String name) => "__$name",
19 bodyName: "body").rewrite(fun);
19 20
20 JavaScriptPrintingOptions options = new JavaScriptPrintingOptions(); 21 JavaScriptPrintingOptions options = new JavaScriptPrintingOptions();
21 SimpleJavaScriptPrintingContext context = 22 SimpleJavaScriptPrintingContext context =
22 new SimpleJavaScriptPrintingContext(); 23 new SimpleJavaScriptPrintingContext();
23 Printer printer = new Printer(options, context); 24 Printer printer = new Printer(options, context);
24 printer.visit(rewritten); 25 printer.visit(rewritten);
25 Expect.stringEquals(expected, context.getText()); 26 Expect.stringEquals(expected, context.getText());
26 } 27 }
27 28
28 main() { 29 main() {
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 // implicit return 1133 // implicit return
1133 return thenHelper(null, 0, __completer, null); 1134 return thenHelper(null, 0, __completer, null);
1134 case 1: 1135 case 1:
1135 // rethrow 1136 // rethrow
1136 return thenHelper(__currentError, 1, __completer); 1137 return thenHelper(__currentError, 1, __completer);
1137 } 1138 }
1138 } 1139 }
1139 return thenHelper(null, __body, __completer, null); 1140 return thenHelper(null, __body, __completer, null);
1140 }"""); 1141 }""");
1141 } 1142 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698