OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/async_and_or_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect', |
| 4 'async_helper' |
| 5 ], function load__async_and_or_test(exports, dart_sdk, expect, async_helper) { |
| 6 'use strict'; |
| 7 const core = dart_sdk.core; |
| 8 const async = dart_sdk.async; |
| 9 const dart = dart_sdk.dart; |
| 10 const dartx = dart_sdk.dartx; |
| 11 const expect$ = expect.expect; |
| 12 const async_helper$ = async_helper.async_helper; |
| 13 const async_and_or_test = Object.create(null); |
| 14 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.functionType(dart.void,
[])))(); |
| 15 let FutureOfvoid = () => (FutureOfvoid = dart.constFn(async.Future$(dart.void)
))(); |
| 16 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 17 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 18 let FnTodynamic = () => (FnTodynamic = dart.constFn(dart.definiteFunctionType(
dart.dynamic, [VoidTovoid()])))(); |
| 19 let VoidToFutureOfvoid = () => (VoidToFutureOfvoid = dart.constFn(dart.definit
eFunctionType(FutureOfvoid(), [])))(); |
| 20 let dynamicTovoid = () => (dynamicTovoid = dart.constFn(dart.definiteFunctionT
ype(dart.void, [dart.dynamic])))(); |
| 21 async_and_or_test.confuse = function(x) { |
| 22 return x; |
| 23 }; |
| 24 dart.fn(async_and_or_test.confuse, dynamicTodynamic()); |
| 25 async_and_or_test.test1 = function() { |
| 26 return dart.async(function*() { |
| 27 expect$.Expect.isFalse(dart.test(yield async_and_or_test.confuse(false)) &
& dart.test(yield async_and_or_test.confuse(false))); |
| 28 expect$.Expect.isFalse(dart.test(yield async_and_or_test.confuse(false)) &
& dart.test(yield async_and_or_test.confuse(true))); |
| 29 expect$.Expect.isFalse(dart.test(yield async_and_or_test.confuse(true)) &&
dart.test(yield async_and_or_test.confuse(false))); |
| 30 expect$.Expect.isTrue(dart.test(yield async_and_or_test.confuse(true)) &&
dart.test(yield async_and_or_test.confuse(true))); |
| 31 expect$.Expect.isFalse(dart.test(yield async_and_or_test.confuse(false)) |
| dart.test(yield async_and_or_test.confuse(false))); |
| 32 expect$.Expect.isTrue(dart.test(yield async_and_or_test.confuse(false)) ||
dart.test(yield async_and_or_test.confuse(true))); |
| 33 expect$.Expect.isTrue(dart.test(yield async_and_or_test.confuse(true)) ||
dart.test(yield async_and_or_test.confuse(false))); |
| 34 expect$.Expect.isTrue(dart.test(yield async_and_or_test.confuse(true)) ||
dart.test(yield async_and_or_test.confuse(true))); |
| 35 }, dart.dynamic); |
| 36 }; |
| 37 dart.fn(async_and_or_test.test1, VoidTodynamic()); |
| 38 async_and_or_test.trace = null; |
| 39 async_and_or_test.traceA = function(x) { |
| 40 async_and_or_test.trace = dart.notNull(async_and_or_test.trace) + "a"; |
| 41 return x; |
| 42 }; |
| 43 dart.fn(async_and_or_test.traceA, dynamicTodynamic()); |
| 44 async_and_or_test.traceB = function(x) { |
| 45 async_and_or_test.trace = dart.notNull(async_and_or_test.trace) + "b"; |
| 46 return x; |
| 47 }; |
| 48 dart.fn(async_and_or_test.traceB, dynamicTodynamic()); |
| 49 async_and_or_test.testEvaluation = function(fn) { |
| 50 return dart.async(function*(fn) { |
| 51 async_and_or_test.trace = ""; |
| 52 yield fn(); |
| 53 }, dart.dynamic, fn); |
| 54 }; |
| 55 dart.fn(async_and_or_test.testEvaluation, FnTodynamic()); |
| 56 async_and_or_test.test2 = function() { |
| 57 return dart.async(function*() { |
| 58 yield async_and_or_test.testEvaluation(dart.fn(() => dart.async(function*(
) { |
| 59 expect$.Expect.isFalse(dart.test(yield async_and_or_test.confuse(async_a
nd_or_test.traceA(false))) && dart.test(yield async_and_or_test.confuse(async_an
d_or_test.traceB(false)))); |
| 60 expect$.Expect.equals("a", async_and_or_test.trace); |
| 61 }, dart.void), VoidToFutureOfvoid())); |
| 62 yield async_and_or_test.testEvaluation(dart.fn(() => dart.async(function*(
) { |
| 63 expect$.Expect.isFalse(dart.test(yield async_and_or_test.confuse(async_a
nd_or_test.traceA(false))) && dart.test(yield async_and_or_test.confuse(async_an
d_or_test.traceB(true)))); |
| 64 expect$.Expect.equals("a", async_and_or_test.trace); |
| 65 }, dart.void), VoidToFutureOfvoid())); |
| 66 yield async_and_or_test.testEvaluation(dart.fn(() => dart.async(function*(
) { |
| 67 expect$.Expect.isFalse(dart.test(yield async_and_or_test.confuse(async_a
nd_or_test.traceA(true))) && dart.test(yield async_and_or_test.confuse(async_and
_or_test.traceB(false)))); |
| 68 expect$.Expect.equals("ab", async_and_or_test.trace); |
| 69 }, dart.void), VoidToFutureOfvoid())); |
| 70 yield async_and_or_test.testEvaluation(dart.fn(() => dart.async(function*(
) { |
| 71 expect$.Expect.isTrue(dart.test(yield async_and_or_test.confuse(async_an
d_or_test.traceA(true))) && dart.test(yield async_and_or_test.confuse(async_and_
or_test.traceB(true)))); |
| 72 expect$.Expect.equals("ab", async_and_or_test.trace); |
| 73 }, dart.void), VoidToFutureOfvoid())); |
| 74 yield async_and_or_test.testEvaluation(dart.fn(() => dart.async(function*(
) { |
| 75 expect$.Expect.isFalse(dart.test(yield async_and_or_test.confuse(async_a
nd_or_test.traceA(false))) || dart.test(yield async_and_or_test.confuse(async_an
d_or_test.traceB(false)))); |
| 76 expect$.Expect.equals("ab", async_and_or_test.trace); |
| 77 }, dart.void), VoidToFutureOfvoid())); |
| 78 yield async_and_or_test.testEvaluation(dart.fn(() => dart.async(function*(
) { |
| 79 expect$.Expect.isTrue(dart.test(yield async_and_or_test.confuse(async_an
d_or_test.traceA(false))) || dart.test(yield async_and_or_test.confuse(async_and
_or_test.traceB(true)))); |
| 80 expect$.Expect.equals("ab", async_and_or_test.trace); |
| 81 }, dart.void), VoidToFutureOfvoid())); |
| 82 yield async_and_or_test.testEvaluation(dart.fn(() => dart.async(function*(
) { |
| 83 expect$.Expect.isTrue(dart.test(yield async_and_or_test.confuse(async_an
d_or_test.traceA(true))) || dart.test(yield async_and_or_test.confuse(async_and_
or_test.traceB(false)))); |
| 84 expect$.Expect.equals("a", async_and_or_test.trace); |
| 85 }, dart.void), VoidToFutureOfvoid())); |
| 86 yield async_and_or_test.testEvaluation(dart.fn(() => dart.async(function*(
) { |
| 87 expect$.Expect.isTrue(dart.test(yield async_and_or_test.confuse(async_an
d_or_test.traceA(true))) || dart.test(yield async_and_or_test.confuse(async_and_
or_test.traceB(true)))); |
| 88 expect$.Expect.equals("a", async_and_or_test.trace); |
| 89 }, dart.void), VoidToFutureOfvoid())); |
| 90 }, dart.dynamic); |
| 91 }; |
| 92 dart.fn(async_and_or_test.test2, VoidTodynamic()); |
| 93 async_and_or_test.test = function() { |
| 94 return dart.async(function*() { |
| 95 yield async_and_or_test.test1(); |
| 96 yield async_and_or_test.test2(); |
| 97 }, dart.dynamic); |
| 98 }; |
| 99 dart.fn(async_and_or_test.test, VoidTodynamic()); |
| 100 async_and_or_test.main = function() { |
| 101 async_helper$.asyncStart(); |
| 102 dart.dsend(async_and_or_test.test(), 'then', dart.fn(_ => async_helper$.asyn
cEnd(), dynamicTovoid())); |
| 103 }; |
| 104 dart.fn(async_and_or_test.main, VoidTodynamic()); |
| 105 // Exports: |
| 106 exports.async_and_or_test = async_and_or_test; |
| 107 }); |
OLD | NEW |