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

Unified Diff: sky/sdk/lib/framework/fn2.dart

Issue 1160923008: Silence a bunch of annoying bogus dartanalyzer warnings. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | sky/sdk/lib/framework/rendering/object.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/fn2.dart
diff --git a/sky/sdk/lib/framework/fn2.dart b/sky/sdk/lib/framework/fn2.dart
index 540566963cde71d230207b2a5d2655d0a54d4a5a..ef6106f2f17b9403a020ae8e5de7b4adaa046b57 100644
--- a/sky/sdk/lib/framework/fn2.dart
+++ b/sky/sdk/lib/framework/fn2.dart
@@ -336,13 +336,19 @@ abstract class OneChildRenderObjectWrapper extends RenderObjectWrapper {
}
void insert(RenderObjectWrapper child, dynamic slot) {
+ final root = this.root; // TODO(ianh): Remove this once the analyzer is cleverer
assert(slot == null);
+ assert(root is RenderObjectWithChildMixin);
root.child = child.root;
+ assert(root == this.root); // TODO(ianh): Remove this once the analyzer is cleverer
}
void removeChild(UINode node) {
+ final root = this.root; // TODO(ianh): Remove this once the analyzer is cleverer
+ assert(root is RenderObjectWithChildMixin);
root.child = null;
super.removeChild(node);
+ assert(root == this.root); // TODO(ianh): Remove this once the analyzer is cleverer
}
void _remove() {
@@ -482,15 +488,19 @@ abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
}
void insert(RenderObjectWrapper child, dynamic slot) {
+ final root = this.root; // TODO(ianh): Remove this once the analyzer is cleverer
assert(slot == null || slot is RenderObject);
assert(root is ContainerRenderObjectMixin);
root.add(child.root, before: slot);
+ assert(root == this.root); // TODO(ianh): Remove this once the analyzer is cleverer
}
void removeChild(UINode node) {
+ final root = this.root; // TODO(ianh): Remove this once the analyzer is cleverer
assert(root is ContainerRenderObjectMixin);
root.remove(node.root);
super.removeChild(node);
+ assert(root == this.root); // TODO(ianh): Remove this once the analyzer is cleverer
}
void _remove() {
@@ -521,6 +531,7 @@ abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
void syncRenderObject(MultiChildRenderObjectWrapper old) {
super.syncRenderObject(old);
+ final root = this.root; // TODO(ianh): Remove this once the analyzer is cleverer
if (root is! ContainerRenderObjectMixin)
return;
@@ -597,7 +608,7 @@ abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
assert(old.root is ContainerRenderObjectMixin);
assert(oldNode.root != null);
- old.root.remove(oldNode.root);
+ (old.root as ContainerRenderObjectMixin).remove(oldNode.root); // TODO(ianh): Remove cast once the analyzer is cleverer
root.add(oldNode.root, before: nextSibling);
return true;
@@ -639,6 +650,8 @@ abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
removeChild(oldNode);
advanceOldStartIndex();
}
+
+ assert(root == this.root); // TODO(ianh): Remove this once the analyzer is cleverer
}
}
« no previous file with comments | « no previous file | sky/sdk/lib/framework/rendering/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698