On Aug 27, 2012, at 16:55 , Matthew Robb <[email protected]> wrote:
> SO it has to be constructed via new Name() or will it automatically create
> Name objects when it encounters an assignment of that form? If you do have to
> create it does that mean in order to access it at all you would need to be in
> scope of myname2?
>
> My question I think boils down to whether access is SCOPE gated or OBJECT
> gated:
>
> var myClass = (function(){
> class myClass {
> constructor(){
> this[test] = 0;
> }
> }
>
> return myClass;
> })()
>
> myClass.prototype.getTest = function() { return this[test] }
>
> Is the above perfectly valid?
No, ES.next would complain about the undeclared variable `test` (variable
scope, not object). The closest you can get to simulating is by using strings
with UUIDs. That avoids the name clashes, but doesn’t hide the properties.
--
Dr. Axel Rauschmayer
[email protected]
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss