OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/conditional_method_invocation_test_01_multi', nul
l, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__conditional_method_invocation_test_01_multi(exports, dart_sdk,
expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const dart = dart_sdk.dart; |
| 8 const dartx = dart_sdk.dartx; |
| 9 const expect$ = expect.expect; |
| 10 const conditional_method_invocation_test_01_multi = Object.create(null); |
| 11 const conditional_access_helper = Object.create(null); |
| 12 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.functionType(dart
.dynamic, [])))(); |
| 13 let VoidTodynamic$ = () => (VoidTodynamic$ = dart.constFn(dart.definiteFunctio
nType(dart.dynamic, [])))(); |
| 14 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 15 let VoidToC = () => (VoidToC = dart.constFn(dart.definiteFunctionType(conditio
nal_method_invocation_test_01_multi.C, [])))(); |
| 16 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 17 let VoidToC$ = () => (VoidToC$ = dart.constFn(dart.definiteFunctionType(condit
ional_access_helper.C, [])))(); |
| 18 conditional_method_invocation_test_01_multi.bad = function() { |
| 19 expect$.Expect.fail('Should not be executed'); |
| 20 }; |
| 21 dart.fn(conditional_method_invocation_test_01_multi.bad, VoidTodynamic$()); |
| 22 conditional_method_invocation_test_01_multi.noMethod = function(e) { |
| 23 return core.NoSuchMethodError.is(e); |
| 24 }; |
| 25 dart.fn(conditional_method_invocation_test_01_multi.noMethod, dynamicTodynamic
()); |
| 26 conditional_method_invocation_test_01_multi.B = class B extends core.Object {}
; |
| 27 conditional_method_invocation_test_01_multi.C = class C extends conditional_me
thod_invocation_test_01_multi.B { |
| 28 f(callback) { |
| 29 return callback(); |
| 30 } |
| 31 g(callback) { |
| 32 return callback(); |
| 33 } |
| 34 static staticF(callback) { |
| 35 return callback(); |
| 36 } |
| 37 static staticG(callback) { |
| 38 return callback(); |
| 39 } |
| 40 }; |
| 41 dart.setSignature(conditional_method_invocation_test_01_multi.C, { |
| 42 methods: () => ({ |
| 43 f: dart.definiteFunctionType(dart.dynamic, [dart.functionType(dart.dynamic
, [])]), |
| 44 g: dart.definiteFunctionType(core.int, [dart.functionType(core.int, [])]) |
| 45 }), |
| 46 statics: () => ({ |
| 47 staticF: dart.definiteFunctionType(dart.dynamic, [dart.functionType(dart.d
ynamic, [])]), |
| 48 staticG: dart.definiteFunctionType(core.int, [dart.functionType(core.int,
[])]) |
| 49 }), |
| 50 names: ['staticF', 'staticG'] |
| 51 }); |
| 52 conditional_method_invocation_test_01_multi.nullC = function() { |
| 53 return null; |
| 54 }; |
| 55 dart.fn(conditional_method_invocation_test_01_multi.nullC, VoidToC()); |
| 56 conditional_method_invocation_test_01_multi.main = function() { |
| 57 dart.nullSafe(conditional_method_invocation_test_01_multi.nullC(), _ => _.f(
null)); |
| 58 expect$.Expect.equals(null, dart.nullSafe(conditional_method_invocation_test
_01_multi.nullC(), _ => _.f(VoidTodynamic()._check(conditional_method_invocation
_test_01_multi.bad())))); |
| 59 }; |
| 60 dart.fn(conditional_method_invocation_test_01_multi.main, VoidTodynamic$()); |
| 61 conditional_access_helper.topLevelVar = null; |
| 62 conditional_access_helper.topLevelFunction = function() { |
| 63 }; |
| 64 dart.fn(conditional_access_helper.topLevelFunction, VoidTovoid()); |
| 65 conditional_access_helper.C = class C extends core.Object { |
| 66 static staticF(callback) { |
| 67 return callback(); |
| 68 } |
| 69 static staticG(callback) { |
| 70 return callback(); |
| 71 } |
| 72 }; |
| 73 dart.setSignature(conditional_access_helper.C, { |
| 74 statics: () => ({ |
| 75 staticF: dart.definiteFunctionType(dart.dynamic, [dart.functionType(dart.d
ynamic, [])]), |
| 76 staticG: dart.definiteFunctionType(core.int, [dart.functionType(core.int,
[])]) |
| 77 }), |
| 78 names: ['staticF', 'staticG'] |
| 79 }); |
| 80 conditional_access_helper.C.staticInt = null; |
| 81 conditional_access_helper.nullC = function() { |
| 82 return null; |
| 83 }; |
| 84 dart.fn(conditional_access_helper.nullC, VoidToC$()); |
| 85 conditional_access_helper.D = class D extends core.Object {}; |
| 86 conditional_access_helper.D.staticE = null; |
| 87 conditional_access_helper.E = class E extends core.Object { |
| 88 ['+'](i) { |
| 89 return new conditional_access_helper.I(); |
| 90 } |
| 91 ['-'](i) { |
| 92 return new conditional_access_helper.I(); |
| 93 } |
| 94 }; |
| 95 dart.setSignature(conditional_access_helper.E, { |
| 96 methods: () => ({ |
| 97 '+': dart.definiteFunctionType(conditional_access_helper.G, [core.int]), |
| 98 '-': dart.definiteFunctionType(conditional_access_helper.G, [core.int]) |
| 99 }) |
| 100 }); |
| 101 conditional_access_helper.F = class F extends core.Object {}; |
| 102 conditional_access_helper.G = class G extends conditional_access_helper.E {}; |
| 103 conditional_access_helper.G[dart.implements] = () => [conditional_access_helpe
r.F]; |
| 104 conditional_access_helper.H = class H extends core.Object {}; |
| 105 conditional_access_helper.I = class I extends conditional_access_helper.G {}; |
| 106 conditional_access_helper.I[dart.implements] = () => [conditional_access_helpe
r.H]; |
| 107 // Exports: |
| 108 exports.conditional_method_invocation_test_01_multi = conditional_method_invoc
ation_test_01_multi; |
| 109 exports.conditional_access_helper = conditional_access_helper; |
| 110 }); |
OLD | NEW |