From c11bdd78bcd5539e98961db8ef73265cbe34236b Mon Sep 17 00:00:00 2001 From: Pavel Jbanov Date: Fri, 28 Jun 2013 10:39:19 -0700 Subject: [PATCH] Replaced questionmark operator throughout --- lib/block.dart | 2 +- lib/block_type.dart | 4 ++-- lib/debug.dart | 20 ++++++++++---------- lib/scope.dart | 2 +- lib/selector.dart | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/block.dart b/lib/block.dart index a24ab4687..981e66a05 100644 --- a/lib/block.dart +++ b/lib/block.dart @@ -333,7 +333,7 @@ class ComponentFactory { attrAccessorFactory(dom.Element element, String name) { return ([String value]) { - if (?value) { + if (value != null) { if (value == null) { element.removeAttribute(name); } else { diff --git a/lib/block_type.dart b/lib/block_type.dart index 1770c3a10..ac395ff48 100644 --- a/lib/block_type.dart +++ b/lib/block_type.dart @@ -7,7 +7,7 @@ class BlockTypeFactory { BlockType call(templateElements, directivePositions, [group]) { return new BlockType(blockFactory, templateElements, directivePositions, - ?group && group != null ? group : ''); + group != null ? group : ''); } } @@ -26,7 +26,7 @@ class BlockType { } Block call(Injector injector, [List elements]) { - if (!?elements || elements == null) { + if (elements == null) { elements = cloneElements(templateElements); } return blockFactory(elements, directivePositions, group, injector); diff --git a/lib/debug.dart b/lib/debug.dart index 36a9d37b0..6a8a78d5c 100644 --- a/lib/debug.dart +++ b/lib/debug.dart @@ -22,16 +22,16 @@ MARK(name) { dump([p1, p2, p3, p4, p5, p6, p7, p8, p9, p10]) { var log = []; - if (?p1) log.add(STRINGIFY(p1)); - if (?p2) log.add(STRINGIFY(p2)); - if (?p3) log.add(STRINGIFY(p3)); - if (?p4) log.add(STRINGIFY(p4)); - if (?p5) log.add(STRINGIFY(p5)); - if (?p6) log.add(STRINGIFY(p6)); - if (?p7) log.add(STRINGIFY(p7)); - if (?p8) log.add(STRINGIFY(p8)); - if (?p9) log.add(STRINGIFY(p9)); - if (?p10) log.add(STRINGIFY(p10)); + if (p1 != null) log.add(STRINGIFY(p1)); + if (p2 != null) log.add(STRINGIFY(p2)); + if (p3 != null) log.add(STRINGIFY(p3)); + if (p4 != null) log.add(STRINGIFY(p4)); + if (p5 != null) log.add(STRINGIFY(p5)); + if (p6 != null) log.add(STRINGIFY(p6)); + if (p7 != null) log.add(STRINGIFY(p7)); + if (p8 != null) log.add(STRINGIFY(p8)); + if (p9 != null) log.add(STRINGIFY(p9)); + if (p10 != null) log.add(STRINGIFY(p10)); js.scoped(() { js.context.console.log(log.join(', ')); }); diff --git a/lib/scope.dart b/lib/scope.dart index c9a5f2e0a..a7be66fb5 100644 --- a/lib/scope.dart +++ b/lib/scope.dart @@ -354,7 +354,7 @@ class Scope implements Map { event = new Event(name, this); //down while you can, then up and next sibling or up and next sibling until back at root - if (!?listenerArgs) { + if (listenerArgs == null) { listenerArgs = []; } listenerArgs.insert(0, event); diff --git a/lib/selector.dart b/lib/selector.dart index 5735c87c5..4b3766265 100644 --- a/lib/selector.dart +++ b/lib/selector.dart @@ -28,7 +28,7 @@ Selector selectorFactory(List selectors, [String startWith]) { selectors.forEach((selector) { var match; - if (?startWith) { + if (startWith != null) { if (selector.substring(0, startWith.length) == startWith) { selector = selector.substring(startWith.length); } else {