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 '../constants/expressions.dart'; | 7 import '../constants/expressions.dart'; |
| 8 import '../dart_types.dart'; | 8 import '../dart_types.dart'; |
| 9 import '../diagnostics/spannable.dart' show | 9 import '../diagnostics/spannable.dart' show |
| 10 Spannable, | 10 Spannable, |
| (...skipping 2171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2182 /// m(rhs) => super.field += rhs; | 2182 /// m(rhs) => super.field += rhs; |
| 2183 /// } | 2183 /// } |
| 2184 /// | 2184 /// |
| 2185 R visitFinalSuperFieldCompound( | 2185 R visitFinalSuperFieldCompound( |
| 2186 Send node, | 2186 Send node, |
| 2187 FieldElement field, | 2187 FieldElement field, |
| 2188 AssignmentOperator operator, | 2188 AssignmentOperator operator, |
| 2189 Node rhs, | 2189 Node rhs, |
| 2190 A arg); | 2190 A arg); |
| 2191 | 2191 |
| 2192 /// If-null assignment expression of [rhs] to the [name] property on | |
| 2193 /// [receiver]. That is, evaluation and assignment of [rhs] only if the value | |
|
karlklose
2015/08/26 12:39:22
'That is, [rhs] is only evaluated and assigned, if
Johnni Winther
2015/08/28 08:12:12
Done.
| |
| 2194 /// is of [name] on [receiver] is `null`. | |
| 2195 /// | |
| 2196 /// For instance: | |
| 2197 /// | |
| 2198 /// m(receiver, rhs) => receiver.foo ??= rhs; | |
| 2199 /// | |
| 2200 R visitDynamicPropertySetIfNull( | |
| 2201 Send node, | |
| 2202 Node receiver, | |
| 2203 Name name, | |
| 2204 Node rhs, | |
| 2205 A arg); | |
| 2206 | |
| 2207 /// If-null assignment expression of [rhs] to the [name] property on | |
| 2208 /// [receiver] if not null. That is, evaluation and assignment of [rhs] only | |
| 2209 /// if the value of [receiver] is _not_ `null` and the value is of [name] on | |
| 2210 /// [receiver] is `null`. | |
| 2211 /// | |
| 2212 /// For instance: | |
| 2213 /// | |
| 2214 /// m(receiver, rhs) => receiver?.foo ??= rhs; | |
| 2215 /// | |
| 2216 R visitIfNotNullDynamicPropertySetIfNull( | |
| 2217 Send node, | |
| 2218 Node receiver, | |
| 2219 Name name, | |
| 2220 Node rhs, | |
| 2221 A arg); | |
| 2222 | |
| 2223 /// If-null assignment expression of [rhs] to the [name] property on | |
| 2224 /// `this`. That is, evaluation and assignment of [rhs] only if the value is | |
| 2225 /// of [name] on `this` is `null`. | |
| 2226 /// | |
| 2227 /// For instance: | |
| 2228 /// | |
| 2229 /// class C { | |
| 2230 /// m(rhs) => this.foo ??= rhs; | |
| 2231 /// } | |
| 2232 /// | |
| 2233 /// or | |
| 2234 /// | |
| 2235 /// class C { | |
| 2236 /// m(rhs) => foo ??= rhs; | |
| 2237 /// } | |
| 2238 /// | |
| 2239 R visitThisPropertySetIfNull( | |
| 2240 Send node, | |
| 2241 Name name, | |
| 2242 Node rhs, | |
| 2243 A arg); | |
| 2244 | |
| 2245 /// If-null assignment expression of [rhs] to [parameter]. That is, evaluation | |
| 2246 /// and assignment of [rhs] only if the value is of [parameter] is `null`. | |
| 2247 /// | |
| 2248 /// For instance: | |
| 2249 /// | |
| 2250 /// m(parameter, rhs) => parameter ??= rhs; | |
| 2251 /// | |
| 2252 R visitParameterSetIfNull( | |
| 2253 Send node, | |
| 2254 ParameterElement parameter, | |
| 2255 Node rhs, | |
| 2256 A arg); | |
| 2257 | |
| 2258 /// If-null assignment expression of [rhs] to the final [parameter]. That is, | |
| 2259 /// evaluation and assignment of [rhs] only if the value is of [parameter] is | |
| 2260 /// is `null`. | |
| 2261 /// | |
| 2262 /// For instance: | |
| 2263 /// | |
| 2264 /// m(final parameter, rhs) => parameter ??= rhs; | |
| 2265 /// | |
| 2266 R visitFinalParameterSetIfNull( | |
| 2267 Send node, | |
| 2268 ParameterElement parameter, | |
| 2269 Node rhs, | |
| 2270 A arg); | |
| 2271 | |
| 2272 /// If-null assignment expression of [rhs] to the local [variable]. That is, | |
| 2273 /// evaluation and assignment of [rhs] only if the value is of [variable] is | |
| 2274 /// `null`. | |
| 2275 /// | |
| 2276 /// For instance: | |
| 2277 /// | |
| 2278 /// m(rhs) { | |
| 2279 /// var variable; | |
| 2280 /// variable ??= rhs; | |
| 2281 /// } | |
| 2282 /// | |
| 2283 R visitLocalVariableSetIfNull( | |
| 2284 Send node, | |
| 2285 LocalVariableElement variable, | |
| 2286 Node rhs, | |
| 2287 A arg); | |
| 2288 | |
| 2289 /// If-null assignment expression of [rhs] to the final local [variable]. That | |
| 2290 /// is, evaluation and assignment of [rhs] only if the value is of [variable] | |
| 2291 /// is `null`. | |
| 2292 /// | |
| 2293 /// For instance: | |
| 2294 /// | |
| 2295 /// m(rhs) { | |
| 2296 /// final variable = 0; | |
| 2297 /// variable ??= rhs; | |
| 2298 /// } | |
| 2299 /// | |
| 2300 R visitFinalLocalVariableSetIfNull( | |
| 2301 Send node, | |
| 2302 LocalVariableElement variable, | |
| 2303 Node rhs, | |
| 2304 A arg); | |
| 2305 | |
| 2306 /// If-null assignment expression of [rhs] to the local [function]. That is, | |
| 2307 /// evaluation and assignment of [rhs] only if the value is of [function] on | |
| 2308 /// `this` is `null`. This is in other words a fancy closurization. | |
| 2309 /// | |
| 2310 /// For instance: | |
| 2311 /// | |
| 2312 /// m(rhs) { | |
| 2313 /// function() {} | |
| 2314 /// function ??= rhs; | |
| 2315 /// } | |
| 2316 /// | |
| 2317 R visitLocalFunctionSetIfNull( | |
| 2318 Send node, | |
| 2319 LocalFunctionElement function, | |
| 2320 Node rhs, | |
| 2321 A arg); | |
| 2322 | |
| 2323 /// If-null assignment expression of [rhs] to the static [field]. That | |
| 2324 /// is, evaluation and assignment of [rhs] only if the value is of [field] | |
| 2325 /// is `null`. | |
| 2326 /// | |
| 2327 /// For instance: | |
| 2328 /// | |
| 2329 /// class C { | |
| 2330 /// static var field; | |
| 2331 /// m(rhs) => field ??= rhs; | |
| 2332 /// } | |
| 2333 /// | |
| 2334 R visitStaticFieldSetIfNull( | |
| 2335 Send node, | |
| 2336 FieldElement field, | |
| 2337 Node rhs, | |
| 2338 A arg); | |
| 2339 | |
| 2340 /// If-null assignment expression of [rhs] to the final static [field]. That | |
| 2341 /// is, evaluation and assignment of [rhs] only if the value is of [field] | |
| 2342 /// is `null`. | |
| 2343 /// | |
| 2344 /// For instance: | |
| 2345 /// | |
| 2346 /// class C { | |
| 2347 /// static final field = 0; | |
| 2348 /// m(rhs) => field ??= rhs; | |
| 2349 /// } | |
| 2350 /// | |
| 2351 R visitFinalStaticFieldSetIfNull( | |
| 2352 Send node, | |
| 2353 FieldElement field, | |
| 2354 Node rhs, | |
| 2355 A arg); | |
| 2356 | |
| 2357 /// If-null assignment expression of [rhs] to the static property defined by | |
| 2358 /// [getter] and [setter]. That is, evaluation and assignment of [rhs] to | |
| 2359 /// [setter] only if the value is of the [getter] is `null`. | |
| 2360 /// | |
| 2361 /// For instance: | |
| 2362 /// | |
| 2363 /// class C { | |
| 2364 /// static get o => 0; | |
| 2365 /// static set o(_) {} | |
| 2366 /// m(rhs) => o ??= rhs; | |
| 2367 /// } | |
| 2368 /// | |
| 2369 R visitStaticGetterSetterSetIfNull( | |
| 2370 Send node, | |
| 2371 FunctionElement getter, | |
| 2372 FunctionElement setter, | |
| 2373 Node rhs, | |
| 2374 A arg); | |
| 2375 | |
| 2376 /// If-null assignment expression of [rhs] to the static property defined by | |
| 2377 /// [method] and [setter]. That is, evaluation and assignment of [rhs] to | |
| 2378 /// [setter] only if the value is of the [method] is `null`. This is in other | |
| 2379 /// words a fancy closurization. | |
| 2380 /// | |
| 2381 /// For instance: | |
| 2382 /// | |
| 2383 /// class C { | |
| 2384 /// static o() {} | |
| 2385 /// static set o(_) {} | |
| 2386 /// m(rhs) => o ??= rhs; | |
| 2387 /// } | |
| 2388 /// | |
| 2389 R visitStaticMethodSetterSetIfNull( | |
| 2390 Send node, | |
| 2391 MethodElement method, | |
| 2392 MethodElement setter, | |
| 2393 Node rhs, | |
| 2394 A arg); | |
| 2395 | |
| 2396 /// If-null assignment expression of [rhs] to the static [method]. That is, | |
| 2397 /// evaluation and assignment of [rhs] only if the value is of [method] on | |
| 2398 /// `this` is `null`. This is in other words a fancy closurization. | |
| 2399 /// | |
| 2400 /// For instance: | |
| 2401 /// | |
| 2402 /// o() {} | |
| 2403 /// m(rhs) => o ??= rhs; | |
| 2404 /// | |
| 2405 R visitStaticMethodSetIfNull( | |
| 2406 Send node, | |
| 2407 FunctionElement method, | |
| 2408 Node rhs, | |
| 2409 A arg); | |
| 2410 | |
| 2411 /// If-null assignment expression of [rhs] to the top level [field]. That | |
| 2412 /// is, evaluation and assignment of [rhs] only if the value is of [field] | |
| 2413 /// is `null`. | |
| 2414 /// | |
| 2415 /// For instance: | |
| 2416 /// | |
| 2417 /// var field; | |
| 2418 /// m(rhs) => field ??= rhs; | |
| 2419 /// | |
| 2420 R visitTopLevelFieldSetIfNull( | |
| 2421 Send node, | |
| 2422 FieldElement field, | |
| 2423 Node rhs, | |
| 2424 A arg); | |
| 2425 | |
| 2426 /// If-null assignment expression of [rhs] to the final top level [field]. | |
| 2427 /// That is, evaluation and assignment of [rhs] only if the value is of | |
| 2428 /// [field] is `null`. | |
| 2429 /// | |
| 2430 /// For instance: | |
| 2431 /// | |
| 2432 /// final field = 0; | |
| 2433 /// m(rhs) => field ??= rhs; | |
| 2434 /// | |
| 2435 R visitFinalTopLevelFieldSetIfNull( | |
| 2436 Send node, | |
| 2437 FieldElement field, | |
| 2438 Node rhs, | |
| 2439 A arg); | |
| 2440 | |
| 2441 /// If-null assignment expression of [rhs] to the top level property defined | |
| 2442 /// by [getter] and [setter]. That is, evaluation and assignment of [rhs] to | |
| 2443 /// [setter] only if the value is of the [getter] is `null`. | |
| 2444 /// | |
| 2445 /// For instance: | |
| 2446 /// | |
| 2447 /// get o => 0; | |
| 2448 /// set o(_) {} | |
| 2449 /// m(rhs) => o ??= rhs; | |
| 2450 /// | |
| 2451 R visitTopLevelGetterSetterSetIfNull( | |
| 2452 Send node, | |
| 2453 FunctionElement getter, | |
| 2454 FunctionElement setter, | |
| 2455 Node rhs, | |
| 2456 A arg); | |
| 2457 | |
| 2458 /// If-null assignment expression of [rhs] to the top level property defined | |
| 2459 /// by [method] and [setter]. That is, evaluation and assignment of [rhs] to | |
| 2460 /// [setter] only if the value is of the [method] is `null`. This is in other | |
| 2461 /// words a fancy closurization. | |
| 2462 /// | |
| 2463 /// For instance: | |
| 2464 /// | |
| 2465 /// o() {} | |
| 2466 /// set o(_) {} | |
| 2467 /// m(rhs) => o ??= rhs; | |
| 2468 /// | |
| 2469 R visitTopLevelMethodSetterSetIfNull( | |
| 2470 Send node, | |
| 2471 FunctionElement method, | |
| 2472 FunctionElement setter, | |
| 2473 Node rhs, | |
| 2474 A arg); | |
| 2475 | |
| 2476 /// If-null assignment expression of [rhs] to the top level [method]. That is, | |
| 2477 /// evaluation and assignment of [rhs] only if the value is of [method] on | |
| 2478 /// `this` is `null`. This is in other words a fancy closurization. | |
| 2479 /// | |
| 2480 /// For instance: | |
| 2481 /// | |
| 2482 /// o() {} | |
| 2483 /// m(rhs) => o ??= rhs; | |
| 2484 /// | |
| 2485 R visitTopLevelMethodSetIfNull( | |
| 2486 Send node, | |
| 2487 FunctionElement method, | |
| 2488 Node rhs, | |
| 2489 A arg); | |
| 2490 | |
| 2491 /// If-null assignment expression of [rhs] to the super [field]. That | |
| 2492 /// is, evaluation and assignment of [rhs] only if the value is of [field] | |
| 2493 /// is `null`. | |
| 2494 /// | |
| 2495 /// For instance: | |
| 2496 /// | |
| 2497 /// class B { | |
| 2498 /// var field; | |
| 2499 /// } | |
| 2500 /// class C extends B { | |
| 2501 /// m(rhs) => super.field ??= rhs; | |
| 2502 /// } | |
| 2503 /// | |
| 2504 R visitSuperFieldSetIfNull( | |
| 2505 Send node, | |
| 2506 FieldElement field, | |
| 2507 Node rhs, | |
| 2508 A arg); | |
| 2509 | |
| 2510 /// If-null assignment expression of [rhs] to the final super [field]. | |
| 2511 /// That is, evaluation and assignment of [rhs] only if the value is of | |
| 2512 /// [field] is `null`. | |
| 2513 /// | |
| 2514 /// For instance: | |
| 2515 /// | |
| 2516 /// class B { | |
| 2517 /// final field = 42; | |
| 2518 /// } | |
| 2519 /// class C extends B { | |
| 2520 /// m(rhs) => super.field ??= rhs; | |
| 2521 /// } | |
| 2522 /// | |
| 2523 R visitFinalSuperFieldSetIfNull( | |
| 2524 Send node, | |
| 2525 FieldElement field, | |
| 2526 Node rhs, | |
| 2527 A arg); | |
| 2528 | |
| 2529 /// If-null assignment expression of [rhs] to the super property defined | |
| 2530 /// by [readField] and [writtenField]. That is, evaluation and assignment of | |
| 2531 /// [rhs] to [writtenField] only if the value is of the [readField] is `null`. | |
| 2532 /// | |
| 2533 /// For instance: | |
| 2534 /// | |
| 2535 /// class A { | |
| 2536 /// var field; | |
| 2537 /// } | |
| 2538 /// class B extends A { | |
| 2539 /// final field; | |
| 2540 /// } | |
| 2541 /// class C extends B { | |
| 2542 /// m() => super.field ??= rhs; | |
| 2543 /// } | |
| 2544 /// | |
| 2545 R visitSuperFieldFieldSetIfNull( | |
| 2546 Send node, | |
| 2547 FieldElement readField, | |
| 2548 FieldElement writtenField, | |
| 2549 Node rhs, | |
| 2550 A arg); | |
| 2551 | |
| 2552 /// If-null assignment expression of [rhs] to the super property defined | |
| 2553 /// by [getter] and [setter]. That is, evaluation and assignment of [rhs] to | |
| 2554 /// [setter] only if the value is of the [getter] is `null`. | |
| 2555 /// | |
| 2556 /// For instance: | |
| 2557 /// | |
| 2558 /// class B { | |
| 2559 /// get o => 0; | |
| 2560 /// set o(_) {} | |
| 2561 /// } | |
| 2562 /// class C extends B { | |
| 2563 /// m(rhs) => super.o ??= rhs; | |
| 2564 /// } | |
| 2565 /// | |
| 2566 R visitSuperGetterSetterSetIfNull( | |
| 2567 Send node, | |
| 2568 FunctionElement getter, | |
| 2569 FunctionElement setter, | |
| 2570 Node rhs, | |
| 2571 A arg); | |
| 2572 | |
| 2573 /// If-null assignment expression of [rhs] to the super property defined | |
| 2574 /// by [method] and [setter]. That is, evaluation and assignment of [rhs] to | |
| 2575 /// [setter] only if the value is of the [method] is `null`. This is in other | |
| 2576 /// words a fancy closurization. | |
| 2577 /// | |
| 2578 /// For instance: | |
| 2579 /// | |
| 2580 /// class B { | |
| 2581 /// o() {} | |
| 2582 /// set o(_) {} | |
| 2583 /// } | |
| 2584 /// class C extends B { | |
| 2585 /// m(rhs) => super.o ??= rhs; | |
| 2586 /// } | |
| 2587 /// | |
| 2588 R visitSuperMethodSetterSetIfNull( | |
| 2589 Send node, | |
| 2590 FunctionElement method, | |
| 2591 FunctionElement setter, | |
| 2592 Node rhs, | |
| 2593 A arg); | |
| 2594 | |
| 2595 /// If-null assignment expression of [rhs] to the super [method]. | |
| 2596 /// That is, evaluation and assignment of [rhs] only if the value is of | |
| 2597 /// [method] is `null`. This is in other words a fancy closurization. | |
| 2598 /// | |
| 2599 /// For instance: | |
| 2600 /// | |
| 2601 /// class B { | |
| 2602 /// o() {} | |
| 2603 /// } | |
| 2604 /// class C extends B { | |
| 2605 /// m(rhs) => super.o ??= rhs; | |
| 2606 /// } | |
| 2607 /// | |
| 2608 R visitSuperMethodSetIfNull( | |
| 2609 Send node, | |
| 2610 FunctionElement method, | |
| 2611 Node rhs, | |
| 2612 A arg); | |
| 2613 | |
| 2614 /// If-null assignment expression of [rhs] to the super property defined | |
| 2615 /// by [setter] with no corresponding getter. That is, evaluation and | |
| 2616 /// assignment of [rhs] to [setter] only if the value is of the unresolved | |
| 2617 /// getter is `null`. This is in other words a no such method error. | |
| 2618 /// | |
| 2619 /// For instance: | |
| 2620 /// | |
| 2621 /// class B { | |
| 2622 /// set o(_) {} | |
| 2623 /// } | |
| 2624 /// class C extends B { | |
| 2625 /// m(rhs) => super.o ??= rhs; | |
| 2626 /// } | |
| 2627 /// | |
| 2628 R visitUnresolvedSuperGetterSetIfNull( | |
| 2629 Send node, | |
| 2630 Element element, | |
| 2631 MethodElement setter, | |
| 2632 Node rhs, | |
| 2633 A arg); | |
| 2634 | |
| 2635 /// If-null assignment expression of [rhs] to the super property defined | |
| 2636 /// by [getter] with no corresponding setter. That is, evaluation and | |
| 2637 /// assignment of [rhs] to unresolved setter only if the value is of the | |
| 2638 /// [getter] is `null`. | |
| 2639 /// | |
| 2640 /// For instance: | |
| 2641 /// | |
| 2642 /// class B { | |
| 2643 /// get o => 42; | |
| 2644 /// } | |
| 2645 /// class C extends B { | |
| 2646 /// m(rhs) => super.o ??= rhs; | |
| 2647 /// } | |
| 2648 /// | |
| 2649 R visitUnresolvedSuperSetterSetIfNull( | |
| 2650 Send node, | |
| 2651 MethodElement getter, | |
| 2652 Element element, | |
| 2653 Node rhs, | |
| 2654 A arg); | |
| 2655 | |
| 2656 /// If-null assignment expression of [rhs] to the top level property defined | |
| 2657 /// by [field] and [setter]. That is, evaluation and assignment of [rhs] to | |
| 2658 /// [setter] only if the value is of the [field] is `null`. | |
| 2659 /// | |
| 2660 /// For instance: | |
| 2661 /// | |
| 2662 /// class A { | |
| 2663 /// var o; | |
| 2664 /// } | |
| 2665 /// class B extends A { | |
| 2666 /// set o(_) {} | |
| 2667 /// } | |
| 2668 /// class C extends B { | |
| 2669 /// m(rhs) => super.o ??= rhs; | |
| 2670 /// } | |
| 2671 /// | |
| 2672 R visitSuperFieldSetterSetIfNull( | |
| 2673 Send node, | |
| 2674 FieldElement field, | |
| 2675 FunctionElement setter, | |
| 2676 Node rhs, | |
| 2677 A arg); | |
| 2678 | |
| 2679 /// If-null assignment expression of [rhs] to the top level property defined | |
| 2680 /// by [getter] and [field]. That is, evaluation and assignment of [rhs] to | |
| 2681 /// [field] only if the value is of the [getter] is `null`. | |
| 2682 /// | |
| 2683 /// For instance: | |
| 2684 /// | |
| 2685 /// class A { | |
| 2686 /// var o; | |
| 2687 /// } | |
| 2688 /// class B extends A { | |
| 2689 /// get o => 0; | |
| 2690 /// } | |
| 2691 /// class C extends B { | |
| 2692 /// m(rhs) => super.o ??= rhs; | |
| 2693 /// } | |
| 2694 /// | |
| 2695 R visitSuperGetterFieldSetIfNull( | |
| 2696 Send node, | |
| 2697 FunctionElement getter, | |
| 2698 FieldElement field, | |
| 2699 Node rhs, | |
| 2700 A arg); | |
| 2701 | |
| 2702 /// If-null assignment expression of [rhs] to an unresolved super property. | |
| 2703 /// That is, evaluation and assignment of [rhs] only if the value is of the | |
| 2704 /// unresolved property is `null`. This is in other words a no such method | |
| 2705 /// error. | |
| 2706 /// | |
| 2707 /// For instance: | |
| 2708 /// | |
| 2709 /// class B { | |
| 2710 /// } | |
| 2711 /// class C extends B { | |
| 2712 /// m(rhs) => super.unresolved ??= rhs; | |
| 2713 /// } | |
| 2714 /// | |
| 2715 R visitUnresolvedSuperSetIfNull( | |
| 2716 Send node, | |
| 2717 Element element, | |
| 2718 Node rhs, | |
| 2719 A arg); | |
| 2720 | |
| 2721 /// If-null assignment expression of [rhs] to the static property defined | |
| 2722 /// by [setter] with no corresponding getter. That is, evaluation and | |
| 2723 /// assignment of [rhs] to [setter] only if the value is of the unresolved | |
| 2724 /// getter is `null`. This is in other words a no such method error. | |
| 2725 /// | |
| 2726 /// For instance: | |
| 2727 /// | |
| 2728 /// class C { | |
| 2729 /// set foo(_) {} | |
| 2730 /// } | |
| 2731 /// m1() => C.foo ??= 42; | |
| 2732 /// | |
| 2733 R visitUnresolvedStaticGetterSetIfNull( | |
| 2734 Send node, | |
| 2735 Element element, | |
| 2736 MethodElement setter, | |
| 2737 Node rhs, | |
| 2738 A arg); | |
| 2739 | |
| 2740 /// If-null assignment expression of [rhs] to the top level property defined | |
| 2741 /// by [setter] with no corresponding getter. That is, evaluation and | |
| 2742 /// assignment of [rhs] to [setter] only if the value is of the unresolved | |
| 2743 /// getter is `null`. This is in other words a no such method error. | |
|
karlklose
2015/08/26 12:39:22
Maybe split the last sentence into its own paragra
Johnni Winther
2015/08/28 08:12:12
Rephrased.
| |
| 2744 /// | |
| 2745 /// For instance: | |
| 2746 /// | |
| 2747 /// set foo(_) {} | |
| 2748 /// m1() => foo ??= 42; | |
| 2749 /// | |
| 2750 R visitUnresolvedTopLevelGetterSetIfNull( | |
| 2751 Send node, | |
| 2752 Element element, | |
| 2753 MethodElement setter, | |
| 2754 Node rhs, | |
| 2755 A arg); | |
| 2756 | |
| 2757 /// If-null assignment expression of [rhs] to the static property defined | |
| 2758 /// by [getter] with no corresponding setter. That is, evaluation and | |
| 2759 /// assignment of [rhs] to unresolved setter only if the value is of the | |
| 2760 /// [getter] is `null`. | |
| 2761 /// | |
| 2762 /// For instance: | |
| 2763 /// | |
| 2764 /// class C { | |
| 2765 /// get foo => 42; | |
| 2766 /// } | |
| 2767 /// m1() => C.foo ??= 42; | |
| 2768 /// | |
| 2769 R visitUnresolvedStaticSetterSetIfNull( | |
| 2770 Send node, | |
| 2771 MethodElement getter, | |
| 2772 Element element, | |
| 2773 Node rhs, | |
| 2774 A arg); | |
| 2775 | |
| 2776 /// If-null assignment expression of [rhs] to the top level property defined | |
| 2777 /// by [getter] with no corresponding setter. That is, evaluation and | |
| 2778 /// assignment of [rhs] to unresolved setter only if the value is of the | |
| 2779 /// [getter] is `null`. | |
| 2780 /// | |
| 2781 /// For instance: | |
| 2782 /// | |
| 2783 /// get foo => 42; | |
| 2784 /// m1() => foo ??= 42; | |
| 2785 /// | |
| 2786 R visitUnresolvedTopLevelSetterSetIfNull( | |
| 2787 Send node, | |
| 2788 MethodElement getter, | |
| 2789 Element element, | |
| 2790 Node rhs, | |
| 2791 A arg); | |
| 2792 | |
| 2793 /// If-null assignment expression of [rhs] to an unresolved property. | |
| 2794 /// That is, evaluation and assignment of [rhs] only if the value is of the | |
| 2795 /// unresolved property is `null`. This is in other words a no such method | |
| 2796 /// error. | |
| 2797 /// | |
| 2798 /// For instance: | |
| 2799 /// | |
| 2800 /// class C {} | |
| 2801 /// m1() => unresolved ??= 42; | |
| 2802 /// m2() => C.unresolved ??= 42; | |
| 2803 /// | |
| 2804 // TODO(johnniwinther): Split the cases in which a prefix is resolved. | |
| 2805 R visitUnresolvedSetIfNull( | |
| 2806 Send node, | |
| 2807 Element element, | |
| 2808 Node rhs, | |
| 2809 A arg); | |
| 2810 | |
| 2811 /// If-null assignment expression of [rhs] to an invalid expression. | |
| 2812 /// | |
| 2813 /// For instance: | |
| 2814 /// | |
| 2815 /// import 'foo.dart' as p; | |
| 2816 /// | |
| 2817 /// m() => p ??= 42; | |
| 2818 /// | |
| 2819 R errorInvalidSetIfNull( | |
| 2820 Send node, | |
| 2821 ErroneousElement error, | |
| 2822 Node rhs, | |
| 2823 A arg); | |
| 2824 | |
| 2825 /// If-null assignment expression of [rhs] to the class type literal | |
| 2826 /// [contant]. That is, evaluation and assignment of [rhs] only if the value | |
| 2827 /// is of [constant] is `null`. This is in other words a fancy type literal | |
| 2828 /// access. | |
| 2829 /// | |
| 2830 /// For instance: | |
| 2831 /// | |
| 2832 /// class C {} | |
| 2833 /// m(rhs) => C ??= rhs; | |
| 2834 /// | |
| 2835 R visitClassTypeLiteralSetIfNull( | |
| 2836 Send node, | |
| 2837 ConstantExpression constant, | |
| 2838 Node rhs, | |
| 2839 A arg); | |
| 2840 | |
| 2841 /// If-null assignment expression of [rhs] to the typedef type literal | |
| 2842 /// [constant]. That is, evaluation and assignment of [rhs] only if the value | |
| 2843 /// is of [constant] is `null`. This is in other words a fancy type literal | |
| 2844 /// access. | |
| 2845 /// | |
| 2846 /// For instance: | |
| 2847 /// | |
| 2848 /// typedef F(); | |
| 2849 /// m(rhs) => F += rhs; | |
|
karlklose
2015/08/26 12:39:22
'+=' -> '??=' (also the two cases below)
Johnni Winther
2015/08/28 08:12:12
Done.
| |
| 2850 /// | |
| 2851 R visitTypedefTypeLiteralSetIfNull( | |
| 2852 Send node, | |
| 2853 ConstantExpression constant, | |
| 2854 Node rhs, | |
| 2855 A arg); | |
| 2856 | |
| 2857 /// If-null assignment expression of [rhs] to the type literal for the type | |
| 2858 /// variable [element]. That is, evaluation and assignment of [rhs] only if | |
| 2859 /// the value is of [element] is `null`. This is in other words a fancy type | |
| 2860 /// literal access. | |
| 2861 /// | |
| 2862 /// For instance: | |
| 2863 /// | |
| 2864 /// class C<T> { | |
| 2865 /// m(rhs) => T += rhs; | |
| 2866 /// } | |
| 2867 /// | |
| 2868 R visitTypeVariableTypeLiteralSetIfNull( | |
| 2869 Send node, | |
| 2870 TypeVariableElement element, | |
| 2871 Node rhs, | |
| 2872 A arg); | |
| 2873 | |
| 2874 /// If-null assignment expression of [rhs] to the dynamic type literal | |
| 2875 /// [constant]. That is, evaluation and assignment of [rhs] only if the value | |
| 2876 /// is of [constant] is `null`. This is in other words a fancy type literal | |
| 2877 /// access. | |
| 2878 /// | |
| 2879 /// For instance: | |
| 2880 /// | |
| 2881 /// m(rhs) => dynamic += rhs; | |
| 2882 /// | |
| 2883 R visitDynamicTypeLiteralSetIfNull( | |
| 2884 Send node, | |
| 2885 ConstantExpression constant, | |
| 2886 Node rhs, | |
| 2887 A arg); | |
| 2888 | |
| 2192 /// Prefix expression with [operator] on a final super [field]. | 2889 /// Prefix expression with [operator] on a final super [field]. |
| 2193 /// | 2890 /// |
| 2194 /// For instance: | 2891 /// For instance: |
| 2195 /// | 2892 /// |
| 2196 /// class B { | 2893 /// class B { |
| 2197 /// final field = 42; | 2894 /// final field = 42; |
| 2198 /// } | 2895 /// } |
| 2199 /// class C extends B { | 2896 /// class C extends B { |
| 2200 /// m(rhs) => ++super.field; | 2897 /// m(rhs) => ++super.field; |
| 2201 /// } | 2898 /// } |
| (...skipping 2944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5146 /// C() : this._(42); | 5843 /// C() : this._(42); |
| 5147 /// } | 5844 /// } |
| 5148 /// | 5845 /// |
| 5149 R errorUnresolvedThisConstructorInvoke( | 5846 R errorUnresolvedThisConstructorInvoke( |
| 5150 Send node, | 5847 Send node, |
| 5151 Element element, | 5848 Element element, |
| 5152 NodeList arguments, | 5849 NodeList arguments, |
| 5153 Selector selector, | 5850 Selector selector, |
| 5154 A arg); | 5851 A arg); |
| 5155 } | 5852 } |
| OLD | NEW |