OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/enum_mirror_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__enum_mirror_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const mirrors = dart_sdk.mirrors; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const expect$ = expect.expect; |
| 11 const enum_mirror_test = Object.create(null); |
| 12 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 13 enum_mirror_test.Foo = class Foo extends core.Object { |
| 14 new(index) { |
| 15 this.index = index; |
| 16 } |
| 17 toString() { |
| 18 return { |
| 19 0: "Foo.BAR", |
| 20 1: "Foo.BAZ" |
| 21 }[this.index]; |
| 22 } |
| 23 }; |
| 24 enum_mirror_test.Foo.BAR = dart.const(new enum_mirror_test.Foo(0)); |
| 25 enum_mirror_test.Foo.BAZ = dart.const(new enum_mirror_test.Foo(1)); |
| 26 enum_mirror_test.Foo.values = dart.constList([enum_mirror_test.Foo.BAR, enum_m
irror_test.Foo.BAZ], enum_mirror_test.Foo); |
| 27 let const$; |
| 28 enum_mirror_test.main = function() { |
| 29 expect$.Expect.equals('Foo.BAR', enum_mirror_test.Foo.BAR.toString()); |
| 30 let name = mirrors.reflect(enum_mirror_test.Foo.BAR).invoke(const$ || (const
$ = dart.const(core.Symbol.new('toString'))), []).reflectee; |
| 31 expect$.Expect.equals('Foo.BAR', name); |
| 32 }; |
| 33 dart.fn(enum_mirror_test.main, VoidTodynamic()); |
| 34 // Exports: |
| 35 exports.enum_mirror_test = enum_mirror_test; |
| 36 }); |
OLD | NEW |