annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
1 "use strict";
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
2 define([], function () {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
3 var slice = Array.prototype.slice;
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
4 return function (method) {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
5 var proxy;
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
6
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
7 /** @this target object */
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
8 proxy = function () {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
9 var me = this;
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
10 var inherited = (this.getInherited && this.getInherited(proxy.nom, {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
11 callee: proxy
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
12 })) || function () {};
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
13
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
14 method.apply(me, [function () {
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
15 return inherited.apply(me, arguments);
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
16 }].concat(slice.apply(arguments)));
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
17 };
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
18
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
19 proxy.method = method;
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
20 proxy.overrides = true;
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
21
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
22 return proxy;
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
23 };
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
24 });