Skip to content

Instantly share code, notes, and snippets.

@ericf
Created December 2, 2013 22:33
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 ericf/7760305 to your computer and use it in GitHub Desktop.
Save ericf/7760305 to your computer and use it in GitHub Desktop.
> var exposed = Exposed.create();
undefined
> var obj = {};
undefined
> Object.defineProperty(obj, 'foo', {
..... enumerable: true,
..... get: function () { return 'FOO'; }
..... });
{ foo: [Getter] }
> exposed.add('foo', obj);
undefined
> console.log(exposed.toString());
(function (g) {
// -- Namespaces --
// -- Exposed --
g.foo = {"foo":"FOO"};
}(this));
undefined
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment