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

Unified Diff: sky/examples/fn/lib/node.dart

Issue 973613004: Clean up some Dart idioms in fn (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/fn/lib/fn.dart ('k') | sky/examples/fn/lib/reflect.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/fn/lib/node.dart
diff --git a/sky/examples/fn/lib/node.dart b/sky/examples/fn/lib/node.dart
index f7ea1a301428b6fd3156f878ab8a6d139fdfa7ea..1339e204eacadb4b1d8cce2c1d42bbd7778e2616 100644
--- a/sky/examples/fn/lib/node.dart
+++ b/sky/examples/fn/lib/node.dart
@@ -1,8 +1,12 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
part of fn;
-void parentInsertBefore(sky.ParentNode parent,
- sky.Node node,
- sky.Node ref) {
+void _parentInsertBefore(sky.ParentNode parent,
+ sky.Node node,
+ sky.Node ref) {
if (ref != null) {
ref.insertBefore([node]);
} else {
@@ -41,7 +45,7 @@ class Text extends Node {
bool _sync(Node old, sky.ParentNode host, sky.Node insertBefore) {
if (old == null) {
_root = new sky.Text(data);
- parentInsertBefore(host, _root, insertBefore);
+ _parentInsertBefore(host, _root, insertBefore);
return false;
}
@@ -51,7 +55,7 @@ class Text extends Node {
}
}
-var _emptyList = new List<Node>();
+final List<Node> _emptyList = new List<Node>();
abstract class Element extends Node {
@@ -102,7 +106,7 @@ abstract class Element extends Node {
_className = style == null ? '': style._className;
_children = children == null ? _emptyList : children;
- if (debugWarnings()) {
+ if (_debugWarnings()) {
_debugReportDuplicateIds();
}
}
@@ -194,7 +198,7 @@ abstract class Element extends Node {
assert(child._root is sky.Node);
}
- parentInsertBefore(host, _root, insertBefore);
+ _parentInsertBefore(host, _root, insertBefore);
return false;
}
@@ -283,7 +287,7 @@ abstract class Element extends Node {
oldNodeIdMap[currentNode._key] = null; // mark it reordered.
// print("Reparenting ${currentNode._key}");
- parentInsertBefore(root, oldNode._root, nextSibling);
+ _parentInsertBefore(root, oldNode._root, nextSibling);
return true;
}
@@ -344,7 +348,7 @@ class Container extends Element {
String get _tagName => 'div';
- static Container _emptyContainer = new Container();
+ static final Container _emptyContainer = new Container();
Element get _emptyElement => _emptyContainer;
@@ -389,7 +393,7 @@ class Image extends Element {
String get _tagName => 'img';
- static Image _emptyImage = new Image();
+ static final Image _emptyImage = new Image();
Element get _emptyElement => _emptyImage;
String src;
@@ -457,7 +461,7 @@ class Anchor extends Element {
String get _tagName => 'a';
- static Anchor _emptyAnchor = new Anchor();
+ static final Anchor _emptyAnchor = new Anchor();
String href;
« no previous file with comments | « sky/examples/fn/lib/fn.dart ('k') | sky/examples/fn/lib/reflect.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698