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

Unified Diff: sky/framework/fn.dart

Issue 1052793002: [Effen] Remove '_isInCheckedMode' flag and use an assert() instead, since presumably that will more… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/fn.dart
diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart
index 3663161e3ef79e154d4fe8503317b9040fdc4c5e..9f7bda80c6b01810a1879cb52d7815cbefdde3a8 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -11,17 +11,6 @@ import 'reflect.dart' as reflect;
final sky.Tracing _tracing = sky.window.tracing;
-bool _initIsInCheckedMode() {
- String testFn(i) { double d = i; return d.toString(); }
- try {
- testFn('not a double');
- } catch (ex) {
- return true;
- }
- return false;
-}
-
-final bool _isInCheckedMode = _initIsInCheckedMode();
final bool _shouldLogRenderDuration = false;
final bool _shouldTrace = false;
@@ -396,9 +385,7 @@ abstract class WrapperNode extends RenderNode {
}) : this.children = children == null ? _emptyList : children,
super(key:key) {
- if (_isInCheckedMode) {
- _debugReportDuplicateIds();
- }
+ assert(!_debugHasDuplicateIds());
}
void _remove() {
@@ -410,7 +397,7 @@ abstract class WrapperNode extends RenderNode {
}
}
- void _debugReportDuplicateIds() {
+ bool _debugHasDuplicateIds() {
var idSet = new HashSet<String>();
for (var child in children) {
if (child is Text) {
@@ -422,6 +409,7 @@ abstract class WrapperNode extends RenderNode {
of another node, they must have unique keys.''';
}
}
+ return false;
}
void _ensureClass() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698