Skip to content

Instantly share code, notes, and snippets.

@c-spencer
Created May 21, 2011 04:03
Show Gist options
  • Save c-spencer/984234 to your computer and use it in GitHub Desktop.
Save c-spencer/984234 to your computer and use it in GitHub Desktop.
var a = {
hidden: {
hidden: "seven"
}
}
Object.defineProperty(a, "_proto", {
get: function () { return this.hidden; },
set: function (val) { this.hidden = val; }
});
Object.defineProperty(a._proto, "extended", {
get: function () { return this.hidden; },
set: function (val) { this.hidden = val; }
});
a._proto.extended = "eleven";
console.log(a._proto.extended); // prints eleven
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment