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