| 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 observe; | 5 part of observe; |
| 6 | 6 |
| 7 // This code is inspired by ChangeSummary: | 7 // This code is inspired by ChangeSummary: |
| 8 // https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js | 8 // https://github.com/rafaelw/ChangeSummary/blob/master/change_summary.js |
| 9 // ...which underlies MDV. Since we don't need the functionality of | 9 // ...which underlies MDV. Since we don't need the functionality of |
| 10 // ChangeSummary, we just implement what we need for data bindings. | 10 // ChangeSummary, we just implement what we need for data bindings. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 _updateObservedValues(i); | 164 _updateObservedValues(i); |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 }); | 168 }); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 } | 171 } |
| 172 | 172 |
| 173 _getObjectProperty(object, property) { | 173 _getObjectProperty(object, property) { |
| 174 if (object == null) { |
| 175 return null; |
| 176 } |
| 177 |
| 174 if (object is List && property is int) { | 178 if (object is List && property is int) { |
| 175 if (property >= 0 && property < object.length) { | 179 if (property >= 0 && property < object.length) { |
| 176 return object[property]; | 180 return object[property]; |
| 177 } else { | 181 } else { |
| 178 return null; | 182 return null; |
| 179 } | 183 } |
| 180 } | 184 } |
| 181 | 185 |
| 182 if (property is Symbol) { | 186 if (property is Symbol) { |
| 183 var mirror = reflect(object); | 187 var mirror = reflect(object); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 238 |
| 235 final _spacesRegExp = new RegExp(r'\s'); | 239 final _spacesRegExp = new RegExp(r'\s'); |
| 236 | 240 |
| 237 bool _isPathValid(String s) { | 241 bool _isPathValid(String s) { |
| 238 s = s.replaceAll(_spacesRegExp, ''); | 242 s = s.replaceAll(_spacesRegExp, ''); |
| 239 | 243 |
| 240 if (s == '') return true; | 244 if (s == '') return true; |
| 241 if (s[0] == '.') return false; | 245 if (s[0] == '.') return false; |
| 242 return _pathRegExp.hasMatch(s); | 246 return _pathRegExp.hasMatch(s); |
| 243 } | 247 } |
| OLD | NEW |