Code coverage report for lang/createObject.js

Statements: 100% (7 / 7)      Branches: 100% (0 / 0)      Functions: 100% (4 / 4)      Lines: 100% (6 / 6)     

All files » lang/ » createObject.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191                 1 3 3 3     1      
define(['../object/mixIn'], function(mixIn){
 
    /**
     * Create Object using prototypal inheritance and setting custom properties.
     * - Mix between Douglas Crockford Prototypal Inheritance <http://javascript.crockford.com/prototypal.html> and the EcmaScript 5 `Object.create()` method.
     * @param {object} parent    Parent Object.
     * @param {object} [props] Object properties.
     * @return {object} Created object.
     */
    function createObject(parent, props){
        function F(){}
        F.prototype = parent;
        return mixIn(new F(), props);
 
    }
    return createObject;
});