| OLD | NEW |
| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 96 __handler = 3; | 96 __handler = 3; |
| 97 case 7: | 97 case 7: |
| 98 // continue __outer | |
| 99 case 8: | |
| 100 // while condition | 98 // while condition |
| 101 __handler = 10; | 99 __handler = 9; |
| 102 inner: | 100 inner: |
| 103 while (true) { | 101 while (true) { |
| 104 __next = [6]; | 102 __next = [6]; |
| 105 // goto finally | 103 // goto finally |
| 106 __goto = 11; | 104 __goto = 10; |
| 107 break __outer1; | 105 break __outer1; |
| 108 break; | 106 break; |
| 109 } | 107 } |
| 110 while (true) { | 108 while (true) { |
| 111 __next = [1, 4]; | 109 __next = [1, 4]; |
| 112 // goto finally | 110 // goto finally |
| 113 __goto = 11; | 111 __goto = 10; |
| 114 break __outer1; | 112 break __outer1; |
| 115 } | 113 } |
| 116 __goto = 13; | 114 __goto = 12; |
| 117 return thenHelper(foo(), __body, __completer); | 115 return thenHelper(foo(), __body, __completer); |
| 118 case 13: | 116 case 12: |
| 119 // returning from await. | 117 // returning from await. |
| 120 __helper = __result; | 118 __helper = __result; |
| 121 __next.push(12); | 119 __next.push(11); |
| 122 // goto finally | 120 // goto finally |
| 123 __goto = 11; | 121 __goto = 10; |
| 124 break; | 122 break; |
| 125 case 10: | 123 case 9: |
| 126 // uncaught | 124 // uncaught |
| 127 __next = [3]; | 125 __next = [3]; |
| 128 case 11: | 126 case 10: |
| 129 // finally | 127 // finally |
| 130 __handler = 3; | 128 __handler = 3; |
| 131 foo(); | 129 foo(); |
| 132 // goto while condition | 130 // goto while condition |
| 133 __goto = 8; | 131 __goto = 7; |
| 134 break; | 132 break; |
| 135 __returnValue = 2; | 133 __returnValue = 2; |
| 136 __next = [1]; | 134 __next = [1]; |
| 137 // goto finally | 135 // goto finally |
| 138 __goto = 4; | 136 __goto = 4; |
| 139 break; | 137 break; |
| 140 // goto the next finally handler | 138 // goto the next finally handler |
| 141 __goto = __next.pop(); | 139 __goto = __next.pop(); |
| 142 break; | 140 break; |
| 143 case 12: | 141 case 11: |
| 144 // after finally | 142 // after finally |
| 145 // goto while condition | 143 // goto while condition |
| 146 __goto = 8; | 144 __goto = 7; |
| 147 break; | 145 break; |
| 148 case 9: | 146 case 8: |
| 149 // after while | 147 // after while |
| 150 case 6: | 148 case 6: |
| 151 // break __outer | 149 // break __outer |
| 152 __next.push(5); | 150 __next.push(5); |
| 153 // goto finally | 151 // goto finally |
| 154 __goto = 4; | 152 __goto = 4; |
| 155 break; | 153 break; |
| 156 case 3: | 154 case 3: |
| 157 // uncaught | 155 // uncaught |
| 158 __next = [2]; | 156 __next = [2]; |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 __goto = 5; | 914 __goto = 5; |
| 917 return thenHelper(foo(), __body, __completer); | 915 return thenHelper(foo(), __body, __completer); |
| 918 case 5: | 916 case 5: |
| 919 // returning from await. | 917 // returning from await. |
| 920 if (!__result) { | 918 if (!__result) { |
| 921 // goto after while | 919 // goto after while |
| 922 __goto = 4; | 920 __goto = 4; |
| 923 break; | 921 break; |
| 924 } | 922 } |
| 925 case 7: | 923 case 7: |
| 926 // continue lab | |
| 927 case 8: | |
| 928 // switch | 924 // switch |
| 929 __temp1 = y; | 925 __temp1 = y; |
| 930 if (__temp1 === 0) { | 926 if (__temp1 === 0) { |
| 931 // goto case | 927 // goto case |
| 928 __goto = 9; |
| 929 break; |
| 930 } |
| 931 if (__temp1 === 0) { |
| 932 // goto case |
| 932 __goto = 10; | 933 __goto = 10; |
| 933 break; | 934 break; |
| 934 } | 935 } |
| 935 if (__temp1 === 0) { | 936 __goto = 12; |
| 937 return thenHelper(bar(), __body, __completer); |
| 938 case 12: |
| 939 // returning from await. |
| 940 if (__temp1 === __result) { |
| 936 // goto case | 941 // goto case |
| 937 __goto = 11; | 942 __goto = 11; |
| 938 break; | 943 break; |
| 939 } | 944 } |
| 940 __goto = 13; | |
| 941 return thenHelper(bar(), __body, __completer); | |
| 942 case 13: | |
| 943 // returning from await. | |
| 944 if (__temp1 === __result) { | |
| 945 // goto case | |
| 946 __goto = 12; | |
| 947 break; | |
| 948 } | |
| 949 if (__temp1 === x) { | 945 if (__temp1 === x) { |
| 950 // goto case | 946 // goto case |
| 951 __goto = 14; | 947 __goto = 13; |
| 952 break; | 948 break; |
| 953 } | 949 } |
| 954 // goto default | 950 // goto default |
| 955 __goto = 15; | 951 __goto = 14; |
| 956 break; | 952 break; |
| 953 case 9: |
| 954 // case |
| 955 foo(); |
| 957 case 10: | 956 case 10: |
| 958 // case | 957 // case |
| 959 foo(); | 958 __temp1 = print; |
| 959 __goto = 15; |
| 960 return thenHelper(foo1(x), __body, __completer); |
| 961 case 15: |
| 962 // returning from await. |
| 963 __temp1(__result); |
| 964 __returnValue = y; |
| 965 // goto return |
| 966 __goto = 1; |
| 967 break; |
| 960 case 11: | 968 case 11: |
| 961 // case | 969 // case |
| 962 __temp1 = print; | 970 __temp1 = print; |
| 963 __goto = 16; | 971 __goto = 16; |
| 964 return thenHelper(foo1(x), __body, __completer); | 972 return thenHelper(foobar(x), __body, __completer); |
| 965 case 16: | 973 case 16: |
| 966 // returning from await. | 974 // returning from await. |
| 967 __temp1(__result); | 975 __temp1(__result); |
| 968 __returnValue = y; | 976 __returnValue = y; |
| 969 // goto return | 977 // goto return |
| 970 __goto = 1; | 978 __goto = 1; |
| 971 break; | 979 break; |
| 972 case 12: | 980 case 13: |
| 973 // case | |
| 974 __temp1 = print; | |
| 975 __goto = 17; | |
| 976 return thenHelper(foobar(x), __body, __completer); | |
| 977 case 17: | |
| 978 // returning from await. | |
| 979 __temp1(__result); | |
| 980 __returnValue = y; | |
| 981 // goto return | |
| 982 __goto = 1; | |
| 983 break; | |
| 984 case 14: | |
| 985 // case | 981 // case |
| 986 if (a) | 982 if (a) |
| 987 throw new Error(); | 983 throw new Error(); |
| 988 else { | 984 else { |
| 989 // goto while condition | 985 // goto while condition |
| 990 __goto = 3; | 986 __goto = 3; |
| 991 break; | 987 break; |
| 992 } | 988 } |
| 993 case 15: | 989 case 14: |
| 994 // default | 990 // default |
| 995 // goto break lab | 991 // goto break lab |
| 996 __goto = 6; | 992 __goto = 6; |
| 997 break; | 993 break; |
| 998 case 9: | 994 case 8: |
| 999 // after switch | 995 // after switch |
| 1000 foo(); | 996 foo(); |
| 1001 case 6: | 997 case 6: |
| 1002 // break lab | 998 // break lab |
| 1003 // goto while condition | 999 // goto while condition |
| 1004 __goto = 3; | 1000 __goto = 3; |
| 1005 break; | 1001 break; |
| 1006 case 4: | 1002 case 4: |
| 1007 // after while | 1003 // after while |
| 1008 case 1: | 1004 case 1: |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 // implicit return | 1053 // implicit return |
| 1058 return thenHelper(null, 0, __completer, null); | 1054 return thenHelper(null, 0, __completer, null); |
| 1059 case 1: | 1055 case 1: |
| 1060 // rethrow | 1056 // rethrow |
| 1061 return thenHelper(__currentError, 1, __completer); | 1057 return thenHelper(__currentError, 1, __completer); |
| 1062 } | 1058 } |
| 1063 } | 1059 } |
| 1064 return thenHelper(null, __body, __completer, null); | 1060 return thenHelper(null, __body, __completer, null); |
| 1065 }"""); | 1061 }"""); |
| 1066 } | 1062 } |
| OLD | NEW |