| OLD | NEW |
| 1 var methods = dart.defineLibrary(methods, {}); | 1 var methods = dart.defineLibrary(methods, {}); |
| 2 var core = dart.import(core); | 2 var core = dart.import(core); |
| 3 (function(exports, core) { | 3 (function(exports, core) { |
| 4 'use strict'; | 4 'use strict'; |
| 5 let _c = Symbol('_c'); | 5 let _c = Symbol('_c'); |
| 6 class A extends core.Object { | 6 class A extends core.Object { |
| 7 A() { | 7 A() { |
| 8 this[_c] = 3; | 8 this[_c] = 3; |
| 9 } | 9 } |
| 10 x() { | 10 x() { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 return this.x(); | 35 return this.x(); |
| 36 } | 36 } |
| 37 set b(b) {} | 37 set b(b) {} |
| 38 get c() { | 38 get c() { |
| 39 return this[_c]; | 39 return this[_c]; |
| 40 } | 40 } |
| 41 set c(c) { | 41 set c(c) { |
| 42 this[_c] = c; | 42 this[_c] = c; |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 dart.setSignature(A, { |
| 46 methods: () => ({ |
| 47 x: dart.functionType(core.int, []), |
| 48 y: dart.functionType(core.int, [core.int]), |
| 49 z: dart.functionType(core.int, [], [core.num]), |
| 50 zz: dart.functionType(core.int, [], [core.int]), |
| 51 w: dart.functionType(core.int, [core.int], {b: core.num}), |
| 52 ww: dart.functionType(core.int, [core.int], {b: core.int}) |
| 53 }) |
| 54 }); |
| 45 class Bar extends core.Object { | 55 class Bar extends core.Object { |
| 46 call(x) { | 56 call(x) { |
| 47 return core.print(`hello from ${x}`); | 57 return core.print(`hello from ${x}`); |
| 48 } | 58 } |
| 49 } | 59 } |
| 60 dart.setSignature(Bar, { |
| 61 methods: () => ({call: dart.functionType(dart.dynamic, [dart.dynamic])}) |
| 62 }); |
| 50 class Foo extends core.Object { | 63 class Foo extends core.Object { |
| 51 Foo() { | 64 Foo() { |
| 52 this.bar = new Bar(); | 65 this.bar = new Bar(); |
| 53 } | 66 } |
| 54 } | 67 } |
| 55 // Function test: () → dynamic | 68 dart.setSignature(Foo, {}); |
| 56 function test() { | 69 function test() { |
| 57 let f = new Foo(); | 70 let f = new Foo(); |
| 58 dart.dcall(f.bar, "Bar's call method!"); | 71 dart.dcall(f.bar, "Bar's call method!"); |
| 72 let a = new A(); |
| 73 let g = a.x.bind(a); |
| 74 let aa = new A(); |
| 75 let h = dart.dload(aa, 'x'); |
| 59 } | 76 } |
| 77 dart.fn(test); |
| 60 // Exports: | 78 // Exports: |
| 61 exports.A = A; | 79 exports.A = A; |
| 62 exports.Bar = Bar; | 80 exports.Bar = Bar; |
| 63 exports.Foo = Foo; | 81 exports.Foo = Foo; |
| 64 exports.test = test; | 82 exports.test = test; |
| 65 })(methods, core); | 83 })(methods, core); |
| OLD | NEW |