OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/top_level_in_initializer_test', null, /* Imports
*/[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__top_level_in_initializer_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 top_level_in_initializer_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 top_level_in_initializer_test.topLevelField = 1; |
| 13 top_level_in_initializer_test.topLevelMethod = function() { |
| 14 return 1; |
| 15 }; |
| 16 dart.fn(top_level_in_initializer_test.topLevelMethod, VoidTodynamic()); |
| 17 dart.copyProperties(top_level_in_initializer_test, { |
| 18 get topLevelGetter() { |
| 19 return 1; |
| 20 } |
| 21 }); |
| 22 top_level_in_initializer_test.Foo = class Foo extends core.Object { |
| 23 one() { |
| 24 this.x = top_level_in_initializer_test.topLevelField; |
| 25 } |
| 26 second() { |
| 27 this.x = top_level_in_initializer_test.topLevelMethod; |
| 28 } |
| 29 third() { |
| 30 this.x = top_level_in_initializer_test.topLevelGetter; |
| 31 } |
| 32 }; |
| 33 dart.defineNamedConstructor(top_level_in_initializer_test.Foo, 'one'); |
| 34 dart.defineNamedConstructor(top_level_in_initializer_test.Foo, 'second'); |
| 35 dart.defineNamedConstructor(top_level_in_initializer_test.Foo, 'third'); |
| 36 dart.setSignature(top_level_in_initializer_test.Foo, { |
| 37 constructors: () => ({ |
| 38 one: dart.definiteFunctionType(top_level_in_initializer_test.Foo, []), |
| 39 second: dart.definiteFunctionType(top_level_in_initializer_test.Foo, []), |
| 40 third: dart.definiteFunctionType(top_level_in_initializer_test.Foo, []) |
| 41 }) |
| 42 }); |
| 43 top_level_in_initializer_test.main = function() { |
| 44 expect$.Expect.equals(top_level_in_initializer_test.topLevelField, new top_l
evel_in_initializer_test.Foo.one().x); |
| 45 expect$.Expect.equals(top_level_in_initializer_test.topLevelMethod(), dart.d
send(new top_level_in_initializer_test.Foo.second(), 'x')); |
| 46 expect$.Expect.equals(top_level_in_initializer_test.topLevelGetter, new top_
level_in_initializer_test.Foo.third().x); |
| 47 }; |
| 48 dart.fn(top_level_in_initializer_test.main, VoidTodynamic()); |
| 49 // Exports: |
| 50 exports.top_level_in_initializer_test = top_level_in_initializer_test; |
| 51 }); |
OLD | NEW |