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

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

Issue 588373003: Update to polymer js version 0.4.1 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review updates Created 6 years, 3 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
« no previous file with comments | « pkg/polymer/lib/src/js/polymer/polymer.concat.js.map ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /// Code for property accessors from declaration/properties.js 5 /// Code for property accessors from declaration/properties.js
6 part of polymer; 6 part of polymer;
7 7
8 // Dart note: this matches the property defined by createPropertyAccessor in 8 // Dart note: this matches the property defined by createPropertyAccessor in
9 // polymer-dev/src/declarations/properties.js. Unlike Javascript, we can't 9 // polymer-dev/src/declarations/properties.js. Unlike Javascript, we can't
10 // override the original property, so we instead ask users to write properties 10 // override the original property, so we instead ask users to write properties
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 /// The current value of the property. If the property is bound, reading this 44 /// The current value of the property. If the property is bound, reading this
45 /// property ensures that the changes are first propagated in order to return 45 /// property ensures that the changes are first propagated in order to return
46 /// the latest value. Similarly, when setting this property the binding (if 46 /// the latest value. Similarly, when setting this property the binding (if
47 /// any) will be updated too. 47 /// any) will be updated too.
48 T get value { 48 T get value {
49 if (bindable != null) bindable.deliver(); 49 if (bindable != null) bindable.deliver();
50 return _value; 50 return _value;
51 } 51 }
52 52
53 set value(T newValue) { 53 set value(T newValue) {
54 // Dart Note: The js side makes computed properties read only, and bails
55 // out right here for them (ignoreWrites). For us they are automatically
56 // read only unless you define a setter for them, so we left that out.
54 if (bindable != null) { 57 if (bindable != null) {
55 bindable.value = newValue; 58 bindable.value = newValue;
56 } else { 59 } else {
57 updateValue(newValue); 60 updateValue(newValue);
58 } 61 }
59 } 62 }
60 63
61 toString() { 64 toString() {
62 var name = smoke.symbolToName(_name); 65 var name = smoke.symbolToName(_name);
63 var hasBinding = bindable == null ? '(no-binding)' : '(with-binding)'; 66 var hasBinding = bindable == null ? '(no-binding)' : '(with-binding)';
64 return "[$runtimeType: $_target.$name: $_value $hasBinding]"; 67 return "[$runtimeType: $_target.$name: $_value $hasBinding]";
65 } 68 }
66 } 69 }
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/js/polymer/polymer.concat.js.map ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698