OLD | NEW |
1 dart_library.library('language/range_analysis2_test', null, /* Imports */[ | 1 dart_library.library('language/range_analysis2_test', null, /* Imports */[ |
2 'dart_sdk', | 2 'dart_sdk', |
3 'expect' | 3 'expect' |
4 ], function load__range_analysis2_test(exports, dart_sdk, expect) { | 4 ], function load__range_analysis2_test(exports, dart_sdk, expect) { |
5 'use strict'; | 5 'use strict'; |
6 const core = dart_sdk.core; | 6 const core = dart_sdk.core; |
7 const _interceptors = dart_sdk._interceptors; | 7 const _interceptors = dart_sdk._interceptors; |
8 const dart = dart_sdk.dart; | 8 const dart = dart_sdk.dart; |
9 const dartx = dart_sdk.dartx; | 9 const dartx = dart_sdk.dartx; |
10 const expect$ = expect.expect; | 10 const expect$ = expect.expect; |
11 const range_analysis2_test = Object.create(null); | 11 const range_analysis2_test = Object.create(null); |
12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); | 12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); |
| 13 let VoidToint = () => (VoidToint = dart.constFn(dart.definiteFunctionType(core
.int, [])))(); |
| 14 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); | 15 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
14 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); | |
15 range_analysis2_test.main = function() { | 16 range_analysis2_test.main = function() { |
16 let a = 0; | 17 let a = 0; |
17 let b = JSArrayOfint().of([1]); | 18 let b = JSArrayOfint().of([1]); |
18 function foo() { | 19 function foo() { |
19 return dart.notNull(b[dartx.get](a--)) + dart.notNull(b[dartx.get](a)); | 20 return dart.notNull(b[dartx.get](a--)) + dart.notNull(b[dartx.get](a)); |
20 } | 21 } |
21 dart.fn(foo, VoidTodynamic()); | 22 dart.fn(foo, VoidToint()); |
22 expect$.Expect.throws(foo, dart.fn(e => core.RangeError.is(e), dynamicTobool
())); | 23 expect$.Expect.throws(foo, dart.fn(e => core.RangeError.is(e), dynamicTobool
())); |
23 }; | 24 }; |
24 dart.fn(range_analysis2_test.main, VoidTodynamic()); | 25 dart.fn(range_analysis2_test.main, VoidTodynamic()); |
25 // Exports: | 26 // Exports: |
26 exports.range_analysis2_test = range_analysis2_test; | 27 exports.range_analysis2_test = range_analysis2_test; |
27 }); | 28 }); |
OLD | NEW |