OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/static_const_field_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__static_const_field_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 static_const_field_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 static_const_field_test.Spain = class Spain extends core.Object {}; |
| 13 static_const_field_test.Spain.AG = "Antoni Gaudi"; |
| 14 static_const_field_test.Spain.SD = "Salvador Dali"; |
| 15 static_const_field_test.Switzerland = class Switzerland extends core.Object {}
; |
| 16 static_const_field_test.Switzerland.AG = "Alberto Giacometti"; |
| 17 static_const_field_test.Switzerland.LC = "Le Corbusier"; |
| 18 static_const_field_test.A = class A extends core.Object { |
| 19 new() { |
| 20 this.n = 5; |
| 21 } |
| 22 }; |
| 23 static_const_field_test.A[dart.implements] = () => [static_const_field_test.Sw
itzerland]; |
| 24 dart.setSignature(static_const_field_test.A, { |
| 25 constructors: () => ({new: dart.definiteFunctionType(static_const_field_test
.A, [])}) |
| 26 }); |
| 27 static_const_field_test.A.b = 3 + 5; |
| 28 static_const_field_test.A.s1 = "hula"; |
| 29 static_const_field_test.A.s2 = "hula"; |
| 30 static_const_field_test.A.s3 = "hop"; |
| 31 static_const_field_test.A.d1 = 1.1; |
| 32 static_const_field_test.A.d2 = 0.55 + 0.55; |
| 33 static_const_field_test.A.artist2 = static_const_field_test.Switzerland.AG; |
| 34 static_const_field_test.A.architect1 = static_const_field_test.Spain.AG; |
| 35 static_const_field_test.A.array1 = dart.constList([1, 2], core.int); |
| 36 static_const_field_test.A.map1 = dart.const(dart.map({Monday: 1, Tuesday: 2}))
; |
| 37 dart.defineLazy(static_const_field_test.A, { |
| 38 get a() { |
| 39 return dart.const(new static_const_field_test.A()); |
| 40 }, |
| 41 get c() { |
| 42 return static_const_field_test.A.b + 7; |
| 43 }, |
| 44 get d() { |
| 45 return dart.const(new static_const_field_test.A()); |
| 46 } |
| 47 }); |
| 48 static_const_field_test.StaticFinalFieldTest = class StaticFinalFieldTest exte
nds core.Object { |
| 49 static testMain() { |
| 50 expect$.Expect.equals(15, static_const_field_test.A.c); |
| 51 expect$.Expect.equals(8, static_const_field_test.A.b); |
| 52 expect$.Expect.equals(5, static_const_field_test.A.a.n); |
| 53 expect$.Expect.equals(true, core.identical(8, static_const_field_test.A.b)
); |
| 54 expect$.Expect.equals(true, core.identical(static_const_field_test.A.a, st
atic_const_field_test.A.d)); |
| 55 expect$.Expect.equals(true, core.identical(static_const_field_test.A.s1, s
tatic_const_field_test.A.s2)); |
| 56 expect$.Expect.equals(false, core.identical(static_const_field_test.A.s1,
static_const_field_test.A.s3)); |
| 57 expect$.Expect.equals(false, core.identical(static_const_field_test.A.s1,
static_const_field_test.A.b)); |
| 58 expect$.Expect.equals(true, core.identical(static_const_field_test.A.d1, s
tatic_const_field_test.A.d2)); |
| 59 expect$.Expect.equals(true, static_const_field_test.Spain.SD == "Salvador
Dali"); |
| 60 expect$.Expect.equals(true, static_const_field_test.A.artist2 == "Alberto
Giacometti"); |
| 61 expect$.Expect.equals(true, static_const_field_test.A.architect1 == "Anton
i Gaudi"); |
| 62 expect$.Expect.equals(2, static_const_field_test.A.map1[dartx.get]("Tuesda
y")); |
| 63 } |
| 64 }; |
| 65 dart.setSignature(static_const_field_test.StaticFinalFieldTest, { |
| 66 statics: () => ({testMain: dart.definiteFunctionType(dart.dynamic, [])}), |
| 67 names: ['testMain'] |
| 68 }); |
| 69 static_const_field_test.main = function() { |
| 70 static_const_field_test.StaticFinalFieldTest.testMain(); |
| 71 }; |
| 72 dart.fn(static_const_field_test.main, VoidTodynamic()); |
| 73 // Exports: |
| 74 exports.static_const_field_test = static_const_field_test; |
| 75 }); |
OLD | NEW |