Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.semantics_visitor; | 5 library dart2js.semantics_visitor; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../tree/tree.dart'; | 10 import '../tree/tree.dart'; |
| (...skipping 3163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3174 /// m(rhs) => dynamic += rhs; | 3174 /// m(rhs) => dynamic += rhs; |
| 3175 /// | 3175 /// |
| 3176 R visitDynamicTypeLiteralCompound( | 3176 R visitDynamicTypeLiteralCompound( |
| 3177 Send node, | 3177 Send node, |
| 3178 ConstantExpression constant, | 3178 ConstantExpression constant, |
| 3179 AssignmentOperator operator, | 3179 AssignmentOperator operator, |
| 3180 Node rhs, | 3180 Node rhs, |
| 3181 A arg); | 3181 A arg); |
| 3182 | 3182 |
| 3183 /// Compound index assignment of [rhs] with [operator] to [index] on the | 3183 /// Compound index assignment of [rhs] with [operator] to [index] on the |
| 3184 /// index operators of [receiver] whose getter and setter are defined by | 3184 /// index operators of [receiver]. |
| 3185 /// [getterSelector] and [setterSelector], respectively. | |
| 3186 /// | 3185 /// |
| 3187 /// For instance: | 3186 /// For instance: |
| 3188 /// | 3187 /// |
| 3189 /// m(receiver, index, rhs) => receiver[index] += rhs; | 3188 /// m(receiver, index, rhs) => receiver[index] += rhs; |
| 3190 /// | 3189 /// |
| 3191 R visitCompoundIndexSet( | 3190 R visitCompoundIndexSet( |
| 3192 SendSet node, | 3191 SendSet node, |
| 3193 Node receiver, | 3192 Node receiver, |
| 3194 Node index, | 3193 Node index, |
| 3195 AssignmentOperator operator, | 3194 AssignmentOperator operator, |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 3212 R visitSuperCompoundIndexSet( | 3211 R visitSuperCompoundIndexSet( |
| 3213 SendSet node, | 3212 SendSet node, |
| 3214 MethodElement getter, | 3213 MethodElement getter, |
| 3215 MethodElement setter, | 3214 MethodElement setter, |
| 3216 Node index, | 3215 Node index, |
| 3217 AssignmentOperator operator, | 3216 AssignmentOperator operator, |
| 3218 Node rhs, | 3217 Node rhs, |
| 3219 A arg); | 3218 A arg); |
| 3220 | 3219 |
| 3221 /// Compound index assignment of [rhs] with [operator] to [index] on a super | 3220 /// Compound index assignment of [rhs] with [operator] to [index] on a super |
| 3222 /// super class where the index getter is undefined and the index setter is | 3221 /// class where the index getter is undefined and the index setter is defined |
| 3223 /// defined by [setter]. | 3222 /// by [setter]. |
| 3224 /// | 3223 /// |
| 3225 /// For instance: | 3224 /// For instance: |
| 3226 /// | 3225 /// |
| 3227 /// class B { | 3226 /// class B { |
| 3228 /// } | 3227 /// } |
| 3229 /// class C extends B { | 3228 /// class C extends B { |
| 3230 /// m() => super[1] += 42; | 3229 /// m() => super[1] += 42; |
| 3231 /// } | 3230 /// } |
| 3232 /// | 3231 /// |
| 3233 R visitUnresolvedSuperGetterCompoundIndexSet( | 3232 R visitUnresolvedSuperGetterCompoundIndexSet( |
| 3234 Send node, | 3233 Send node, |
| 3235 Element element, | 3234 Element element, |
| 3236 MethodElement setter, | 3235 MethodElement setter, |
| 3237 Node index, | 3236 Node index, |
| 3238 AssignmentOperator operator, | 3237 AssignmentOperator operator, |
| 3239 Node rhs, | 3238 Node rhs, |
| 3240 A arg); | 3239 A arg); |
| 3241 | 3240 |
| 3242 /// Compound index assignment of [rhs] with [operator] to [index] on a super | 3241 /// Compound index assignment of [rhs] with [operator] to [index] on a super |
| 3243 /// super class where the index getter is defined by [getter] but the index | 3242 /// class where the index getter is defined by [getter] but the index setter |
| 3244 /// setter is undefined. | 3243 /// is undefined. |
| 3245 /// | 3244 /// |
| 3246 /// For instance: | 3245 /// For instance: |
| 3247 /// | 3246 /// |
| 3248 /// class B { | 3247 /// class B { |
| 3249 /// operator [](index) => 42; | 3248 /// operator [](index) => 42; |
| 3250 /// } | 3249 /// } |
| 3251 /// class C extends B { | 3250 /// class C extends B { |
| 3252 /// m() => super[1] += 42; | 3251 /// m() => super[1] += 42; |
| 3253 /// } | 3252 /// } |
| 3254 /// | 3253 /// |
| 3255 R visitUnresolvedSuperSetterCompoundIndexSet( | 3254 R visitUnresolvedSuperSetterCompoundIndexSet( |
| 3256 Send node, | 3255 Send node, |
| 3257 MethodElement getter, | 3256 MethodElement getter, |
| 3258 Element element, | 3257 Element element, |
| 3259 Node index, | 3258 Node index, |
| 3260 AssignmentOperator operator, | 3259 AssignmentOperator operator, |
| 3261 Node rhs, | 3260 Node rhs, |
| 3262 A arg); | 3261 A arg); |
| 3263 | 3262 |
| 3264 /// Compound index assignment of [rhs] with [operator] to [index] on a super | 3263 /// Compound index assignment of [rhs] with [operator] to [index] on a super |
| 3265 /// super class where the index getter and setter are undefined. | 3264 /// class where the index getter and setter are undefined. |
| 3266 /// | 3265 /// |
| 3267 /// For instance: | 3266 /// For instance: |
| 3268 /// | 3267 /// |
| 3269 /// class B { | 3268 /// class B { |
| 3270 /// } | 3269 /// } |
| 3271 /// class C extends B { | 3270 /// class C extends B { |
| 3272 /// m() => super[1] += 42; | 3271 /// m() => super[1] += 42; |
| 3273 /// } | 3272 /// } |
| 3274 /// | 3273 /// |
| 3275 R visitUnresolvedSuperCompoundIndexSet( | 3274 R visitUnresolvedSuperCompoundIndexSet( |
| 3276 Send node, | 3275 Send node, |
| 3277 Element element, | 3276 Element element, |
| 3278 Node index, | 3277 Node index, |
| 3279 AssignmentOperator operator, | 3278 AssignmentOperator operator, |
| 3280 Node rhs, | 3279 Node rhs, |
| 3281 A arg); | 3280 A arg); |
| 3282 | 3281 |
| 3282 /// If-null assignment expression of [rhs] to [index] on the index operators | |
| 3283 /// of [receiver]. | |
| 3284 /// | |
| 3285 /// For instance: | |
| 3286 /// | |
| 3287 /// m(receiver, index, rhs) => receiver[index] ??= rhs; | |
| 3288 /// | |
| 3289 R visitIndexSetIfNull( | |
| 3290 SendSet node, | |
| 3291 Node receiver, | |
| 3292 Node index, | |
| 3293 Node rhs, | |
| 3294 A arg); | |
| 3295 | |
| 3296 /// If-null assignment expression of [rhs] to [index] on the index operators | |
| 3297 /// of a super class defined by [getter] and [setter]. | |
| 3298 /// | |
| 3299 /// For instance: | |
| 3300 /// | |
| 3301 /// class B { | |
| 3302 /// operator [](index) {} | |
| 3303 /// operator [](index, value) {} | |
| 3304 /// } | |
| 3305 /// class C extends B { | |
| 3306 /// m(index, rhs) => super[index] ??= rhs; | |
| 3307 /// } | |
| 3308 /// | |
| 3309 R visitSuperIndexSetIfNull( | |
| 3310 SendSet node, | |
| 3311 MethodElement getter, | |
| 3312 MethodElement setter, | |
| 3313 Node index, | |
| 3314 Node rhs, | |
| 3315 A arg); | |
| 3316 | |
| 3317 /// If-null assignment expression of [rhs] to [index] on a super class where | |
| 3318 /// the index getter is undefined and the index setter is defined by [setter]. | |
| 3319 /// | |
| 3320 /// For instance: | |
| 3321 /// | |
| 3322 /// class B { | |
|
Siggi Cherem (dart-lang)
2016/03/31 16:42:19
add operator[]=(index)? (otherwise the example is
Johnni Winther
2016/04/01 07:32:58
Done.
| |
| 3323 /// } | |
| 3324 /// class C extends B { | |
| 3325 /// m() => super[1] ??= 42; | |
| 3326 /// } | |
| 3327 /// | |
| 3328 R visitUnresolvedSuperGetterIndexSetIfNull( | |
| 3329 Send node, | |
| 3330 Element element, | |
| 3331 MethodElement setter, | |
| 3332 Node index, | |
| 3333 Node rhs, | |
| 3334 A arg); | |
| 3335 | |
| 3336 /// If-null assignment expression of [rhs] to [index] on a super class where | |
| 3337 /// the index getter is defined by [getter] but the index setter is undefined. | |
| 3338 /// | |
| 3339 /// For instance: | |
| 3340 /// | |
| 3341 /// class B { | |
| 3342 /// operator [](index) => 42; | |
| 3343 /// } | |
| 3344 /// class C extends B { | |
| 3345 /// m() => super[1] += 42; | |
|
Siggi Cherem (dart-lang)
2016/03/31 16:42:19
s/+=/??=/
Johnni Winther
2016/04/01 07:32:58
Done.
| |
| 3346 /// } | |
| 3347 /// | |
| 3348 R visitUnresolvedSuperSetterIndexSetIfNull( | |
| 3349 Send node, | |
| 3350 MethodElement getter, | |
| 3351 Element element, | |
| 3352 Node index, | |
| 3353 Node rhs, | |
| 3354 A arg); | |
| 3355 | |
| 3356 /// If-null assignment expression of [rhs] to [index] on a super class where | |
| 3357 /// the index getter and setter are undefined. | |
| 3358 /// | |
| 3359 /// For instance: | |
| 3360 /// | |
| 3361 /// class B { | |
| 3362 /// } | |
| 3363 /// class C extends B { | |
| 3364 /// m() => super[1] ??= 42; | |
| 3365 /// } | |
| 3366 /// | |
| 3367 R visitUnresolvedSuperIndexSetIfNull( | |
| 3368 Send node, | |
| 3369 Element element, | |
| 3370 Node index, | |
| 3371 Node rhs, | |
| 3372 A arg); | |
| 3373 | |
| 3283 /// Prefix expression with [operator] of the property on [receiver] whose | 3374 /// Prefix expression with [operator] of the property on [receiver] whose |
| 3284 /// getter and setter are defined by [getterSelector] and [setterSelector], | 3375 /// getter and setter are defined by [getterSelector] and [setterSelector], |
| 3285 /// respectively. | 3376 /// respectively. |
| 3286 /// | 3377 /// |
| 3287 /// For instance: | 3378 /// For instance: |
| 3288 /// | 3379 /// |
| 3289 /// m(receiver) => ++receiver.foo; | 3380 /// m(receiver) => ++receiver.foo; |
| 3290 /// | 3381 /// |
| 3291 R visitDynamicPropertyPrefix( | 3382 R visitDynamicPropertyPrefix( |
| 3292 Send node, | 3383 Send node, |
| (...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5080 /// | 5171 /// |
| 5081 /// m() => p += 42; | 5172 /// m() => p += 42; |
| 5082 /// | 5173 /// |
| 5083 R errorInvalidCompound( | 5174 R errorInvalidCompound( |
| 5084 Send node, | 5175 Send node, |
| 5085 ErroneousElement error, | 5176 ErroneousElement error, |
| 5086 AssignmentOperator operator, | 5177 AssignmentOperator operator, |
| 5087 Node rhs, | 5178 Node rhs, |
| 5088 A arg); | 5179 A arg); |
| 5089 | 5180 |
| 5181 /// If-null assignment expression of [rhs] to [index] on the index operators | |
| 5182 /// of an invalid expression. | |
| 5183 /// | |
| 5184 /// For instance: | |
| 5185 /// | |
| 5186 /// import 'foo.dart' as p; | |
| 5187 /// | |
| 5188 /// m(index, rhs) => p[index] ??= rhs; | |
| 5189 /// | |
| 5190 R errorInvalidIndexSetIfNull( | |
| 5191 SendSet node, | |
| 5192 ErroneousElement error, | |
| 5193 Node index, | |
| 5194 Node rhs, | |
| 5195 A arg); | |
| 5196 | |
| 5090 /// Unary operation with [operator] on an invalid expression. | 5197 /// Unary operation with [operator] on an invalid expression. |
| 5091 /// | 5198 /// |
| 5092 /// For instance: | 5199 /// For instance: |
| 5093 /// | 5200 /// |
| 5094 /// class C { | 5201 /// class C { |
| 5095 /// static m() => ~super; | 5202 /// static m() => ~super; |
| 5096 /// } | 5203 /// } |
| 5097 /// | 5204 /// |
| 5098 R errorInvalidUnary( | 5205 R errorInvalidUnary( |
| 5099 Send node, | 5206 Send node, |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5836 /// C() : this._(42); | 5943 /// C() : this._(42); |
| 5837 /// } | 5944 /// } |
| 5838 /// | 5945 /// |
| 5839 R errorUnresolvedThisConstructorInvoke( | 5946 R errorUnresolvedThisConstructorInvoke( |
| 5840 Send node, | 5947 Send node, |
| 5841 Element element, | 5948 Element element, |
| 5842 NodeList arguments, | 5949 NodeList arguments, |
| 5843 Selector selector, | 5950 Selector selector, |
| 5844 A arg); | 5951 A arg); |
| 5845 } | 5952 } |
| OLD | NEW |