oop-test.js revision ef4b6659548ee523f959373e98007d9ba8fe5cd3
name: 'Core',
test_clone: function () {
var a = {
'bool' : false,
'num' : 0,
'nul' : null,
'undef': undefined,
'T' : 'blabber'
};
var b = Y.clone(a);
var c = (function() {
var _c = 3;
return {
a: 1,
b: 2,
c: function() {
return _c;
}
};
}());
var d = Y.clone(c);
},
test_clone_node: function () {
var a = {
y: Y,
w: window,
d: document,
};
var b = Y.clone(a);
},
test_each: function () {
var count = 0;
Y.each(null, function(v, k) {
// should not throw
});
Y.each('string', function(v, k) {
// should not throw
});
Y.each(12345, function(v, k) {
// should not throw
});
count++;
});
},
test_extend: function () {
var firedbase = false;
var firedextended = false;
var Base = function() {
Y.log('Base constructor executed');
// bind by string in order to allow the subclass
};
base: function() {
Y.log('base function');
firedbase = true;
}
});
var Extended = function() {
Y.log('Extended constructor executed');
};
base: function() {
Y.log('extended function');
firedextended = true;
}
});
var b = new Extended();
},
test_merge: function () {
Y.Assert.isFalse((o123.hasOwnProperty('foo')), 'prototype properties added to Object should not be iterable');
},
test_mix: function () {
var a = {
'bool' : false,
'num' : 0,
'nul' : null,
'undef': undefined,
'T' : 'blabber'
};
var b = {
'bool' : 'oops',
'num' : 'oops',
'nul' : 'oops',
'undef': 'oops',
'T' : 'oops'
};
Y.mix(a, b, false);
Y.mix(a, b, true);
}
}));