OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // Test file for testing source mappings of invocations. |
| 6 |
| 7 var counter = 0; |
| 8 var bucket; |
| 9 |
| 10 main(args) { |
| 11 counter++; |
| 12 invokes(args); |
| 13 return counter; |
| 14 } |
| 15 |
| 16 invokes(parameter) { |
| 17 counter++; |
| 18 toplevelFunction(); |
| 19 toplevelField(); |
| 20 toplevelFinalField(); |
| 21 toplevelConstField(); |
| 22 toplevelGetter(); |
| 23 C.staticFunction(); |
| 24 C.staticField(); |
| 25 C.staticFinalField(); |
| 26 C.staticConstField(); |
| 27 C.staticGetter(); |
| 28 |
| 29 var localVariable = () { |
| 30 counter++; |
| 31 }; |
| 32 localFunction() { |
| 33 counter++; |
| 34 } |
| 35 |
| 36 parameter(); |
| 37 localVariable(); |
| 38 localFunction(); |
| 39 |
| 40 parameter.dynamicInvoke(); |
| 41 new C(parameter).instanceInvokes(); |
| 42 } |
| 43 |
| 44 toplevelFunction() { |
| 45 counter++; |
| 46 } |
| 47 |
| 48 var toplevelField = () { |
| 49 counter++; |
| 50 }; |
| 51 |
| 52 final toplevelFinalField = toplevelFunction; |
| 53 |
| 54 const toplevelConstField = toplevelFunction; |
| 55 |
| 56 get toplevelGetter => () { |
| 57 counter++; |
| 58 }; |
| 59 |
| 60 typedef F(); |
| 61 |
| 62 class B { |
| 63 B(parameter); |
| 64 |
| 65 superMethod() { |
| 66 counter++; |
| 67 } |
| 68 |
| 69 var superField = () { |
| 70 counter++; |
| 71 }; |
| 72 |
| 73 get superGetter => () { |
| 74 counter++; |
| 75 }; |
| 76 |
| 77 } |
| 78 |
| 79 class C<T> extends B { |
| 80 C(parameter) : super(parameter); |
| 81 |
| 82 static staticFunction() { |
| 83 counter++; |
| 84 } |
| 85 |
| 86 static var staticField = () { |
| 87 counter++; |
| 88 }; |
| 89 |
| 90 static final staticFinalField = staticFunction; |
| 91 |
| 92 static const staticConstField = staticFunction; |
| 93 |
| 94 static get staticGetter => () { |
| 95 counter++; |
| 96 }; |
| 97 |
| 98 instanceMethod() { |
| 99 counter++; |
| 100 } |
| 101 |
| 102 var instanceField = () { |
| 103 counter++; |
| 104 }; |
| 105 |
| 106 get instanceGetter => () { |
| 107 counter++; |
| 108 }; |
| 109 |
| 110 instanceInvokes() { |
| 111 instanceMethod(); |
| 112 this.instanceMethod(); |
| 113 instanceField(); |
| 114 this.instanceField(); |
| 115 instanceGetter(); |
| 116 this.instanceGetter(); |
| 117 |
| 118 super.superMethod(); |
| 119 super.superField(); |
| 120 super.superGetter(); |
| 121 |
| 122 C(); |
| 123 dynamic(); |
| 124 F(); |
| 125 T(); |
| 126 } |
| 127 } |
OLD | NEW |