| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library template_binding.test.utils; | 5 library template_binding.test.utils; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'package:observe/observe.dart'; | 9 import 'package:observe/observe.dart'; |
| 10 import 'package:template_binding/template_binding.dart'; | 10 import 'package:template_binding/template_binding.dart'; |
| 11 export 'package:observe/src/dirty_check.dart' show dirtyCheckZone; | 11 export 'package:observe/src/dirty_check.dart' show dirtyCheckZone; |
| 12 | 12 |
| 13 /// A small method to help readability. Used to cause the next "then" in a chain | 13 /// A small method to help readability. Used to cause the next "then" in a chain |
| 14 /// to happen in the next microtask: | 14 /// to happen in the next microtask: |
| 15 /// | 15 /// |
| 16 /// future.then(newMicrotask).then(...) | 16 /// future.then(endOfMicrotask).then(...) |
| 17 endOfMicrotask(_) => new Future.value(); | 17 endOfMicrotask(_) => new Future.value(); |
| 18 | 18 |
| 19 /// A small method to help readability. Used to cause the next "then" in a chain | 19 /// A small method to help readability. Used to cause the next "then" in a chain |
| 20 /// to happen in the next microtask, after a timer: | 20 /// to happen in the next microtask, after a timer: |
| 21 /// | 21 /// |
| 22 /// future.then(nextMicrotask).then(...) | 22 /// future.then(nextMicrotask).then(...) |
| 23 nextMicrotask(_) => new Future(() {}); | 23 nextMicrotask(_) => new Future(() {}); |
| 24 | 24 |
| 25 final bool parserHasNativeTemplate = () { | 25 final bool parserHasNativeTemplate = () { |
| 26 var div = new DivElement()..innerHtml = '<table><template>'; | 26 var div = new DivElement()..innerHtml = '<table><template>'; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 class NullTreeSanitizer implements NodeTreeSanitizer { | 100 class NullTreeSanitizer implements NodeTreeSanitizer { |
| 101 void sanitizeTree(Node node) {} | 101 void sanitizeTree(Node node) {} |
| 102 } | 102 } |
| 103 | 103 |
| 104 unbindAll(node) { | 104 unbindAll(node) { |
| 105 nodeBind(node).unbindAll(); | 105 nodeBind(node).unbindAll(); |
| 106 for (var child = node.firstChild; child != null; child = child.nextNode) { | 106 for (var child = node.firstChild; child != null; child = child.nextNode) { |
| 107 unbindAll(child); | 107 unbindAll(child); |
| 108 } | 108 } |
| 109 } | 109 } |
| OLD | NEW |