Sha256: b1a71c17dee97ff5934d75fa3725f85a227bd5ef8479f9452d330155416b5d51

Contents?: true

Size: 935 Bytes

Versions: 1

Compression:

Stored size: 935 Bytes

Contents

/*global define*/
define(['Core/DeveloperError'],
        function(DeveloperError) {
    "use strict";

    /**
     * Wraps a function on the provided objects with another function called in the
     * object's context so that the new function is always called immediately
     * before the old one.
     *
     * @private
     */
    var wrapFunction = function(obj, oldFunction, newFunction) {
        //>>includeStart('debug', pragmas.debug);
        if (typeof oldFunction !== 'function') {
            throw new DeveloperError("oldFunction is required to be a function.");
        }

        if (typeof newFunction !== 'function') {
            throw new DeveloperError("oldFunction is required to be a function.");
        }
        //>>includeEnd('debug');

        return function() {
            newFunction.apply(obj, arguments);
            oldFunction.apply(obj, arguments);
        };
    };

    return wrapFunction;
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cesium-0.25.0 app/assets/javascripts/Core/wrapFunction.js