OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/condition_bailout_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__condition_bailout_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 condition_bailout_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 condition_bailout_test.A = class A extends core.Object { |
| 13 ['unary-']() { |
| 14 return this; |
| 15 } |
| 16 foo(x) { |
| 17 dart.dsend(condition_bailout_test.a, 'unary-'); |
| 18 if (dart.test(x)) return true; |
| 19 return false; |
| 20 } |
| 21 loop1(x) { |
| 22 dart.dsend(condition_bailout_test.a, 'unary-'); |
| 23 while (dart.test(x)) |
| 24 return true; |
| 25 return false; |
| 26 } |
| 27 loop2(x) { |
| 28 dart.dsend(condition_bailout_test.a, 'unary-'); |
| 29 for (; dart.test(x);) |
| 30 return true; |
| 31 return false; |
| 32 } |
| 33 loop3(x) { |
| 34 dart.dsend(condition_bailout_test.a, 'unary-'); |
| 35 let i = 0; |
| 36 do { |
| 37 if (i++ == 1) return false; |
| 38 } while (!dart.test(x)); |
| 39 return true; |
| 40 } |
| 41 }; |
| 42 dart.setSignature(condition_bailout_test.A, { |
| 43 methods: () => ({ |
| 44 'unary-': dart.definiteFunctionType(dart.dynamic, []), |
| 45 foo: dart.definiteFunctionType(dart.dynamic, [dart.dynamic]), |
| 46 loop1: dart.definiteFunctionType(dart.dynamic, [dart.dynamic]), |
| 47 loop2: dart.definiteFunctionType(dart.dynamic, [dart.dynamic]), |
| 48 loop3: dart.definiteFunctionType(dart.dynamic, [dart.dynamic]) |
| 49 }) |
| 50 }); |
| 51 condition_bailout_test.a = null; |
| 52 condition_bailout_test.main = function() { |
| 53 condition_bailout_test.a = new condition_bailout_test.A(); |
| 54 expect$.Expect.isTrue(dart.dsend(condition_bailout_test.a, 'foo', true)); |
| 55 expect$.Expect.isTrue(dart.dsend(condition_bailout_test.a, 'loop1', true)); |
| 56 expect$.Expect.isTrue(dart.dsend(condition_bailout_test.a, 'loop2', true)); |
| 57 expect$.Expect.isTrue(dart.dsend(condition_bailout_test.a, 'loop3', true)); |
| 58 }; |
| 59 dart.fn(condition_bailout_test.main, VoidTodynamic()); |
| 60 // Exports: |
| 61 exports.condition_bailout_test = condition_bailout_test; |
| 62 }); |
OLD | NEW |