//检测属性是否在原型中
function hasPrototypeProperty(objct, name) {
    return !objct.hasOwnProperty(name) && (name in objct);
}

//寄生组合式继承

/**
 * Example
 * function Person(name, age) {
 *   this.name = name;
 *   this.age = age;
 * }
 *
 * Person.prototype.eat = function() {
 *   console.log(this.name + 'have dinner');
 * };
 *
 * function Teacher() {
 *   Person.call(this, arguments);
 * }
 *
 * Teacher.prototype.skill = function() {
 *   console.log('teacher'); 
 * };
 *
 * inheritPrototype(Teacher, Person);
 * 
 */
function inheritPrototype(subtype, supertype) {
    // var prototype = supertype.prototype; 貌似一样
    var prototype = Object(supertype.prototype);
    prototype.constructor = subtype;
    subtype.prototype = prototype;
}
@@ -729,8 +729,140 @@
 otype;%0A%7D
+%0A%0Afunction cancelEvent(e) %7B%0A    if (e) %7B%0A        e.stopPropagation();%0A    %7D else %7B%0A        window.event.cancelBubble = true;%0A    %7D%0A%7D

add stop propagation