A Duck/Rabbit Proposal:

1) There is only one kind of Symbol
2) Private data can be accessed via Object.getPrivate and Object.setPrivate

The goal is to provide a base-level API from which higher-level
abstractions can be built.

    // === Basic example ===
    var symbol = new Symbol(), obj = {};

    // Setting private data:
    Object.setPrivate(obj, symbol, {});

    // Getting private data:
    var data = Object.getPrivate(obj, symbol);

Note that this does not preclude the possibility of full private symbols in
ES7.

More at:

https://gist.github.com/4601469

{ Kevin }
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to