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

Side by Side Diff: dart/site/try/src/compilation_unit.dart

Issue 214513005: Add CompilationUnit abstraction for tracking "project files". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library trydart.compilationUnit;
6
7 import 'dart:async' show
8 Stream,
9 StreamController;
10
lukechurch 2014/03/27 16:08:23 This seems on first reading like a slightly odd pa
ahe 2014/03/27 23:32:34 It creates a private field without creating an abs
11 class CompilationUnitData {
12 final String name;
13 String content;
14
15 CompilationUnitData(this.name, this.content);
16 }
17
18 class CompilationUnit extends CompilationUnitData {
19 static StreamController<CompilationUnit> controller =
20 new StreamController<CompilationUnit>(sync: false);
21
22 static Stream<CompilationUnit> get onChanged => controller.stream;
23
24 CompilationUnit(String name, String content)
25 : super(name, content);
26
27 void set content(String newContent) {
28 if (content != newContent) {
29 super.content = newContent;
30 controller.add(this);
31 }
32 }
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698