allow defaulting property values by having property getter default to value stored on prototype (if there is no matching attribute)

This commit is contained in:
Scott Miles
2012-10-12 13:40:44 -07:00
parent c8cf70019d
commit 42195adfc5

View File

@@ -38,7 +38,8 @@ license that can be found in the LICENSE file.
a = a.trim();
Object.defineProperty(this, a, {
get: function() {
return this.getAttribute(a);
return this.hasAttribute(a) ? this.getAttribute(a) :
this.__proto__[a];
},
set: function(v) {
return this.setAttribute(a, v);