Permalink
Browse files

Build Attribute.

  • Loading branch information...
ericf committed Jan 8, 2013
1 parent 0d04a68 commit 611cbee102ca42f5f3210ef63e0ef15a83dec717

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -779,8 +779,13 @@ YUI.add('attribute-core', function (Y, NAME) {
retVal = setter.call(host, newVal, name, opts);
if (retVal === INVALID_VALUE) {
- Y.log('Attribute: ' + attrName + ', setter returned Attribute.INVALID_VALUE for value:' + newVal, 'warn', 'attribute');
- allowSet = false;
+ if (initializing) {
+ Y.log('Attribute: ' + attrName + ', setter returned Attribute.INVALID_VALUE for value:' + newVal + ', initializing to default value', 'warn', 'attribute');
+ newVal = cfg.defaultValue;
+ } else {
+ Y.log('Attribute: ' + attrName + ', setter returned Attribute.INVALID_VALUE for value:' + newVal, 'warn', 'attribute');
+ allowSet = false;
+ }
} else if (retVal !== undefined){
Y.log('Attribute: ' + attrName + ', raw value: ' + newVal + ' modified by setter to:' + retVal, 'info', 'attribute');
newVal = retVal;

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -772,7 +772,11 @@ YUI.add('attribute-core', function (Y, NAME) {
retVal = setter.call(host, newVal, name, opts);
if (retVal === INVALID_VALUE) {
- allowSet = false;
+ if (initializing) {
+ newVal = cfg.defaultValue;
+ } else {
+ allowSet = false;
+ }
} else if (retVal !== undefined){
newVal = retVal;
}

0 comments on commit 611cbee

Please sign in to comment.