Re: Dash-case keys

2019-01-28 Thread Sultan Tarimo
This is expected and by design. For example obj[‘#invalidPrivateSigil’] is also not invalid. The affordances would be the same. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Dash-case keys

2019-01-28 Thread Claude Pache
> Le 29 janv. 2019 à 08:45, Sultan Tarimo a écrit : > > That is obj.font-size would rightly be invalid. Sadly, `obj.font-size` is *not* invalid, it has some well-defined semantics. That would be a source of bugs —Claude___ es-discuss mailing

Re: Dash-case keys

2019-01-28 Thread Sultan Tarimo
That might have been the case, but the expectation that an unquoted form should equally have a quoted form or vice-versa is not an issue in practice given the presence of a similar but opposite semantic in the private sigil access notation proposal: object.#validPrivateSigil ->

Re: Dash-case keys

2019-01-28 Thread Jordan Harband
i think if i can use something unquoted in an object literal, i'd expect to be able to use it in dot access - ie, `obj.font-size` - and then that problem arises. On Mon, Jan 28, 2019 at 3:43 PM Sultan Tarimo wrote: > The former as the following is equally invalid syntax errors: > > const font =

Re: Dash-case keys

2019-01-28 Thread Sultan Tarimo
The former as the following is equally invalid syntax errors: const font = 1 const size = 1 const a = { font-size: 10 } const b = { font+size: 10 } ___ es-discuss mailing list es-discuss@mozilla.org

Re: Dash-case keys

2019-01-28 Thread Jordan Harband
is that a key called "font-size" or the subtraction of `size` from `font`? On Mon, Jan 28, 2019 at 1:48 PM Sultan wrote: > Is there any reason that dash-case keys are not supported in the object > literal syntax. > > For example: > > const style = { > font-size: 10 > } > > Compared to what

Dash-case keys

2019-01-28 Thread Sultan
Is there any reason that dash-case keys are not supported in the object literal syntax. For example: const style = { font-size: 10 } Compared to what one needs to do today: const style = { 'font-size': 10 } ___ es-discuss mailing list

Re: Proposal: Default object method

2019-01-28 Thread Brasten Sager
Yeah! The static version of this is definitely something I see as a natural next step. From my observation, tc39 proposals seem to take on the instance and static versions of a feature separately. So for that reason it wasn’t mentioned. But yes, if this proposal somehow made it through the

Re: Proposal: Default object method

2019-01-28 Thread Brasten Sager
Thank you all so much for the feedback! The push-back has given me something to more to consider. I’d like to add a couple points which are hopefully clarifying, but I do acknowledge the idea doesn’t seem to be attracting positive interest in its current form. I meant to note in the original

Re: Proposal: Default object method

2019-01-28 Thread Ranando King
Isiah: good find. I was just being sloppy to get the idea across. J. Decker: The code I gave was just an example of how to do it if it was for some reason absolutely necessary to use `class`. I don't see the need and would either tend toward your approach, or just somehow refactor away the need

Re: Proposal: Default object method

2019-01-28 Thread J Decker
On Sun, Jan 27, 2019 at 10:46 PM Ranando King wrote: > Jordan's right. This one is best handled by a function. But if there is > some reason you need to create callable objects, it's still doable, even > with ES as-is. Just extend your classes from something like this: > > ```js > class Callable

Re: Proposal: Default object method

2019-01-28 Thread Isiah Meadows
Nit: you may need to reset the function's prototype. Also, `create` should probably be static. ;-) On Mon, Jan 28, 2019 at 01:46 Ranando King wrote: > Jordan's right. This one is best handled by a function. But if there is > some reason you need to create callable objects, it's still doable,