Mercurial > pub > ImplabJs
comparison src/implab/declare/override.js @ 0:fc2517695ee1
Initial commit, draft import of existing work
author | cin |
---|---|
date | Thu, 01 Jun 2017 13:20:03 +0300 |
parents | |
children | 3d124d0b9078 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:fc2517695ee1 |
---|---|
1 "use strict"; | |
2 define([], function () { | |
3 var slice = Array.prototype.slice; | |
4 return function (method) { | |
5 var proxy; | |
6 | |
7 /** @this target object */ | |
8 proxy = function () { | |
9 var me = this; | |
10 var inherited = (this.getInherited && this.getInherited(proxy.nom, { | |
11 callee: proxy | |
12 })) || function () {}; | |
13 | |
14 method.apply(me, [function () { | |
15 return inherited.apply(me, arguments); | |
16 }].concat(slice.apply(arguments))); | |
17 }; | |
18 | |
19 proxy.method = method; | |
20 proxy.overrides = true; | |
21 | |
22 return proxy; | |
23 }; | |
24 }); |