Skip to content

Instantly share code, notes, and snippets.

@juntalis
Created September 28, 2012 00:12
Show Gist options
  • Save juntalis/3797218 to your computer and use it in GitHub Desktop.
Save juntalis/3797218 to your computer and use it in GitHub Desktop.
var $V = function() {
var args = Array.prototype.slice.call(arguments, 0);
if(!(this instanceof arguments.callee)) {
var $VA = arguments.callee,
$VB = function() {}, inst, ret;
$VB.prototype = $VA.prototype;
return Object(ret = $VA.apply(inst = new $VA, args)) === ret ? ret : inst;
}
this.originalValue = (function(a) {
switch(a.length) {
case 0: return undefined;
case 1: return a[0];
default: return a;
}
})(args);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment