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 part of html; | 5 part of html; |
6 | 6 |
7 class _ModelTreeObserver { | 7 class _ModelTreeObserver { |
8 static bool _initialized = false; | 8 static bool _initialized = false; |
9 | 9 |
10 /** | 10 /** |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 */ | 76 */ |
77 static void propagateModel(Node node, model, bool fullTree) { | 77 static void propagateModel(Node node, model, bool fullTree) { |
78 // Calling into user code with the != call could generate exceptions. | 78 // Calling into user code with the != call could generate exceptions. |
79 // Catch and report them a global exceptions. | 79 // Catch and report them a global exceptions. |
80 try { | 80 try { |
81 if (node._hasLocalModel != true && node._model != model && | 81 if (node._hasLocalModel != true && node._model != model && |
82 node._modelChangedStream != null) { | 82 node._modelChangedStream != null) { |
83 node._model = model; | 83 node._model = model; |
84 node._modelChangedStream.add(node); | 84 node._modelChangedStream.add(node); |
85 } | 85 } |
86 } on AsyncError catch (e) { | |
87 e.throwDelayed(); | |
88 } catch (e, s) { | 86 } catch (e, s) { |
89 new AsyncError(e, s).throwDelayed(); | 87 new Future.immediateError(e, s); |
90 } | 88 } |
91 for (var child = node.$dom_firstChild; child != null; | 89 for (var child = node.$dom_firstChild; child != null; |
92 child = child.nextNode) { | 90 child = child.nextNode) { |
93 if (child._hasLocalModel != true) { | 91 if (child._hasLocalModel != true) { |
94 propagateModel(child, model, fullTree); | 92 propagateModel(child, model, fullTree); |
95 } else if (fullTree) { | 93 } else if (fullTree) { |
96 propagateModel(child, child._model, true); | 94 propagateModel(child, child._model, true); |
97 } | 95 } |
98 } | 96 } |
99 } | 97 } |
100 } | 98 } |
OLD | NEW |