src/pyjamas.js
/**
     * Applies all upgrade functions to the target instance and
     * returns the new target. The versions are sorted in ascending
     * order before being applied.
     *
     * @param pjs       {Pyjamas}   Pyjamas instance matching the target type
     * @param target    {object}    Raw object instance to upgrade
     *
     * @return {object} Raw target with upgrade functions applied
     * @private
     */
Applies all upgrade functions to the target instance and
returns the new target. The versions are sorted in ascending
order before being applied.

@param pjs       {Pyjamas}   Pyjamas instance matching the target type
@param target    {object}    Raw object instance to upgrade

@return {object} Raw target with upgrade functions applied
@private
Applies all upgrade functions to the target instance and returns the new target . The versions are sorted in ascending order before being applied . @param pjs { Pyjamas } Pyjamas instance matching the target type @param target { object } Raw object instance to upgrade @return { object } Raw target with upgrade functions applied @private
function upgrade (pjs, target) {
        var i, buffer, versions;
        versions = Object.keys(pjs.upgrades).sort(Version.compare);
        for (i in versions) {
            if (Version.greaterThan(versions[i], target.version)) {
                buffer = pjs.upgrades[versions[i]](target);
                target = buffer ? buffer : target;
            }
        }
        return target;
    }
function upgrade ( pjs , target ) { var i , buffer , versions ; versions = Object . keys ( pjs . upgrades ) . sort ( Version . compare ) ; for ( i in versions ) { if ( Version . greaterThan ( versions [ i ] , target . version ) ) { buffer = pjs . upgrades [ versions [ i ] ] ( target ) ; target = buffer ? buffer : target ; } } return target ; }
Applies all upgrade functions to the target instance and
 returns the new target.
Applies all upgrade functions to the target instance and returns the new target .
// Before we decode the constructor we need to apply // any defined upgrade functions to the raw object