view src/implab/declare/override.js @ 2:7d7059d2a810

Подправлены пути в пакетах
author egor
date Fri, 02 Jun 2017 19:28:20 +0300
parents fc2517695ee1
children 3d124d0b9078
line wrap: on
line source

"use strict";
define([], function () {
    var slice = Array.prototype.slice;
    return function (method) {
        var proxy;

        /** @this target object */
        proxy = function () {
            var me = this;
            var inherited = (this.getInherited && this.getInherited(proxy.nom, {
                callee: proxy
            })) || function () {};

            method.apply(me, [function () {
                return inherited.apply(me, arguments);
            }].concat(slice.apply(arguments)));
        };

        proxy.method = method;
        proxy.overrides = true;

        return proxy;
    };
});