summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthewsotoudeh <matthewsot@outlook.com>2015-05-10 17:45:48 -0700
committermatthewsotoudeh <matthewsot@outlook.com>2015-05-10 17:45:48 -0700
commitb95c5e0fae7be6efadd18f8ffe0b88bfd6d0313a (patch)
tree04dde2a82ddcd786abe3bf2c9a93a4efc58ad8c0
parent393e4f220fafcaade28d31f49d16381099d6591a (diff)
better naming of the function property
-rw-r--r--jfn.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/jfn.js b/jfn.js
index 90b725e..c8b6534 100644
--- a/jfn.js
+++ b/jfn.js
@@ -2,7 +2,7 @@ var jfn = {};
jfn.getProxyFunction = function (name) {
return function () {
- var jfns = this[name]["__jfns"];
+ var jfns = this[name]["__jfn"]["fns"];
for (var i = 0; i < jfns.length; i++) {
var jfn = jfns[i];
@@ -35,19 +35,19 @@ jfn.defineFunction = function (object, name, args, fn) {
object[name] = jfn.getProxyFunction(name);
}
- if (!object[name].hasOwnProperty("__jfns")) {
- object[name]["__jfns"] = [];
+ if (!object[name].hasOwnProperty("__jfn")) {
+ object[name]["__jfn"] = { "fns": [] };
} else {
- for (var i = 0; i < object[name]["__jfns"].length; i++) {
- var f = object[name]["__jfns"][i];
+ for (var i = 0; i < object[name]["__jfn"]["fns"].length; i++) {
+ var f = object[name]["__jfn"]["fns"][i];
if (JSON.stringify(f.args) === JSON.stringify(args)) {
- object[name]["__jfns"].splice(i, 1);
+ object[name]["__jfn"]["fns"].splice(i, 1);
return;
}
}
}
- object[name]["__jfns"].push({
+ object[name]["__jfn"]["fns"].push({
args: args,
fn: fn
});
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback