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

Side by Side Diff: test/codegen/expect/corelib/apply2_test.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
« no previous file with comments | « test/codegen/expect/closure.js ('k') | test/codegen/expect/corelib/apply3_test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 dart_library.library('corelib/apply2_test', null, /* Imports */[
2 'dart_sdk',
3 'expect'
4 ], function load__apply2_test(exports, dart_sdk, expect) {
5 'use strict';
6 const core = dart_sdk.core;
7 const _interceptors = dart_sdk._interceptors;
8 const dart = dart_sdk.dart;
9 const dartx = dart_sdk.dartx;
10 const expect$ = expect.expect;
11 const apply2_test = Object.create(null);
12 let MapOfSymbol$dynamic = () => (MapOfSymbol$dynamic = dart.constFn(core.Map$( core.Symbol, dart.dynamic)))();
13 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c ore.int)))();
14 let FunctionAndListAndMapOfSymbol$dynamicTodynamic = () => (FunctionAndListAnd MapOfSymbol$dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynam ic, [core.Function, core.List, MapOfSymbol$dynamic()])))();
15 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [])))();
16 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT ype(core.bool, [dart.dynamic])))();
17 let dynamicAnddynamicAnddynamicTovoid = () => (dynamicAnddynamicAnddynamicTovo id = dart.constFn(dart.definiteFunctionType(dart.void, [dart.dynamic, dart.dynam ic, dart.dynamic])))();
18 let VoidToString = () => (VoidToString = dart.constFn(dart.definiteFunctionTyp e(core.String, [])))();
19 let dynamicToString = () => (dynamicToString = dart.constFn(dart.definiteFunct ionType(core.String, [dart.dynamic])))();
20 let __ToString = () => (__ToString = dart.constFn(dart.definiteFunctionType(co re.String, [], [dart.dynamic])))();
21 let __ToString$ = () => (__ToString$ = dart.constFn(dart.definiteFunctionType( core.String, [], {a: dart.dynamic})))();
22 let __ToString$0 = () => (__ToString$0 = dart.constFn(dart.definiteFunctionTyp e(core.String, [], {a: dart.dynamic, b: dart.dynamic})))();
23 let __ToString$1 = () => (__ToString$1 = dart.constFn(dart.definiteFunctionTyp e(core.String, [], {b: dart.dynamic, a: dart.dynamic})))();
24 let dynamic__ToString = () => (dynamic__ToString = dart.constFn(dart.definiteF unctionType(core.String, [dart.dynamic], {b: dart.dynamic, a: dart.dynamic})))() ;
25 let dynamicAnddynamic__ToString = () => (dynamicAnddynamic__ToString = dart.co nstFn(dart.definiteFunctionType(core.String, [dart.dynamic, dart.dynamic], [dart .dynamic, dart.dynamic])))();
26 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
27 apply2_test.apply = function(func, positional, named) {
28 return core.Function.apply(func, positional, named);
29 };
30 dart.fn(apply2_test.apply, FunctionAndListAndMapOfSymbol$dynamicTodynamic());
31 apply2_test.throwsNSME = function(func, positional, named) {
32 expect$.Expect.throws(dart.fn(() => apply2_test.apply(core.Function._check(f unc), core.List._check(positional), MapOfSymbol$dynamic()._check(named)), VoidTo void()), dart.fn(e => core.NoSuchMethodError.is(e), dynamicTobool()));
33 };
34 dart.fn(apply2_test.throwsNSME, dynamicAnddynamicAnddynamicTovoid());
35 let const$;
36 let const$0;
37 let const$1;
38 let const$2;
39 let const$3;
40 let const$4;
41 let const$5;
42 let const$6;
43 let const$7;
44 let const$8;
45 let const$9;
46 let const$10;
47 let const$11;
48 let const$12;
49 let const$13;
50 let const$14;
51 let const$15;
52 let const$16;
53 let const$17;
54 let const$18;
55 let const$19;
56 let const$20;
57 let const$21;
58 let const$22;
59 let const$23;
60 let const$24;
61 let const$25;
62 let const$26;
63 let const$27;
64 let const$28;
65 let const$29;
66 let const$30;
67 let const$31;
68 let const$32;
69 let const$33;
70 let const$34;
71 let const$35;
72 let const$36;
73 let const$37;
74 apply2_test.main = function() {
75 let c1 = dart.fn(() => 'c1', VoidToString());
76 let c2 = dart.fn(a => dart.str`c2 ${a}`, dynamicToString());
77 let c3 = dart.fn(a => {
78 if (a === void 0) a = 1;
79 return dart.str`c3 ${a}`;
80 }, __ToString());
81 let c4 = dart.fn(opts => {
82 let a = opts && 'a' in opts ? opts.a : 1;
83 return dart.str`c4 ${a}`;
84 }, __ToString$());
85 let c5 = dart.fn(opts => {
86 let a = opts && 'a' in opts ? opts.a : 1;
87 let b = opts && 'b' in opts ? opts.b : 2;
88 return dart.str`c5 ${a} ${b}`;
89 }, __ToString$0());
90 let c6 = dart.fn(opts => {
91 let b = opts && 'b' in opts ? opts.b : 1;
92 let a = opts && 'a' in opts ? opts.a : 2;
93 return dart.str`c6 ${a} ${b}`;
94 }, __ToString$1());
95 let c7 = dart.fn((x, opts) => {
96 let b = opts && 'b' in opts ? opts.b : 1;
97 let a = opts && 'a' in opts ? opts.a : 2;
98 return dart.str`c7 ${x} ${a} ${b}`;
99 }, dynamic__ToString());
100 let c8 = dart.fn((x, y, a, b) => {
101 if (a === void 0) a = 2;
102 if (b === void 0) b = 3;
103 return dart.str`c8 ${x} ${y} ${a} ${b}`;
104 }, dynamicAnddynamic__ToString());
105 expect$.Expect.equals('c1', apply2_test.apply(c1, null, null));
106 expect$.Expect.equals('c1', apply2_test.apply(c1, [], null));
107 expect$.Expect.equals('c1', apply2_test.apply(c1, [], dart.map()));
108 expect$.Expect.equals('c1', apply2_test.apply(c1, null, dart.map()));
109 apply2_test.throwsNSME(c1, JSArrayOfint().of([1]), null);
110 apply2_test.throwsNSME(c1, JSArrayOfint().of([1]), dart.map([const$ || (cons t$ = dart.const(core.Symbol.new('a'))), 2]));
111 apply2_test.throwsNSME(c1, null, dart.map([const$0 || (const$0 = dart.const( core.Symbol.new('a'))), 2]));
112 expect$.Expect.equals('c2 1', apply2_test.apply(c2, JSArrayOfint().of([1]), null));
113 expect$.Expect.equals('c2 1', apply2_test.apply(c2, JSArrayOfint().of([1]), dart.map()));
114 apply2_test.throwsNSME(c2, null, null);
115 apply2_test.throwsNSME(c2, [], null);
116 apply2_test.throwsNSME(c2, null, dart.map());
117 apply2_test.throwsNSME(c2, null, dart.map([const$1 || (const$1 = dart.const( core.Symbol.new('a'))), 1]));
118 apply2_test.throwsNSME(c2, JSArrayOfint().of([2]), dart.map([const$2 || (con st$2 = dart.const(core.Symbol.new('a'))), 1]));
119 expect$.Expect.equals('c3 1', apply2_test.apply(c3, null, null));
120 expect$.Expect.equals('c3 1', apply2_test.apply(c3, [], null));
121 expect$.Expect.equals('c3 2', apply2_test.apply(c3, JSArrayOfint().of([2]), dart.map()));
122 apply2_test.throwsNSME(c3, JSArrayOfint().of([1, 2]), null);
123 apply2_test.throwsNSME(c3, null, dart.map([const$3 || (const$3 = dart.const( core.Symbol.new('a'))), 1]));
124 expect$.Expect.equals('c4 1', apply2_test.apply(c4, [], null));
125 expect$.Expect.equals('c4 2', apply2_test.apply(c4, [], dart.map([const$4 || (const$4 = dart.const(core.Symbol.new('a'))), 2])));
126 expect$.Expect.equals('c4 1', apply2_test.apply(c4, null, null));
127 expect$.Expect.equals('c4 1', apply2_test.apply(c4, [], dart.map()));
128 apply2_test.throwsNSME(c4, JSArrayOfint().of([1]), dart.map([const$5 || (con st$5 = dart.const(core.Symbol.new('a'))), 1]));
129 apply2_test.throwsNSME(c4, JSArrayOfint().of([1]), dart.map());
130 apply2_test.throwsNSME(c4, [], dart.map([const$6 || (const$6 = dart.const(co re.Symbol.new('a'))), 1, const$7 || (const$7 = dart.const(core.Symbol.new('b'))) , 2]));
131 expect$.Expect.equals('c5 1 2', apply2_test.apply(c5, [], null));
132 expect$.Expect.equals('c5 3 2', apply2_test.apply(c5, [], dart.map([const$8 || (const$8 = dart.const(core.Symbol.new('a'))), 3])));
133 expect$.Expect.equals('c5 1 2', apply2_test.apply(c5, null, null));
134 expect$.Expect.equals('c5 1 2', apply2_test.apply(c5, [], dart.map()));
135 expect$.Expect.equals('c5 3 4', apply2_test.apply(c5, [], dart.map([const$9 || (const$9 = dart.const(core.Symbol.new('a'))), 3, const$10 || (const$10 = dart .const(core.Symbol.new('b'))), 4])));
136 expect$.Expect.equals('c5 4 3', apply2_test.apply(c5, [], dart.map([const$11 || (const$11 = dart.const(core.Symbol.new('b'))), 3, const$12 || (const$12 = da rt.const(core.Symbol.new('a'))), 4])));
137 expect$.Expect.equals('c5 1 3', apply2_test.apply(c5, [], dart.map([const$13 || (const$13 = dart.const(core.Symbol.new('b'))), 3])));
138 apply2_test.throwsNSME(c5, JSArrayOfint().of([1]), dart.map([const$14 || (co nst$14 = dart.const(core.Symbol.new('a'))), 1]));
139 apply2_test.throwsNSME(c5, JSArrayOfint().of([1]), dart.map());
140 apply2_test.throwsNSME(c5, [], dart.map([const$15 || (const$15 = dart.const( core.Symbol.new('a'))), 1, const$16 || (const$16 = dart.const(core.Symbol.new('b '))), 2, const$17 || (const$17 = dart.const(core.Symbol.new('c'))), 3]));
141 expect$.Expect.equals('c6 2 1', apply2_test.apply(c6, [], null));
142 expect$.Expect.equals('c6 3 1', apply2_test.apply(c6, [], dart.map([const$18 || (const$18 = dart.const(core.Symbol.new('a'))), 3])));
143 expect$.Expect.equals('c6 2 1', apply2_test.apply(c6, null, null));
144 expect$.Expect.equals('c6 2 1', apply2_test.apply(c6, [], dart.map()));
145 expect$.Expect.equals('c6 3 4', apply2_test.apply(c6, [], dart.map([const$19 || (const$19 = dart.const(core.Symbol.new('a'))), 3, const$20 || (const$20 = da rt.const(core.Symbol.new('b'))), 4])));
146 expect$.Expect.equals('c6 4 3', apply2_test.apply(c6, [], dart.map([const$21 || (const$21 = dart.const(core.Symbol.new('b'))), 3, const$22 || (const$22 = da rt.const(core.Symbol.new('a'))), 4])));
147 expect$.Expect.equals('c6 2 3', apply2_test.apply(c6, [], dart.map([const$23 || (const$23 = dart.const(core.Symbol.new('b'))), 3])));
148 apply2_test.throwsNSME(c6, JSArrayOfint().of([1]), dart.map([const$24 || (co nst$24 = dart.const(core.Symbol.new('a'))), 1]));
149 apply2_test.throwsNSME(c6, JSArrayOfint().of([1]), dart.map());
150 apply2_test.throwsNSME(c6, [], dart.map([const$25 || (const$25 = dart.const( core.Symbol.new('a'))), 1, const$26 || (const$26 = dart.const(core.Symbol.new('b '))), 2, const$27 || (const$27 = dart.const(core.Symbol.new('c'))), 3]));
151 expect$.Expect.equals('c7 7 2 1', apply2_test.apply(c7, JSArrayOfint().of([7 ]), null));
152 expect$.Expect.equals('c7 7 3 1', apply2_test.apply(c7, JSArrayOfint().of([7 ]), dart.map([const$28 || (const$28 = dart.const(core.Symbol.new('a'))), 3])));
153 expect$.Expect.equals('c7 7 2 1', apply2_test.apply(c7, JSArrayOfint().of([7 ]), dart.map()));
154 expect$.Expect.equals('c7 7 3 4', apply2_test.apply(c7, JSArrayOfint().of([7 ]), dart.map([const$29 || (const$29 = dart.const(core.Symbol.new('a'))), 3, cons t$30 || (const$30 = dart.const(core.Symbol.new('b'))), 4])));
155 expect$.Expect.equals('c7 7 4 3', apply2_test.apply(c7, JSArrayOfint().of([7 ]), dart.map([const$31 || (const$31 = dart.const(core.Symbol.new('b'))), 3, cons t$32 || (const$32 = dart.const(core.Symbol.new('a'))), 4])));
156 expect$.Expect.equals('c7 7 2 3', apply2_test.apply(c7, JSArrayOfint().of([7 ]), dart.map([const$33 || (const$33 = dart.const(core.Symbol.new('b'))), 3])));
157 apply2_test.throwsNSME(c7, [], dart.map([const$34 || (const$34 = dart.const( core.Symbol.new('a'))), 1]));
158 apply2_test.throwsNSME(c7, [], dart.map());
159 apply2_test.throwsNSME(c7, JSArrayOfint().of([7]), dart.map([const$35 || (co nst$35 = dart.const(core.Symbol.new('a'))), 1, const$36 || (const$36 = dart.cons t(core.Symbol.new('b'))), 2, const$37 || (const$37 = dart.const(core.Symbol.new( 'c'))), 3]));
160 expect$.Expect.equals('c8 7 8 2 3', apply2_test.apply(c8, JSArrayOfint().of( [7, 8]), null));
161 expect$.Expect.equals('c8 7 8 2 3', apply2_test.apply(c8, JSArrayOfint().of( [7, 8]), dart.map()));
162 expect$.Expect.equals('c8 7 8 3 3', apply2_test.apply(c8, JSArrayOfint().of( [7, 8, 3]), null));
163 expect$.Expect.equals('c8 7 8 3 4', apply2_test.apply(c8, JSArrayOfint().of( [7, 8, 3, 4]), null));
164 apply2_test.throwsNSME(c8, [], null);
165 apply2_test.throwsNSME(c8, [], dart.map());
166 apply2_test.throwsNSME(c8, JSArrayOfint().of([1]), null);
167 apply2_test.throwsNSME(c8, JSArrayOfint().of([7, 8, 9, 10, 11]), null);
168 };
169 dart.fn(apply2_test.main, VoidTodynamic());
170 // Exports:
171 exports.apply2_test = apply2_test;
172 });
OLDNEW
« no previous file with comments | « test/codegen/expect/closure.js ('k') | test/codegen/expect/corelib/apply3_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698