OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/deferred_not_loaded_check_test', null, /* Imports
*/[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__deferred_not_loaded_check_test(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 deferred_not_loaded_check_test = Object.create(null); |
| 11 const deferred_not_loaded_check_lib = Object.create(null); |
| 12 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.functionType(dart.void,
[])))(); |
| 13 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 14 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 15 let VoidToint = () => (VoidToint = dart.constFn(dart.definiteFunctionType(core
.int, [])))(); |
| 16 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 17 let VoidTovoid$ = () => (VoidTovoid$ = dart.constFn(dart.definiteFunctionType(
dart.void, [])))(); |
| 18 let intTodynamic = () => (intTodynamic = dart.constFn(dart.definiteFunctionTyp
e(dart.dynamic, [core.int])))(); |
| 19 let intToint = () => (intToint = dart.constFn(dart.definiteFunctionType(core.i
nt, [core.int])))(); |
| 20 deferred_not_loaded_check_test.c = null; |
| 21 deferred_not_loaded_check_test.expectNoSideEffect = function(test) { |
| 22 deferred_not_loaded_check_test.c = 0; |
| 23 dart.dcall(test); |
| 24 expect$.Expect.isTrue(dart.equals(deferred_not_loaded_check_test.c, 0)); |
| 25 }; |
| 26 dart.fn(deferred_not_loaded_check_test.expectNoSideEffect, dynamicTodynamic())
; |
| 27 deferred_not_loaded_check_test.expectThrowsNotLoaded = function(test) { |
| 28 expect$.Expect.throws(VoidTovoid()._check(test), dart.fn(e => core.Error.is(
e), dynamicTobool())); |
| 29 }; |
| 30 dart.fn(deferred_not_loaded_check_test.expectThrowsNotLoaded, dynamicTodynamic
()); |
| 31 deferred_not_loaded_check_test.sideEffect = function() { |
| 32 deferred_not_loaded_check_test.c = 1; |
| 33 return 10; |
| 34 }; |
| 35 dart.fn(deferred_not_loaded_check_test.sideEffect, VoidToint()); |
| 36 deferred_not_loaded_check_test.main = function() { |
| 37 deferred_not_loaded_check_test.expectNoSideEffect(dart.fn(() => { |
| 38 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 39 deferred_not_loaded_check_lib.foo(deferred_not_loaded_check_test.sideEff
ect()); |
| 40 }, VoidTodynamic())); |
| 41 }, VoidTodynamic())); |
| 42 deferred_not_loaded_check_test.expectNoSideEffect(dart.fn(() => { |
| 43 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 44 deferred_not_loaded_check_lib.C.foo(deferred_not_loaded_check_test.sideE
ffect()); |
| 45 }, VoidTodynamic())); |
| 46 }, VoidTodynamic())); |
| 47 deferred_not_loaded_check_test.expectNoSideEffect(dart.fn(() => { |
| 48 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 49 new deferred_not_loaded_check_lib.C(deferred_not_loaded_check_test.sideE
ffect()); |
| 50 }, VoidTodynamic())); |
| 51 }, VoidTodynamic())); |
| 52 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 53 deferred_not_loaded_check_lib.a; |
| 54 }, VoidTodynamic())); |
| 55 deferred_not_loaded_check_test.expectNoSideEffect(dart.fn(() => { |
| 56 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 57 deferred_not_loaded_check_lib.a = deferred_not_loaded_check_test.sideEff
ect(); |
| 58 }, VoidTodynamic())); |
| 59 }, VoidTodynamic())); |
| 60 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 61 deferred_not_loaded_check_lib.getter; |
| 62 }, VoidTodynamic())); |
| 63 deferred_not_loaded_check_test.expectNoSideEffect(dart.fn(() => { |
| 64 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 65 deferred_not_loaded_check_lib.setter = deferred_not_loaded_check_test.si
deEffect(); |
| 66 }, VoidTodynamic())); |
| 67 }, VoidTodynamic())); |
| 68 deferred_not_loaded_check_test.expectNoSideEffect(dart.fn(() => { |
| 69 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 70 deferred_not_loaded_check_lib.list[dartx.set](deferred_not_loaded_check_
test.sideEffect(), deferred_not_loaded_check_test.sideEffect()); |
| 71 }, VoidTodynamic())); |
| 72 }, VoidTodynamic())); |
| 73 deferred_not_loaded_check_test.expectNoSideEffect(dart.fn(() => { |
| 74 deferred_not_loaded_check_test.expectThrowsNotLoaded(dart.fn(() => { |
| 75 deferred_not_loaded_check_lib.closure(deferred_not_loaded_check_test.sid
eEffect()); |
| 76 }, VoidTodynamic())); |
| 77 }, VoidTodynamic())); |
| 78 }; |
| 79 dart.fn(deferred_not_loaded_check_test.main, VoidTovoid$()); |
| 80 deferred_not_loaded_check_lib.foo = function(arg) { |
| 81 }; |
| 82 dart.fn(deferred_not_loaded_check_lib.foo, intTodynamic()); |
| 83 deferred_not_loaded_check_lib.C = class C extends core.Object { |
| 84 new(arg) { |
| 85 } |
| 86 static foo(arg) {} |
| 87 }; |
| 88 dart.setSignature(deferred_not_loaded_check_lib.C, { |
| 89 constructors: () => ({new: dart.definiteFunctionType(deferred_not_loaded_che
ck_lib.C, [core.int])}), |
| 90 statics: () => ({foo: dart.definiteFunctionType(dart.dynamic, [core.int])}), |
| 91 names: ['foo'] |
| 92 }); |
| 93 deferred_not_loaded_check_lib.a = null; |
| 94 dart.copyProperties(deferred_not_loaded_check_lib, { |
| 95 get getter() { |
| 96 return 42; |
| 97 } |
| 98 }); |
| 99 dart.copyProperties(deferred_not_loaded_check_lib, { |
| 100 set setter(arg) { |
| 101 deferred_not_loaded_check_lib.a = 10; |
| 102 } |
| 103 }); |
| 104 dart.defineLazy(deferred_not_loaded_check_lib, { |
| 105 get list() { |
| 106 return core.List.new(); |
| 107 }, |
| 108 set list(_) {} |
| 109 }); |
| 110 dart.defineLazy(deferred_not_loaded_check_lib, { |
| 111 get closure() { |
| 112 return dart.fn(arg => 3, intToint()); |
| 113 }, |
| 114 set closure(_) {} |
| 115 }); |
| 116 // Exports: |
| 117 exports.deferred_not_loaded_check_test = deferred_not_loaded_check_test; |
| 118 exports.deferred_not_loaded_check_lib = deferred_not_loaded_check_lib; |
| 119 }); |
OLD | NEW |