base-core.html revision 4cd36cd90f40231cd88acf6c0ab9d2fa89041bf0
65fea56f17cd614bc8908264df980a62e1931468vboxsync<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
65fea56f17cd614bc8908264df980a62e1931468vboxsync <script type="text/javascript" src="/build/yui/yui.js"></script>
65fea56f17cd614bc8908264df980a62e1931468vboxsync #console .yui3-console-entry {
65fea56f17cd614bc8908264df980a62e1931468vboxsync padding:2px;
65fea56f17cd614bc8908264df980a62e1931468vboxsync margin:0px;
65fea56f17cd614bc8908264df980a62e1931468vboxsync min-height:0;
65fea56f17cd614bc8908264df980a62e1931468vboxsync #console .yui3-console-entry-fail .yui3-console-entry-cat {
65fea56f17cd614bc8908264df980a62e1931468vboxsync background-color:red;
65fea56f17cd614bc8908264df980a62e1931468vboxsync #console .yui3-console-entry-pass .yui3-console-entry-cat {
65fea56f17cd614bc8908264df980a62e1931468vboxsync background-color:green;
65fea56f17cd614bc8908264df980a62e1931468vboxsync #console .yui3-console-entry-perf .yui3-console-entry-cat {
65fea56f17cd614bc8908264df980a62e1931468vboxsync background-color:blue;
65fea56f17cd614bc8908264df980a62e1931468vboxsync position:static;
65fea56f17cd614bc8908264df980a62e1931468vboxsync html, body {
65fea56f17cd614bc8908264df980a62e1931468vboxsync height:100%;
65fea56f17cd614bc8908264df980a62e1931468vboxsync useBrowserConsole:false,
65fea56f17cd614bc8908264df980a62e1931468vboxsync filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min'
65fea56f17cd614bc8908264df980a62e1931468vboxsync }).use("dump", "base-core", "console", "test", function(Y) {
65fea56f17cd614bc8908264df980a62e1931468vboxsync function areObjectsReallyEqual(o1, o2) {
65fea56f17cd614bc8908264df980a62e1931468vboxsync function Test(cfg, lazy, silentInit) {
65fea56f17cd614bc8908264df980a62e1931468vboxsync this._lazyAddAttrs = lazy;
65fea56f17cd614bc8908264df980a62e1931468vboxsync this._silentInit = silentInit;
65fea56f17cd614bc8908264df980a62e1931468vboxsync Test.superclass.constructor.apply(this, arguments);
65fea56f17cd614bc8908264df980a62e1931468vboxsync value: "Foo",
65fea56f17cd614bc8908264df980a62e1931468vboxsync setter: function(n) {
65fea56f17cd614bc8908264df980a62e1931468vboxsync value: "Bar",
65fea56f17cd614bc8908264df980a62e1931468vboxsync setter: function(n) {
65fea56f17cd614bc8908264df980a62e1931468vboxsync value: true
65fea56f17cd614bc8908264df980a62e1931468vboxsync value: false,
65fea56f17cd614bc8908264df980a62e1931468vboxsync setter: function(lock) {
65fea56f17cd614bc8908264df980a62e1931468vboxsync return lock;
65fea56f17cd614bc8908264df980a62e1931468vboxsync value: false
65fea56f17cd614bc8908264df980a62e1931468vboxsync value: true
AttrHost.superclass.constructor.apply(this, arguments);
AttrHost.NAME = "attrHost";
AttrHost.ATTRS = {
validator: Y.Lang.isString,
AttrHost.superclass.constructor.apply(this, arguments);
ExtendedAttrHost.NAME = "extendedAttrHost";
return ((value == undefined) || Y.Lang.isString(value));
"complex.X.A" : {
"complex.Y.A" : {
return this.get("H") + 10;
return val.toUpperCase();
Y.extend(ExtendedAttrHost, AttrHost, {
if (name.indexOf(".") == -1) {
Y.Assert.areEqual("I", name);
if (name.indexOf(".") == -1) {
Y.Assert.areEqual("I", name);
if (name.indexOf(".") == -1) {
Y.Assert.areEqual("I", name);
var h = this.createHost();
var h = this.createHost({A:"MyAVal", B:"MyBVal", C:"MyCVal", D:"MyDVal", E:"MyEVal", DE:"MyDEVal"});
h.set("C", "MyNewCVal");
h.set("D", "MyNewDVal");
h.set("E", "MyNewEVal");
var h = this.createHost();
h.set("A", "MyNewAVal");
h.set("B", "MyNewBVal");
h.set("C", "MyNewCVal");
h.set("D", "MyNewDVal");
h.set("E", "MyNewEVal");
h.set("DE", "MyNewDEVal");
var h = this.createHost();
h.set("E", "MyNewEVal");
h.set("C", "MyNewCVal");
var h = this.createHost({E:"MyEVal"});
h.set("E", "MyNewEVal");
var h = this.createHost({ initOnly: "initOnlyVal"});
h.set("initOnly", "NewInitOnlyVal");
var h1 = this.createHost();
h1.set("initOnly", "InitOnlyVal");
var h = this.createHost();
h.set("AdHoc", "TestAdHoc");
h.addAttr("AdHoc", {
return val.toUpperCase();
h.set("AdHoc", "TestAdHocConfigured");
var h = this.createHost({
AttrHost.prototype._allowAdHocAttrs = false;
var h = this.createHost({
var h = this.createHost();
areObjectsReallyEqual(expectedVals, h.getAttrs());
var h = this.createHost();
areObjectsReallyEqual(expectedVals, h.getAttrs(true));
var h = this.createHost();
h.set("A", "MyAVal");
h.set("A", 100);
h.set("B", "two");
h.set("B", 2);
h.set("B", false);
var h = this.createHost();
h.set("D", "MyNewDVal");
h.set("E", "MyNewEVal");
var h = this.createHost();
var val = h.get("complex");
Y.each(val, function(v, k) {
var h = this.createHost();
var h = this.createHost({A:5});
Y.Assert.areEqual("AVal", h.get("A")); // Numerical value validation failure should revert to default value
var h = this.createHost();
var q = h._protectAttrs(AttrHost.ATTRS);
q.A.newprop = "new prop value";
q.A.value = "modified value";
var h = this.createHost();
var h = this.createHost({A:"MyAVal", B:"MyBVal", C:"MyCVal", D:"MyDVal", E:"MyEVal", F:"MyFVal"});
h.set("C", "MyNewCVal");
h.set("D", "MyNewDVal");
h.set("E", "MyNewEVal");
var h = this.createHost();
h.set("A", "MyNewAVal");
h.set("B", "MyNewBVal");
h.set("C", "MyNewCVal");
h.set("D", "MyNewDVal");
h.set("E", "MyNewEVal");
h.set("F", "MyNewFVal");
h.set("DE", "MyNewDEVal");
var h = this.createHost();
h.set("AdHoc", "TestAdHoc");
var h = this.createHost();
areObjectsReallyEqual(expectedVals, h.getAttrs());
var h = this.createHost();
areObjectsReallyEqual(expectedVals, h.getAttrs(true));
var h = this.createHost();
h.set("A", "MyAVal");
h.set("A", 100);
h.set("B", "two");
h.set("B", 2);
h.set("B", true);
h.set("F", "MyNewFVal");
h.set("F", 3);
Y.Assert.areEqual("MyNewFVal", h.get("F")); // Validation should prevent the attribute from being set
var h = this.createHost();
h.set("D", "MyNewDVal");
h.set("E", "MyNewEVal");
var h = this.createHost();
var val = h.get("complex");
Y.each(val, function(v, k) {
var h = this.createHost();
var h = this.createHost();
var h = this.createHost();
h.set("I", {a:7, b:8});
t.getAttrs();
t.getAttrs();
Y.log("Construction Time Populated (lazy): " + ((end-start)/n), "perf");
Y.log("Construction Time (lazy and silent init): " + ((end-start)/n), "perf");