index.js
function applyLibraryToPrototypes () {
            if(!attached) {
                Object.defineProperty(Object.prototype, handle, {
                    configurable : true,
                    enumerable   : false,
                    // Allow users to overwrite the handle on a per instance basis...
                    set: function (v) {
                        if(this[handle] !== v) {
                            Object.defineProperty(this, handle, {
                                configurable : true,
                                enumerable   : true,
                                writable     : true,
                                value        : v
                            });
                        }
                    },
                    // Returns the libp library...
                    get: function () {
                        var ccId,
                            proto = getProto(this),
                            cId   = proto.constructor.__get_protolib_id__,
                            lib   = {},
                            i     = 0,
                            last  = null,
                            m;

                        currentThis = this;

                        do {
                            ccId = proto.constructor.__get_protolib_id__;
                            if(cached[ccId] && i === 0) {
                                return cached[ccId];
                            }
                            else if(cached[ccId]) {
                                for(m in cached[ccId])
                                    if(cached[ccId].hasOwnProperty(m)) lib[m] = cached[ccId][m];

                                if(!inheritanceChain[cId]) inheritanceChain[cId] = [];
                                inheritanceChain[cId] = inheritanceChain[ccId].concat(inheritanceChain[cId]);
                                cached[cId] = lib;
                                return lib;
                            }
                            else {
                                if(!libp[ccId]) libp[ccId] = {};
                                for(m in libp[ccId])
                                    if(libp[ccId].hasOwnProperty(m)) lib[m] = libp[ccId][m];

                                    if(!inheritanceChain[ccId]) inheritanceChain[ccId] = [];
                                    inheritanceChain[cId].unshift(ccId);

                                cached[cId] = lib;
                                last = ccId;
                            }

                            ++i;
                        }
                        while (proto = getProto(proto)); // jshint ignore:line

                        lib.__protolib_cId__ = cId;
                        return lib;
                    }
                });
                attached = true;
            }
            return self;
        }
function applyLibraryToPrototypes () {
            if(!attached) {
                Object.defineProperty(Object.prototype, handle, {
                    configurable : true,
                    enumerable   : false,
                    // Allow users to overwrite the handle on a per instance basis...
                    set: function (v) {
                        if(this[handle] !== v) {
                            Object.defineProperty(this, handle, {
                                configurable : true,
                                enumerable   : true,
                                writable     : true,
                                value        : v
                            });
                        }
                    },
                    // Returns the libp library...
                    get: function () {
                        var ccId,
                            proto = getProto(this),
                            cId   = proto.constructor.__get_protolib_id__,
                            lib   = {},
                            i     = 0,
                            last  = null,
                            m;

                        currentThis = this;

                        do {
                            ccId = proto.constructor.__get_protolib_id__;
                            if(cached[ccId] && i === 0) {
                                return cached[ccId];
                            }
                            else if(cached[ccId]) {
                                for(m in cached[ccId])
                                    if(cached[ccId].hasOwnProperty(m)) lib[m] = cached[ccId][m];

                                if(!inheritanceChain[cId]) inheritanceChain[cId] = [];
                                inheritanceChain[cId] = inheritanceChain[ccId].concat(inheritanceChain[cId]);
                                cached[cId] = lib;
                                return lib;
                            }
                            else {
                                if(!libp[ccId]) libp[ccId] = {};
                                for(m in libp[ccId])
                                    if(libp[ccId].hasOwnProperty(m)) lib[m] = libp[ccId][m];

                                    if(!inheritanceChain[ccId]) inheritanceChain[ccId] = [];
                                    inheritanceChain[cId].unshift(ccId);

                                cached[cId] = lib;
                                last = ccId;
                            }

                            ++i;
                        }
                        while (proto = getProto(proto)); // jshint ignore:line

                        lib.__protolib_cId__ = cId;
                        return lib;
                    }
                });
                attached = true;
            }
            return self;
        }
function applyLibraryToPrototypes ( ) { if ( ! attached ) { Object . defineProperty ( Object . prototype , handle , { configurable : true , enumerable : false , // Allow users to overwrite the handle on a per instance basis... set : function ( v ) { if ( this [ handle ] !== v ) { Object . defineProperty ( this , handle , { configurable : true , enumerable : true , writable : true , value : v } ) ; } } , // Returns the libp library... get : function ( ) { var ccId , proto = getProto ( this ) , cId = proto . constructor . __get_protolib_id__ , lib = { } , i = 0 , last = null , m ; currentThis = this ; do { ccId = proto . constructor . __get_protolib_id__ ; if ( cached [ ccId ] && i === 0 ) { return cached [ ccId ] ; } else if ( cached [ ccId ] ) { for ( m in cached [ ccId ] ) if ( cached [ ccId ] . hasOwnProperty ( m ) ) lib [ m ] = cached [ ccId ] [ m ] ; if ( ! inheritanceChain [ cId ] ) inheritanceChain [ cId ] = [ ] ; inheritanceChain [ cId ] = inheritanceChain [ ccId ] . concat ( inheritanceChain [ cId ] ) ; cached [ cId ] = lib ; return lib ; } else { if ( ! libp [ ccId ] ) libp [ ccId ] = { } ; for ( m in libp [ ccId ] ) if ( libp [ ccId ] . hasOwnProperty ( m ) ) lib [ m ] = libp [ ccId ] [ m ] ; if ( ! inheritanceChain [ ccId ] ) inheritanceChain [ ccId ] = [ ] ; inheritanceChain [ cId ] . unshift ( ccId ) ; cached [ cId ] = lib ; last = ccId ; } ++ i ; } while ( proto = getProto ( proto ) ) ; // jshint ignore:line lib . __protolib_cId__ = cId ; return lib ; } } ) ; attached = true ; } return self ; }
Adds the library methods from the primitive object prototypes.
@return {ProtoLib} The current ProtoLib instance
Adds the library methods from the primitive object prototypes .