keithamus / proposal-object-freeze-seal-syntax

A JavaScript TC39 proposal for Object.freeze & Object.seal syntax
https://www.keithcirkel.co.uk/object-freeze-seal-syntax
59 stars 8 forks source link

Overloading the # symbol #16

Open roebuk opened 6 years ago

roebuk commented 6 years ago

Private class fields also use the # symbol, is it worth avoiding the # symbol to prevent any confusion?

xtuc commented 6 years ago

I agree, for example:

class T {
  #x = {# a: true #};

  constructor({# b #}) {
    this.#b = b;
  }

  foo() {
    this.#x = {# a: false #};
  }
}

It's confusing because the two same symbols have complete different meanings.