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

Side by Side Diff: pkg/polymer/lib/src/instance.dart

Issue 189213003: Refactoring two pieces of polymer: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 polymer; 5 part of polymer;
6 6
7 /// Use this annotation to publish a field as an attribute. For example: 7 /// Use this annotation to publish a field as an attribute. For example:
8 /// 8 ///
9 /// class MyPlaybackElement extends PolymerElement { 9 /// class MyPlaybackElement extends PolymerElement {
10 /// // This will be available as an HTML attribute, for example: 10 /// // This will be available as an HTML attribute, for example:
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 644
645 if (_bindLog.isLoggable(Level.FINE)) { 645 if (_bindLog.isLoggable(Level.FINE)) {
646 _bindLog.fine('bindProperty: [$bindable] to [${localName}].[name]'); 646 _bindLog.fine('bindProperty: [$bindable] to [${localName}].[name]');
647 } 647 }
648 648
649 // capture A's value if B's value is null or undefined, 649 // capture A's value if B's value is null or undefined,
650 // otherwise use B's value 650 // otherwise use B's value
651 // TODO(sorvell): need to review, can do with ObserverTransform 651 // TODO(sorvell): need to review, can do with ObserverTransform
652 var v = bindable.value; 652 var v = bindable.value;
653 if (v == null) { 653 if (v == null) {
654 bindable.value = reflect(this).getField(name).reflectee; 654 bindable.value = smoke.read(this, name);
Siggi Cherem (dart-lang) 2014/03/06 22:45:23 oops - one lingering use of mirrors...
655 } 655 }
656 656
657 // TODO(jmesserly): this will create another subscription. 657 // TODO(jmesserly): this will create another subscription.
658 // It would be nice to have this reuse our existing _propertyObserver 658 // It would be nice to have this reuse our existing _propertyObserver
659 // created by observeProperties, to avoid more observation overhead. 659 // created by observeProperties, to avoid more observation overhead.
660 return new _PolymerBinding(this, name, bindable); 660 return new _PolymerBinding(this, name, bindable);
661 } 661 }
662 662
663 /// Attach event listeners on the host (this) element. 663 /// Attach event listeners on the host (this) element.
664 void addHostListeners() { 664 void addHostListeners() {
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 if (_sub != null) { 1017 if (_sub != null) {
1018 if (_eventsLog.isLoggable(Level.FINE)) { 1018 if (_eventsLog.isLoggable(Level.FINE)) {
1019 _eventsLog.fine( 1019 _eventsLog.fine(
1020 'event.remove: [$_node].$_eventName => [$_model].$_path())'); 1020 'event.remove: [$_node].$_eventName => [$_model].$_path())');
1021 } 1021 }
1022 _sub.cancel(); 1022 _sub.cancel();
1023 _sub = null; 1023 _sub = null;
1024 } 1024 }
1025 } 1025 }
1026 } 1026 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698