Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: pkg/observe/lib/transform.dart

Issue 23437017: pkg/observe: wrapMicrotask should return the result the provided testCase (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/observe/lib/src/microtask.dart ('k') | pkg/observe/test/observe_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** 5 /**
6 * Code transform for @observable. The core transformation is relatively 6 * Code transform for @observable. The core transformation is relatively
7 * straightforward, and essentially like an editor refactoring. 7 * straightforward, and essentially like an editor refactoring.
8 */ 8 */
9 library observe.transform; 9 library observe.transform;
10 10
11 import 'dart:async'; 11 import 'dart:async';
12 12
13 import 'package:analyzer_experimental/src/generated/ast.dart'; 13 import 'package:analyzer_experimental/src/generated/ast.dart';
14 import 'package:analyzer_experimental/src/generated/error.dart'; 14 import 'package:analyzer_experimental/src/generated/error.dart';
15 import 'package:analyzer_experimental/src/generated/parser.dart'; 15 import 'package:analyzer_experimental/src/generated/parser.dart';
16 import 'package:analyzer_experimental/src/generated/scanner.dart'; 16 import 'package:analyzer_experimental/src/generated/scanner.dart';
17 import 'package:barback/barback.dart'; 17 import 'package:barback/barback.dart';
18 import 'package:path/path.dart' as path;
19 import 'package:source_maps/refactor.dart'; 18 import 'package:source_maps/refactor.dart';
20 import 'package:source_maps/span.dart' show SourceFile; 19 import 'package:source_maps/span.dart' show SourceFile;
21 20
22 /** 21 /**
23 * A [Transformer] that replaces observables based on dirty-checking with an 22 * A [Transformer] that replaces observables based on dirty-checking with an
24 * implementation based on change notifications. 23 * implementation based on change notifications.
25 * 24 *
26 * The transformation adds hooks for field setters and notifies the observation 25 * The transformation adds hooks for field setters and notifies the observation
27 * system of the change. 26 * system of the change.
28 */ 27 */
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 $type __\$$name$initializer; 320 $type __\$$name$initializer;
322 $type get $name => __\$$name; 321 $type get $name => __\$$name;
323 set $name($type value) { 322 set $name($type value) {
324 __\$$name = notifyPropertyChange(const Symbol('$name'), __\$$name, value); 323 __\$$name = notifyPropertyChange(const Symbol('$name'), __\$$name, value);
325 } 324 }
326 '''.replaceAll('\n', '\n$indent')); 325 '''.replaceAll('\n', '\n$indent'));
327 } 326 }
328 327
329 code.edit(begin, end, '$replace'); 328 code.edit(begin, end, '$replace');
330 } 329 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/microtask.dart ('k') | pkg/observe/test/observe_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698