Agreeing on user-defined unique symbols?

Erik Arvidsson erik.arvidsson at gmail.com
Fri Aug 2 13:31:48 PDT 2013


You can already use string literals as property names:

```js
class C {
  "sys/iterator"() {}
}
```

On Fri, Aug 2, 2013 at 4:28 PM, Brandon Benvie <bbenvie at mozilla.com> wrote:
> On 8/2/2013 1:21 PM, Tab Atkins Jr. wrote:
>>
>> On Fri, Aug 2, 2013 at 12:45 PM, Kevin Smith <zenparsing at gmail.com> wrote:
>>>
>>>      class C {
>>>          "sys/iterator"() { }
>>>          "foo/userDefined"() { }
>>>      }
>>
>> How do you distinguish these from plain strings?  Or are you not
>> distinguishing them, and just assuming that we add a way to use string
>> literals as method names?
>
>
> I think he's saying they would just be plain strings. With current plans,
> you'd have to do
>
> ```js
> class C {
>   ["sys/iterator"]() {}
> }
> ```
>
> But I could see allowing string literals in property names.
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



-- 
erik


More information about the es-discuss mailing list