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

Side by Side Diff: test/codegen/expect/language/stacktrace_rethrow_error_test_withtraceparameter_multi.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 dart_library.library('language/stacktrace_rethrow_error_test_withtraceparameter_ multi', null, /* Imports */[
2 'dart_sdk'
3 ], function load__stacktrace_rethrow_error_test_withtraceparameter_multi(exports , dart_sdk) {
4 'use strict';
5 const core = dart_sdk.core;
6 const _interceptors = dart_sdk._interceptors;
7 const dart = dart_sdk.dart;
8 const dartx = dart_sdk.dartx;
9 const stacktrace_rethrow_error_test_withtraceparameter_multi = Object.create(n ull);
10 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr ray$(core.String)))();
11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
12 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons tFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))();
13 stacktrace_rethrow_error_test_withtraceparameter_multi.SubclassOfError = class SubclassOfError extends core.Error {
14 new() {
15 super.new();
16 }
17 };
18 stacktrace_rethrow_error_test_withtraceparameter_multi.fail = function() {
19 return dart.throw("Fail");
20 };
21 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.fail, VoidTodyn amic());
22 stacktrace_rethrow_error_test_withtraceparameter_multi.aa1 = function() {
23 try {
24 stacktrace_rethrow_error_test_withtraceparameter_multi.bb1();
25 stacktrace_rethrow_error_test_withtraceparameter_multi.fail();
26 } catch (error) {
27 let stacktrace = dart.stackTrace(error);
28 stacktrace_rethrow_error_test_withtraceparameter_multi.expectTrace(JSArray OfString().of(['gg1', 'ff1', 'ee1', 'dd1', 'cc1', 'bb1', 'aa1']), dart.dload(err or, 'stackTrace'));
29 stacktrace_rethrow_error_test_withtraceparameter_multi.expectTrace(JSArray OfString().of(['gg1', 'ff1', 'ee1', 'dd1', 'cc1', 'bb1', 'aa1']), stacktrace);
30 }
31
32 };
33 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.aa1, VoidTodyna mic());
34 stacktrace_rethrow_error_test_withtraceparameter_multi.bb1 = function() {
35 return stacktrace_rethrow_error_test_withtraceparameter_multi.cc1();
36 };
37 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.bb1, VoidTodyna mic());
38 stacktrace_rethrow_error_test_withtraceparameter_multi.cc1 = function() {
39 try {
40 stacktrace_rethrow_error_test_withtraceparameter_multi.dd1();
41 } catch (e$) {
42 if (core.String.is(e$)) {
43 let e = e$;
44 stacktrace_rethrow_error_test_withtraceparameter_multi.fail();
45 } else if (core.int.is(e$)) {
46 let e = e$;
47 stacktrace_rethrow_error_test_withtraceparameter_multi.fail();
48 } else
49 throw e$;
50 }
51
52 };
53 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.cc1, VoidTodyna mic());
54 stacktrace_rethrow_error_test_withtraceparameter_multi.dd1 = function() {
55 return stacktrace_rethrow_error_test_withtraceparameter_multi.ee1();
56 };
57 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.dd1, VoidTodyna mic());
58 stacktrace_rethrow_error_test_withtraceparameter_multi.ee1 = function() {
59 try {
60 stacktrace_rethrow_error_test_withtraceparameter_multi.ff1();
61 } catch (e) {
62 throw e;
63 }
64
65 };
66 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.ee1, VoidTodyna mic());
67 stacktrace_rethrow_error_test_withtraceparameter_multi.ff1 = function() {
68 return stacktrace_rethrow_error_test_withtraceparameter_multi.gg1();
69 };
70 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.ff1, VoidTodyna mic());
71 stacktrace_rethrow_error_test_withtraceparameter_multi.gg1 = function() {
72 return dart.throw(new stacktrace_rethrow_error_test_withtraceparameter_multi .SubclassOfError());
73 };
74 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.gg1, VoidTodyna mic());
75 stacktrace_rethrow_error_test_withtraceparameter_multi.aa2 = function() {
76 try {
77 stacktrace_rethrow_error_test_withtraceparameter_multi.bb2();
78 stacktrace_rethrow_error_test_withtraceparameter_multi.fail();
79 } catch (error) {
80 let stacktrace = dart.stackTrace(error);
81 stacktrace_rethrow_error_test_withtraceparameter_multi.expectTrace(JSArray OfString().of(['gg2', 'ff2', 'ee2', 'dd2', 'cc2', 'bb2', 'aa2']), dart.dload(err or, 'stackTrace'));
82 stacktrace_rethrow_error_test_withtraceparameter_multi.expectTrace(JSArray OfString().of(['gg2', 'ff2', 'ee2', 'dd2', 'cc2', 'bb2', 'aa2']), stacktrace);
83 }
84
85 };
86 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.aa2, VoidTodyna mic());
87 stacktrace_rethrow_error_test_withtraceparameter_multi.bb2 = function() {
88 return stacktrace_rethrow_error_test_withtraceparameter_multi.cc2();
89 };
90 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.bb2, VoidTodyna mic());
91 stacktrace_rethrow_error_test_withtraceparameter_multi.cc2 = function() {
92 try {
93 stacktrace_rethrow_error_test_withtraceparameter_multi.dd2();
94 } catch (e$) {
95 if (stacktrace_rethrow_error_test_withtraceparameter_multi.SubclassOfError .is(e$)) {
96 let e = e$;
97 throw e;
98 } else if (core.int.is(e$)) {
99 let e = e$;
100 stacktrace_rethrow_error_test_withtraceparameter_multi.fail();
101 } else
102 throw e$;
103 }
104
105 };
106 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.cc2, VoidTodyna mic());
107 stacktrace_rethrow_error_test_withtraceparameter_multi.dd2 = function() {
108 return stacktrace_rethrow_error_test_withtraceparameter_multi.ee2();
109 };
110 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.dd2, VoidTodyna mic());
111 stacktrace_rethrow_error_test_withtraceparameter_multi.ee2 = function() {
112 try {
113 stacktrace_rethrow_error_test_withtraceparameter_multi.ff2();
114 } catch (e) {
115 throw e;
116 }
117
118 };
119 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.ee2, VoidTodyna mic());
120 stacktrace_rethrow_error_test_withtraceparameter_multi.ff2 = function() {
121 return stacktrace_rethrow_error_test_withtraceparameter_multi.gg2();
122 };
123 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.ff2, VoidTodyna mic());
124 stacktrace_rethrow_error_test_withtraceparameter_multi.gg2 = function() {
125 return dart.throw(new stacktrace_rethrow_error_test_withtraceparameter_multi .SubclassOfError());
126 };
127 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.gg2, VoidTodyna mic());
128 stacktrace_rethrow_error_test_withtraceparameter_multi.aa3 = function() {
129 try {
130 stacktrace_rethrow_error_test_withtraceparameter_multi.bb3();
131 stacktrace_rethrow_error_test_withtraceparameter_multi.fail();
132 } catch (error) {
133 let stacktrace = dart.stackTrace(error);
134 stacktrace_rethrow_error_test_withtraceparameter_multi.expectTrace(JSArray OfString().of(['gg3', 'ff3', 'ee3', 'dd3', 'cc3', 'bb3', 'aa3']), dart.dload(err or, 'stackTrace'));
135 stacktrace_rethrow_error_test_withtraceparameter_multi.expectTrace(JSArray OfString().of(['cc3', 'bb3', 'aa3']), stacktrace);
136 }
137
138 };
139 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.aa3, VoidTodyna mic());
140 stacktrace_rethrow_error_test_withtraceparameter_multi.bb3 = function() {
141 return stacktrace_rethrow_error_test_withtraceparameter_multi.cc3();
142 };
143 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.bb3, VoidTodyna mic());
144 stacktrace_rethrow_error_test_withtraceparameter_multi.cc3 = function() {
145 try {
146 stacktrace_rethrow_error_test_withtraceparameter_multi.dd3();
147 } catch (e) {
148 dart.throw(e);
149 }
150
151 };
152 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.cc3, VoidTodyna mic());
153 stacktrace_rethrow_error_test_withtraceparameter_multi.dd3 = function() {
154 return stacktrace_rethrow_error_test_withtraceparameter_multi.ee3();
155 };
156 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.dd3, VoidTodyna mic());
157 stacktrace_rethrow_error_test_withtraceparameter_multi.ee3 = function() {
158 try {
159 stacktrace_rethrow_error_test_withtraceparameter_multi.ff3();
160 } catch (e) {
161 throw e;
162 }
163
164 };
165 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.ee3, VoidTodyna mic());
166 stacktrace_rethrow_error_test_withtraceparameter_multi.ff3 = function() {
167 return stacktrace_rethrow_error_test_withtraceparameter_multi.gg3();
168 };
169 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.ff3, VoidTodyna mic());
170 stacktrace_rethrow_error_test_withtraceparameter_multi.gg3 = function() {
171 return dart.throw(new stacktrace_rethrow_error_test_withtraceparameter_multi .SubclassOfError());
172 };
173 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.gg3, VoidTodyna mic());
174 stacktrace_rethrow_error_test_withtraceparameter_multi.expectTrace = function( functionNames, stacktrace) {
175 let traceLines = dart.toString(stacktrace)[dartx.split]('\n');
176 let expectedIndex = 0;
177 let actualIndex = 0;
178 core.print(stacktrace);
179 core.print(functionNames);
180 while (expectedIndex < dart.notNull(core.num._check(dart.dload(functionNames , 'length')))) {
181 let expected = dart.dindex(functionNames, expectedIndex);
182 let actual = traceLines[dartx.get](actualIndex);
183 if (actual[dartx.indexOf](core.Pattern._check(expected)) == -1) {
184 if (expectedIndex == 0) {
185 actualIndex++;
186 } else {
187 dart.throw(dart.str`Expected: ${expected} actual: ${actual}`);
188 }
189 } else {
190 actualIndex++;
191 expectedIndex++;
192 }
193 }
194 };
195 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.expectTrace, dy namicAnddynamicTodynamic());
196 stacktrace_rethrow_error_test_withtraceparameter_multi.main = function() {
197 stacktrace_rethrow_error_test_withtraceparameter_multi.aa1();
198 stacktrace_rethrow_error_test_withtraceparameter_multi.aa2();
199 stacktrace_rethrow_error_test_withtraceparameter_multi.aa3();
200 };
201 dart.fn(stacktrace_rethrow_error_test_withtraceparameter_multi.main, VoidTodyn amic());
202 // Exports:
203 exports.stacktrace_rethrow_error_test_withtraceparameter_multi = stacktrace_re throw_error_test_withtraceparameter_multi;
204 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698