Skip to content

Instantly share code, notes, and snippets.

@minitech
Created June 15, 2013 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minitech/4f3193472b0f45b9d78b to your computer and use it in GitHub Desktop.
Save minitech/4f3193472b0f45b9d78b to your computer and use it in GitHub Desktop.
Object.prototype.construct = function() {
var content = arguments.callee.caller.toString();
var re = /\/\*\s*private\s*\*\/\s*(get|set)\s*([^(\s]+)/g;
var match;
var accessible = {};
while(match = re.exec(content)) {
accessible[match[1] + '_' + match[2]] = false;
}
var proto = arguments.callee.caller.prototype;
for(var x in proto) {
proto[x] =
}
};
function Shark() {
var teeth = Infinity;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
/* public */ get teeth() {
return teeth;
}
/* private */ set teeth(value) {
teeth = value;
}
}.construct(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment