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

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

Issue 972063003: Make sure to bind a method to its receiver if it is stored in a temporary. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review 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/js_ast/lib/src/nodes.dart ('k') | tests/language/async_this_bound_test.dart » ('j') | 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
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 continue; // Continue from finally with pending finally. 75 continue; // Continue from finally with pending finally.
76 return 2; // Return from finally with pending finally. 76 return 2; // Return from finally with pending finally.
77 } 77 }
78 } 78 }
79 } finally { 79 } finally {
80 return 3; // Return from finally with no pending finally. 80 return 3; // Return from finally with no pending finally.
81 } 81 }
82 return 4; 82 return 4;
83 }""", """ 83 }""", """
84 function(b) { 84 function(b) {
85 var __goto = 0, __completer = new Completer(), __returnValue, __handler = 2, _ _currentError, __next, __helper; 85 var __goto = 0, __completer = new Completer(), __returnValue, __handler = 2, _ _currentError, __next = [], __helper;
86 function __body(__errorCode, __result) { 86 function __body(__errorCode, __result) {
87 if (__errorCode === 1) { 87 if (__errorCode === 1) {
88 __currentError = __result; 88 __currentError = __result;
89 __goto = __handler; 89 __goto = __handler;
90 } 90 }
91 while (true) 91 while (true)
92 __outer1: 92 __outer1:
93 switch (__goto) { 93 switch (__goto) {
94 case 0: 94 case 0:
95 // Function start 95 // Function start
(...skipping 15 matching lines...) Expand all
111 __next = [1, 4]; 111 __next = [1, 4];
112 // goto finally 112 // goto finally
113 __goto = 11; 113 __goto = 11;
114 break __outer1; 114 break __outer1;
115 } 115 }
116 __goto = 13; 116 __goto = 13;
117 return thenHelper(foo(), __body, __completer); 117 return thenHelper(foo(), __body, __completer);
118 case 13: 118 case 13:
119 // returning from await. 119 // returning from await.
120 __helper = __result; 120 __helper = __result;
121 __next = [12]; 121 __next.push(12);
122 // goto finally 122 // goto finally
123 __goto = 11; 123 __goto = 11;
124 break; 124 break;
125 case 10: 125 case 10:
126 // uncaught 126 // uncaught
127 __next = [3]; 127 __next = [3];
128 case 11: 128 case 11:
129 // finally 129 // finally
130 __handler = 3; 130 __handler = 3;
131 foo(); 131 foo();
(...skipping 10 matching lines...) Expand all
142 break; 142 break;
143 case 12: 143 case 12:
144 // after finally 144 // after finally
145 // goto while condition 145 // goto while condition
146 __goto = 8; 146 __goto = 8;
147 break; 147 break;
148 case 9: 148 case 9:
149 // after while 149 // after while
150 case 6: 150 case 6:
151 // break __outer 151 // break __outer
152 __next = [5]; 152 __next.push(5);
153 // goto finally 153 // goto finally
154 __goto = 4; 154 __goto = 4;
155 break; 155 break;
156 case 3: 156 case 3:
157 // uncaught 157 // uncaught
158 __next = [2]; 158 __next = [2];
159 case 4: 159 case 4:
160 // finally 160 // finally
161 __handler = 2; 161 __handler = 2;
162 __returnValue = 3; 162 __returnValue = 3;
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 x = c ? await fooError(error) : fooError(error); 701 x = c ? await fooError(error) : fooError(error);
702 } catch (error) { // nested error handler with overlapping name 702 } catch (error) { // nested error handler with overlapping name
703 y.x = foo(error); 703 y.x = foo(error);
704 } finally { 704 } finally {
705 foo(x); 705 foo(x);
706 } 706 }
707 } 707 }
708 } 708 }
709 """, """ 709 """, """
710 function(c, i) { 710 function(c, i) {
711 var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, __next, x, y, __error, __error1; 711 var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, __next = [], x, y, __error, __error1;
712 function __body(__errorCode, __result) { 712 function __body(__errorCode, __result) {
713 if (__errorCode === 1) { 713 if (__errorCode === 1) {
714 __currentError = __result; 714 __currentError = __result;
715 __goto = __handler; 715 __goto = __handler;
716 } 716 }
717 while (true) 717 while (true)
718 switch (__goto) { 718 switch (__goto) {
719 case 0: 719 case 0:
720 // Function start 720 // Function start
721 __handler = 3; 721 __handler = 3;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 // returning from await. 756 // returning from await.
757 // goto join 757 // goto join
758 __goto = 15; 758 __goto = 15;
759 break; 759 break;
760 case 16: 760 case 16:
761 // else 761 // else
762 __result = fooError(__error); 762 __result = fooError(__error);
763 case 15: 763 case 15:
764 // join 764 // join
765 x = __result; 765 x = __result;
766 __next = [13]; 766 __next.push(13);
767 // goto finally 767 // goto finally
768 __goto = 12; 768 __goto = 12;
769 break; 769 break;
770 case 11: 770 case 11:
771 // catch 771 // catch
772 __handler = 10; 772 __handler = 10;
773 __error1 = __currentError; 773 __error1 = __currentError;
774 y.x = foo(__error1); 774 y.x = foo(__error1);
775 __next = [13]; 775 __next.push(13);
776 // goto finally 776 // goto finally
777 __goto = 12; 777 __goto = 12;
778 break; 778 break;
779 case 10: 779 case 10:
780 // uncaught 780 // uncaught
781 __next = [2]; 781 __next = [2];
782 case 12: 782 case 12:
783 // finally 783 // finally
784 __handler = 2; 784 __handler = 2;
785 foo(x); 785 foo(x);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 // return 1009 // return
1010 return thenHelper(__returnValue, 0, __completer, null); 1010 return thenHelper(__returnValue, 0, __completer, null);
1011 case 2: 1011 case 2:
1012 // rethrow 1012 // rethrow
1013 return thenHelper(__currentError, 1, __completer); 1013 return thenHelper(__currentError, 1, __completer);
1014 } 1014 }
1015 } 1015 }
1016 return thenHelper(null, __body, __completer, null); 1016 return thenHelper(null, __body, __completer, null);
1017 }"""); 1017 }""");
1018 } 1018 }
OLDNEW
« no previous file with comments | « pkg/js_ast/lib/src/nodes.dart ('k') | tests/language/async_this_bound_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698