7 years, 5 months ago
(2013-08-06 20:04:52 UTC)
#6
https://chromiumcodereview.appspot.com/22417004/diff/1/lib/polymer_element.dart
File lib/polymer_element.dart (right):
https://chromiumcodereview.appspot.com/22417004/diff/1/lib/polymer_element.da...
lib/polymer_element.dart:130: propObserver.value = int.parse(value, onError: (x)
=> null);
On 2013/08/06 16:44:23, John Messerly wrote:
> On 2013/08/06 16:40:39, Siggi Cherem (dart-lang) wrote:
> > should we assign onError or just skip setting the property altogether?
>
> good question. I figured setting to "null" would signal an invalid value. But
> not setting is consistent with some of the error-tolerant HTML behavior. I'll
> need to do more research on this
hmm, Polymer source code is not helpful in this case. If they fail to parse,
they let it become a string:
https://github.com/Polymer/polymer/blob/master/src/lib/deserialize.js#L24
that would most likely cause a checked mode error in Dart, which would leave the
original value.
input type=number will give you a NaN if "value" attribute is invalid, but
that's also the default.
based on that, I'm inclined to switch it to your suggestion of preserving the
original value.
Jennifer Messerly
closing this, it was superseded by https://codereview.chromium.org/24149003/
7 years, 3 months ago
(2013-10-03 20:52:51 UTC)
#7
Issue 22417004: [pkg:polymer] add support for bool/int/double/String attributes
(Closed)
Created 7 years, 5 months ago by Jennifer Messerly
Modified 7 years, 3 months ago
Reviewers: Siggi Cherem (dart-lang)
Base URL: https://github.com/dart-lang/web-ui.git@master
Comments: 6