Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for use of '*' to denote any variable type

  • Loading branch information...
commit f8dc82bdbf3720b77b0ccd32e5a78a8c6fe6a9d3 1 parent adfddab
@jrf0110 authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/leFunc.js
View
6 lib/leFunc.js
@@ -1,3 +1,4 @@
+// use exports if it exists, else use window
var module = module || {}
, window = window || module.exports || exports
, exports = module.exports || exports || window
@@ -14,6 +15,7 @@ var module = module || {}
*
***/
var isClass = function(obj, str) {
+ if (str == "*") return true; // Variable variable type
var result = Object.prototype.toString.call(obj);
// I'd rather window be an object
if (result == "[object global]") result = "[object Object]";
@@ -36,7 +38,7 @@ var module = module || {}
this.functions[name] = function(){
var argTypes = self.functions[name].argTypes
, i = 0
- , n = 0
+ , n
;
for (; i < argTypes.length; i++){
if (argTypes[i].length != arguments.length) continue;
@@ -78,6 +80,7 @@ var module = module || {}
return lf;
})();
+ // The various ways you can call leFunc
_leFunc.define(leFuncName, ["Object"], this, function(params){
/* Fix any undefined variables */
params.name = params.name || null;
@@ -127,6 +130,5 @@ var module = module || {}
_leFunc.define(name, [], exports, fn);
}
);
-
exports[leFuncName] = this[leFuncName];
})("leFunc");
Please sign in to comment.
Something went wrong with that request. Please try again.