OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/rewrite_if_empty_then_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__rewrite_if_empty_then_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 rewrite_if_empty_then_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 13 rewrite_if_empty_then_test.global = 0; |
| 14 rewrite_if_empty_then_test.effect = function() { |
| 15 rewrite_if_empty_then_test.global = 1; |
| 16 }; |
| 17 dart.fn(rewrite_if_empty_then_test.effect, VoidTodynamic()); |
| 18 rewrite_if_empty_then_test.baz = function(b) { |
| 19 return b; |
| 20 }; |
| 21 dart.fn(rewrite_if_empty_then_test.baz, dynamicTodynamic()); |
| 22 rewrite_if_empty_then_test.foo = function(b) { |
| 23 if (dart.test(b)) { |
| 24 } else { |
| 25 rewrite_if_empty_then_test.effect(); |
| 26 } |
| 27 return rewrite_if_empty_then_test.baz(b); |
| 28 }; |
| 29 dart.fn(rewrite_if_empty_then_test.foo, dynamicTodynamic()); |
| 30 rewrite_if_empty_then_test.foo2 = function(b) { |
| 31 if (dart.test(b)) { |
| 32 } else { |
| 33 rewrite_if_empty_then_test.effect(); |
| 34 } |
| 35 }; |
| 36 dart.fn(rewrite_if_empty_then_test.foo2, dynamicTodynamic()); |
| 37 rewrite_if_empty_then_test.main = function() { |
| 38 rewrite_if_empty_then_test.global = 0; |
| 39 expect$.Expect.equals(true, rewrite_if_empty_then_test.foo(true)); |
| 40 expect$.Expect.equals(0, rewrite_if_empty_then_test.global); |
| 41 rewrite_if_empty_then_test.global = 0; |
| 42 expect$.Expect.equals(false, rewrite_if_empty_then_test.foo(false)); |
| 43 expect$.Expect.equals(1, rewrite_if_empty_then_test.global); |
| 44 rewrite_if_empty_then_test.global = 0; |
| 45 rewrite_if_empty_then_test.foo2(true); |
| 46 expect$.Expect.equals(0, rewrite_if_empty_then_test.global); |
| 47 rewrite_if_empty_then_test.global = 0; |
| 48 rewrite_if_empty_then_test.foo2(false); |
| 49 expect$.Expect.equals(1, rewrite_if_empty_then_test.global); |
| 50 }; |
| 51 dart.fn(rewrite_if_empty_then_test.main, VoidTodynamic()); |
| 52 // Exports: |
| 53 exports.rewrite_if_empty_then_test = rewrite_if_empty_then_test; |
| 54 }); |
OLD | NEW |