OLD | NEW |
1 dart_library.library('language/function_syntax_test_none_multi', null, /* Import
s */[ | 1 dart_library.library('language/function_syntax_test_none_multi', null, /* Import
s */[ |
2 'dart_sdk', | 2 'dart_sdk', |
3 'expect' | 3 'expect' |
4 ], function load__function_syntax_test_none_multi(exports, dart_sdk, expect) { | 4 ], function load__function_syntax_test_none_multi(exports, dart_sdk, expect) { |
5 'use strict'; | 5 'use strict'; |
6 const core = dart_sdk.core; | 6 const core = dart_sdk.core; |
7 const _interceptors = dart_sdk._interceptors; | 7 const _interceptors = dart_sdk._interceptors; |
8 const dart = dart_sdk.dart; | 8 const dart = dart_sdk.dart; |
9 const dartx = dart_sdk.dartx; | 9 const dartx = dart_sdk.dartx; |
10 const expect$ = expect.expect; | 10 const expect$ = expect.expect; |
11 const function_syntax_test_none_multi = Object.create(null); | 11 const function_syntax_test_none_multi = Object.create(null); |
12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); | 12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); |
13 let ListOfint = () => (ListOfint = dart.constFn(core.List$(core.int)))(); | 13 let ListOfint = () => (ListOfint = dart.constFn(core.List$(core.int)))(); |
14 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.functionType(dart
.dynamic, [])))(); | 14 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.functionType(dart
.dynamic, [])))(); |
15 let VoidToint = () => (VoidToint = dart.constFn(dart.functionType(core.int, []
)))(); | 15 let VoidToint = () => (VoidToint = dart.constFn(dart.functionType(core.int, []
)))(); |
16 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.functionTyp
e(dart.dynamic, [dart.dynamic])))(); | 16 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.functionTyp
e(dart.dynamic, [dart.dynamic])))(); |
17 let intTodynamic = () => (intTodynamic = dart.constFn(dart.functionType(dart.d
ynamic, [core.int])))(); | 17 let intTodynamic = () => (intTodynamic = dart.constFn(dart.functionType(dart.d
ynamic, [core.int])))(); |
18 let JSArrayOfVoidToint = () => (JSArrayOfVoidToint = dart.constFn(_interceptor
s.JSArray$(VoidToint())))(); | 18 let JSArrayOfVoidToint = () => (JSArrayOfVoidToint = dart.constFn(_interceptor
s.JSArray$(VoidToint())))(); |
19 let VoidTodynamic$ = () => (VoidTodynamic$ = dart.constFn(dart.definiteFunctio
nType(dart.dynamic, [])))(); | 19 let VoidToint$ = () => (VoidToint$ = dart.constFn(dart.definiteFunctionType(co
re.int, [])))(); |
20 let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteF
unctionType(dart.dynamic, [dart.dynamic])))(); | 20 let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteF
unctionType(dart.dynamic, [dart.dynamic])))(); |
21 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons
tFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))(); | 21 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons
tFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))(); |
22 let VoidToint$ = () => (VoidToint$ = dart.constFn(dart.definiteFunctionType(co
re.int, [])))(); | |
23 let dynamicToint = () => (dynamicToint = dart.constFn(dart.definiteFunctionTyp
e(core.int, [dart.dynamic])))(); | 22 let dynamicToint = () => (dynamicToint = dart.constFn(dart.definiteFunctionTyp
e(core.int, [dart.dynamic])))(); |
24 let dynamicAnddynamicToint = () => (dynamicAnddynamicToint = dart.constFn(dart
.definiteFunctionType(core.int, [dart.dynamic, dart.dynamic])))(); | 23 let dynamicAnddynamicToint = () => (dynamicAnddynamicToint = dart.constFn(dart
.definiteFunctionType(core.int, [dart.dynamic, dart.dynamic])))(); |
25 let intToint = () => (intToint = dart.constFn(dart.definiteFunctionType(core.i
nt, [core.int])))(); | 24 let intToint = () => (intToint = dart.constFn(dart.definiteFunctionType(core.i
nt, [core.int])))(); |
26 let intAndintToint = () => (intAndintToint = dart.constFn(dart.definiteFunctio
nType(core.int, [core.int, core.int])))(); | 25 let intAndintToint = () => (intAndintToint = dart.constFn(dart.definiteFunctio
nType(core.int, [core.int, core.int])))(); |
27 let VoidToListOfint = () => (VoidToListOfint = dart.constFn(dart.definiteFunct
ionType(ListOfint(), [])))(); | 26 let VoidToListOfint = () => (VoidToListOfint = dart.constFn(dart.definiteFunct
ionType(ListOfint(), [])))(); |
28 let ListOfintToListOfint = () => (ListOfintToListOfint = dart.constFn(dart.def
initeFunctionType(ListOfint(), [ListOfint()])))(); | 27 let ListOfintToListOfint = () => (ListOfintToListOfint = dart.constFn(dart.def
initeFunctionType(ListOfint(), [ListOfint()])))(); |
29 let dynamicAnddynamicAnddynamicTodynamic = () => (dynamicAnddynamicAnddynamicT
odynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, d
art.dynamic, dart.dynamic])))(); | 28 let dynamicAnddynamicAnddynamicTodynamic = () => (dynamicAnddynamicAnddynamicT
odynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, d
art.dynamic, dart.dynamic])))(); |
| 29 let VoidTodynamic$ = () => (VoidTodynamic$ = dart.constFn(dart.definiteFunctio
nType(dart.dynamic, [])))(); |
30 let VoidTobool = () => (VoidTobool = dart.constFn(dart.definiteFunctionType(co
re.bool, [])))(); | 30 let VoidTobool = () => (VoidTobool = dart.constFn(dart.definiteFunctionType(co
re.bool, [])))(); |
31 let VoidTodouble = () => (VoidTodouble = dart.constFn(dart.definiteFunctionTyp
e(core.double, [])))(); | 31 let VoidTodouble = () => (VoidTodouble = dart.constFn(dart.definiteFunctionTyp
e(core.double, [])))(); |
32 let FnTodynamic = () => (FnTodynamic = dart.constFn(dart.definiteFunctionType(
dart.dynamic, [VoidTodynamic()])))(); | 32 let FnTodynamic = () => (FnTodynamic = dart.constFn(dart.definiteFunctionType(
dart.dynamic, [VoidTodynamic()])))(); |
33 let FnTodynamic$ = () => (FnTodynamic$ = dart.constFn(dart.definiteFunctionTyp
e(dart.dynamic, [VoidToint()])))(); | 33 let FnToint = () => (FnToint = dart.constFn(dart.definiteFunctionType(core.int
, [VoidToint()])))(); |
34 let FnTodynamic$0 = () => (FnTodynamic$0 = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [dynamicTodynamic()])))(); | 34 let FnTodynamic$ = () => (FnTodynamic$ = dart.constFn(dart.definiteFunctionTyp
e(dart.dynamic, [dynamicTodynamic()])))(); |
35 let FnTodynamic$1 = () => (FnTodynamic$1 = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [intTodynamic()])))(); | 35 let FnTodynamic$0 = () => (FnTodynamic$0 = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [intTodynamic()])))(); |
36 function_syntax_test_none_multi.FunctionSyntaxTest = class FunctionSyntaxTest
extends core.Object { | 36 function_syntax_test_none_multi.FunctionSyntaxTest = class FunctionSyntaxTest
extends core.Object { |
37 static testMain() { | 37 static testMain() { |
38 function_syntax_test_none_multi.FunctionSyntaxTest.testNestedFunctions(); | 38 function_syntax_test_none_multi.FunctionSyntaxTest.testNestedFunctions(); |
39 function_syntax_test_none_multi.FunctionSyntaxTest.testFunctionExpressions
(); | 39 function_syntax_test_none_multi.FunctionSyntaxTest.testFunctionExpressions
(); |
40 function_syntax_test_none_multi.FunctionSyntaxTest.testPrecedence(); | 40 function_syntax_test_none_multi.FunctionSyntaxTest.testPrecedence(); |
41 function_syntax_test_none_multi.FunctionSyntaxTest.testInitializers(); | 41 function_syntax_test_none_multi.FunctionSyntaxTest.testInitializers(); |
42 function_syntax_test_none_multi.FunctionSyntaxTest.testFunctionParameter()
; | 42 function_syntax_test_none_multi.FunctionSyntaxTest.testFunctionParameter()
; |
43 function_syntax_test_none_multi.FunctionSyntaxTest.testFunctionIdentifierE
xpression(); | 43 function_syntax_test_none_multi.FunctionSyntaxTest.testFunctionIdentifierE
xpression(); |
44 function_syntax_test_none_multi.FunctionSyntaxTest.testFunctionIdentifierS
tatement(); | 44 function_syntax_test_none_multi.FunctionSyntaxTest.testFunctionIdentifierS
tatement(); |
45 } | 45 } |
46 static testNestedFunctions() { | 46 static testNestedFunctions() { |
47 function nb0() { | 47 function nb0() { |
48 return 42; | 48 return 42; |
49 } | 49 } |
50 dart.fn(nb0, VoidTodynamic$()); | 50 dart.fn(nb0, VoidToint$()); |
51 function nb1(a) { | 51 function nb1(a) { |
52 return a; | 52 return a; |
53 } | 53 } |
54 dart.fn(nb1, dynamicTodynamic$()); | 54 dart.fn(nb1, dynamicTodynamic$()); |
55 function nb2(a, b) { | 55 function nb2(a, b) { |
56 return dart.dsend(a, '+', b); | 56 return dart.dsend(a, '+', b); |
57 } | 57 } |
58 dart.fn(nb2, dynamicAnddynamicTodynamic()); | 58 dart.fn(nb2, dynamicAnddynamicTodynamic()); |
59 expect$.Expect.equals(42, nb0()); | 59 expect$.Expect.equals(42, nb0()); |
60 expect$.Expect.equals(87, nb1(87)); | 60 expect$.Expect.equals(87, nb1(87)); |
61 expect$.Expect.equals(1 + 2, nb2(1, 2)); | 61 expect$.Expect.equals(1 + 2, nb2(1, 2)); |
62 function na0() { | 62 function na0() { |
63 return 42; | 63 return 42; |
64 } | 64 } |
65 dart.fn(na0, VoidTodynamic$()); | 65 dart.fn(na0, VoidToint$()); |
66 function na1(a) { | 66 function na1(a) { |
67 return a; | 67 return a; |
68 } | 68 } |
69 dart.fn(na1, dynamicTodynamic$()); | 69 dart.fn(na1, dynamicTodynamic$()); |
70 function na2(a, b) { | 70 function na2(a, b) { |
71 return dart.dsend(a, '+', b); | 71 return dart.dsend(a, '+', b); |
72 } | 72 } |
73 dart.fn(na2, dynamicAnddynamicTodynamic()); | 73 dart.fn(na2, dynamicAnddynamicTodynamic()); |
74 expect$.Expect.equals(42, na0()); | 74 expect$.Expect.equals(42, na0()); |
75 expect$.Expect.equals(87, na1(87)); | 75 expect$.Expect.equals(87, na1(87)); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 expectEvaluatesTo(false, dart.fn(() => !true, VoidTobool())); | 233 expectEvaluatesTo(false, dart.fn(() => !true, VoidTobool())); |
234 let y = 0; | 234 let y = 0; |
235 expectEvaluatesTo(0, dart.fn(() => y++, VoidToint$())); | 235 expectEvaluatesTo(0, dart.fn(() => y++, VoidToint$())); |
236 expectEvaluatesTo(2, dart.fn(() => ++y, VoidToint$())); | 236 expectEvaluatesTo(2, dart.fn(() => ++y, VoidToint$())); |
237 expectEvaluatesTo(1, dart.fn(() => --y, VoidToint$())); | 237 expectEvaluatesTo(1, dart.fn(() => --y, VoidToint$())); |
238 expectEvaluatesTo(1, dart.fn(() => y--, VoidToint$())); | 238 expectEvaluatesTo(1, dart.fn(() => y--, VoidToint$())); |
239 expect$.Expect.equals(0, y); | 239 expect$.Expect.equals(0, y); |
240 function fn() { | 240 function fn() { |
241 return 42; | 241 return 42; |
242 } | 242 } |
243 dart.fn(fn, VoidTodynamic$()); | 243 dart.fn(fn, VoidToint$()); |
244 let list = JSArrayOfint().of([87]); | 244 let list = JSArrayOfint().of([87]); |
245 expectEvaluatesTo(42, dart.fn(() => fn(), VoidTodynamic$())); | 245 expectEvaluatesTo(42, dart.fn(() => fn(), VoidToint$())); |
246 expectEvaluatesTo(1, dart.fn(() => list[dartx.length], VoidToint$())); | 246 expectEvaluatesTo(1, dart.fn(() => list[dartx.length], VoidToint$())); |
247 expectEvaluatesTo(87, dart.fn(() => list[dartx.get](0), VoidToint$())); | 247 expectEvaluatesTo(87, dart.fn(() => list[dartx.get](0), VoidToint$())); |
248 expectEvaluatesTo(87, dart.fn(() => list[dartx.removeLast](), VoidToint$()
)); | 248 expectEvaluatesTo(87, dart.fn(() => list[dartx.removeLast](), VoidToint$()
)); |
249 } | 249 } |
250 static testInitializers() { | 250 static testInitializers() { |
251 expect$.Expect.equals(42, dart.dcall(new function_syntax_test_none_multi.C
.cb0().fn)); | 251 expect$.Expect.equals(42, dart.dcall(new function_syntax_test_none_multi.C
.cb0().fn)); |
252 expect$.Expect.equals(43, dart.dcall(new function_syntax_test_none_multi.C
.ca0().fn)); | 252 expect$.Expect.equals(43, dart.dcall(new function_syntax_test_none_multi.C
.ca0().fn)); |
253 expect$.Expect.equals(44, dart.dcall(new function_syntax_test_none_multi.C
.cb1().fn)); | 253 expect$.Expect.equals(44, dart.dcall(new function_syntax_test_none_multi.C
.cb1().fn)); |
254 expect$.Expect.equals(45, dart.dcall(new function_syntax_test_none_multi.C
.ca1().fn)); | 254 expect$.Expect.equals(45, dart.dcall(new function_syntax_test_none_multi.C
.ca1().fn)); |
255 expect$.Expect.equals(46, dart.dcall(new function_syntax_test_none_multi.C
.cb2().fn)); | 255 expect$.Expect.equals(46, dart.dcall(new function_syntax_test_none_multi.C
.cb2().fn)); |
(...skipping 19 matching lines...) Expand all Loading... |
275 } | 275 } |
276 static testFunctionParameter() { | 276 static testFunctionParameter() { |
277 function f0(fn) { | 277 function f0(fn) { |
278 return fn(); | 278 return fn(); |
279 } | 279 } |
280 dart.fn(f0, FnTodynamic()); | 280 dart.fn(f0, FnTodynamic()); |
281 expect$.Expect.equals(42, f0(dart.fn(() => 42, VoidToint$()))); | 281 expect$.Expect.equals(42, f0(dart.fn(() => 42, VoidToint$()))); |
282 function f1(fn) { | 282 function f1(fn) { |
283 return fn(); | 283 return fn(); |
284 } | 284 } |
285 dart.fn(f1, FnTodynamic$()); | 285 dart.fn(f1, FnToint()); |
286 expect$.Expect.equals(87, f1(dart.fn(() => 87, VoidToint$()))); | 286 expect$.Expect.equals(87, f1(dart.fn(() => 87, VoidToint$()))); |
287 function f2(fn) { | 287 function f2(fn) { |
288 return dart.dcall(fn, 42); | 288 return dart.dcall(fn, 42); |
289 } | 289 } |
290 dart.fn(f2, FnTodynamic$0()); | 290 dart.fn(f2, FnTodynamic$()); |
291 expect$.Expect.equals(43, f2(dart.fn(a => dart.dsend(a, '+', 1), dynamicTo
dynamic$()))); | 291 expect$.Expect.equals(43, f2(dart.fn(a => dart.dsend(a, '+', 1), dynamicTo
dynamic$()))); |
292 function f3(fn) { | 292 function f3(fn) { |
293 return fn(42); | 293 return fn(42); |
294 } | 294 } |
295 dart.fn(f3, FnTodynamic$1()); | 295 dart.fn(f3, FnTodynamic$0()); |
296 expect$.Expect.equals(44, f3(dart.fn(a => dart.notNull(a) + 2, intToint())
)); | 296 expect$.Expect.equals(44, f3(dart.fn(a => dart.notNull(a) + 2, intToint())
)); |
297 } | 297 } |
298 static testFunctionIdentifierExpression() { | 298 static testFunctionIdentifierExpression() { |
299 expect$.Expect.equals(87, dart.fn(() => 87, VoidToint$())()); | 299 expect$.Expect.equals(87, dart.fn(() => 87, VoidToint$())()); |
300 } | 300 } |
301 static testFunctionIdentifierStatement() { | 301 static testFunctionIdentifierStatement() { |
302 function func() { | 302 function func() { |
303 return 42; | 303 return 42; |
304 } | 304 } |
305 dart.fn(func, VoidTodynamic$()); | 305 dart.fn(func, VoidToint$()); |
306 expect$.Expect.equals(42, func()); | 306 expect$.Expect.equals(42, func()); |
307 expect$.Expect.equals(true, core.Function.is(func)); | 307 expect$.Expect.equals(true, core.Function.is(func)); |
308 } | 308 } |
309 }; | 309 }; |
310 dart.setSignature(function_syntax_test_none_multi.FunctionSyntaxTest, { | 310 dart.setSignature(function_syntax_test_none_multi.FunctionSyntaxTest, { |
311 statics: () => ({ | 311 statics: () => ({ |
312 testMain: dart.definiteFunctionType(dart.void, []), | 312 testMain: dart.definiteFunctionType(dart.void, []), |
313 testNestedFunctions: dart.definiteFunctionType(dart.void, []), | 313 testNestedFunctions: dart.definiteFunctionType(dart.void, []), |
314 testFunctionExpressions: dart.definiteFunctionType(dart.void, []), | 314 testFunctionExpressions: dart.definiteFunctionType(dart.void, []), |
315 testPrecedence: dart.definiteFunctionType(dart.void, []), | 315 testPrecedence: dart.definiteFunctionType(dart.void, []), |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 statics: () => ({wrap: dart.definiteFunctionType(dart.dynamic, [dart.dynamic
])}), | 451 statics: () => ({wrap: dart.definiteFunctionType(dart.dynamic, [dart.dynamic
])}), |
452 names: ['wrap'] | 452 names: ['wrap'] |
453 }); | 453 }); |
454 function_syntax_test_none_multi.main = function() { | 454 function_syntax_test_none_multi.main = function() { |
455 function_syntax_test_none_multi.FunctionSyntaxTest.testMain(); | 455 function_syntax_test_none_multi.FunctionSyntaxTest.testMain(); |
456 }; | 456 }; |
457 dart.fn(function_syntax_test_none_multi.main, VoidTodynamic$()); | 457 dart.fn(function_syntax_test_none_multi.main, VoidTodynamic$()); |
458 // Exports: | 458 // Exports: |
459 exports.function_syntax_test_none_multi = function_syntax_test_none_multi; | 459 exports.function_syntax_test_none_multi = function_syntax_test_none_multi; |
460 }); | 460 }); |
OLD | NEW |