OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/cast_test_12_multi', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__cast_test_12_multi(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const _interceptors = dart_sdk._interceptors; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const expect$ = expect.expect; |
| 11 const cast_test_12_multi = Object.create(null); |
| 12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); |
| 13 let ListOfint = () => (ListOfint = dart.constFn(core.List$(core.int)))(); |
| 14 let VoidToObject = () => (VoidToObject = dart.constFn(dart.definiteFunctionTyp
e(core.Object, [])))(); |
| 15 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 16 cast_test_12_multi.C = class C extends core.Object { |
| 17 new() { |
| 18 this.foo = 42; |
| 19 } |
| 20 }; |
| 21 cast_test_12_multi.D = class D extends cast_test_12_multi.C { |
| 22 new() { |
| 23 this.bar = 37; |
| 24 super.new(); |
| 25 } |
| 26 }; |
| 27 cast_test_12_multi.createC = function() { |
| 28 return new cast_test_12_multi.C(); |
| 29 }; |
| 30 dart.fn(cast_test_12_multi.createC, VoidToObject()); |
| 31 cast_test_12_multi.createD = function() { |
| 32 return new cast_test_12_multi.D(); |
| 33 }; |
| 34 dart.fn(cast_test_12_multi.createD, VoidToObject()); |
| 35 cast_test_12_multi.getNull = function() { |
| 36 return null; |
| 37 }; |
| 38 dart.fn(cast_test_12_multi.getNull, VoidToObject()); |
| 39 cast_test_12_multi.createList = function() { |
| 40 return JSArrayOfint().of([2]); |
| 41 }; |
| 42 dart.fn(cast_test_12_multi.createList, VoidToObject()); |
| 43 cast_test_12_multi.createInt = function() { |
| 44 return 87; |
| 45 }; |
| 46 dart.fn(cast_test_12_multi.createInt, VoidToObject()); |
| 47 cast_test_12_multi.createString = function() { |
| 48 return "a string"; |
| 49 }; |
| 50 dart.fn(cast_test_12_multi.createString, VoidToObject()); |
| 51 cast_test_12_multi.main = function() { |
| 52 let oc = cast_test_12_multi.createC(); |
| 53 let od = cast_test_12_multi.createD(); |
| 54 let on = cast_test_12_multi.getNull(); |
| 55 let ol = cast_test_12_multi.createList(); |
| 56 let oi = cast_test_12_multi.createInt(); |
| 57 let os = cast_test_12_multi.createString(); |
| 58 expect$.Expect.equals(42, cast_test_12_multi.C.as(oc).foo); |
| 59 expect$.Expect.equals(42, cast_test_12_multi.C.as(od).foo); |
| 60 expect$.Expect.equals(42, cast_test_12_multi.D.as(od).foo); |
| 61 expect$.Expect.equals(37, cast_test_12_multi.D.as(od).bar); |
| 62 expect$.Expect.equals(37, cast_test_12_multi.D.as(cast_test_12_multi.C.as(od
)).bar); |
| 63 dart.toString(cast_test_12_multi.D.as(on)); |
| 64 dart.toString(on); |
| 65 dart.toString(oc); |
| 66 dart.toString(od); |
| 67 dart.toString(on); |
| 68 dart.dload(oc, 'foo'); |
| 69 dart.dload(od, 'foo'); |
| 70 dart.dload(od, 'bar'); |
| 71 let c = cast_test_12_multi.C.as(oc); |
| 72 c = cast_test_12_multi.C.as(od); |
| 73 c = cast_test_12_multi.C._check(oc); |
| 74 let d = cast_test_12_multi.D.as(od); |
| 75 d = cast_test_12_multi.D._check(od); |
| 76 core.List.as(ol)[dartx.get](0); |
| 77 ListOfint().as(ol)[dartx.get](0); |
| 78 dart.dindex(ol, 0); |
| 79 core.String.as(ol)[dartx.length]; |
| 80 let x = ListOfint().as(ol)[dartx.get](0); |
| 81 ListOfint().as(ol)[dartx.set](0, core.int.as(oi)); |
| 82 core.String.as(os)[dartx.length]; |
| 83 dart.dload(os, 'length'); |
| 84 dart.notNull(core.int.as(oi)) + 2; |
| 85 }; |
| 86 dart.fn(cast_test_12_multi.main, VoidTodynamic()); |
| 87 // Exports: |
| 88 exports.cast_test_12_multi = cast_test_12_multi; |
| 89 }); |
OLD | NEW |