Re: Why Number(symbol) crashes?

2016-10-15 Thread medikoo
language behaviors to newcomers. -- View this message in context: http://mozilla.6506.n7.nabble.com/Why-Number-symbol-crashes-tp359554p359653.html Sent from the Mozilla - ECMAScript 4 discussion mailing list archive at Nabble.com. ___ es-discuss mailing

Re: Why Number(symbol) crashes?

2016-10-15 Thread Michał Wadas
To be honest, introducing new throw-on-invalid value behaviour to existing function that didn't throw before looks rather like a bad design for me. Personally I wouldn't abandon accept-anything behaviour of Number, but rather add method Number.from that will throw on all values that shouldn't be

Re: Why Number(symbol) crashes?

2016-10-14 Thread Allen Wirfs-Brock
> On Oct 14, 2016, at 11:02 AM, Claude Pache wrote: > > >> Le 11 oct. 2016 à 11:07, medikoo a écrit : >> >> I was searching the archived but wasn't able to find the answer. >> >> What's the reasoning behind having Number(symbol) crash

Re: Why Number(symbol) crashes?

2016-10-14 Thread Claude Pache
> Le 11 oct. 2016 à 11:07, medikoo a écrit : > > I was searching the archived but wasn't able to find the answer. > > What's the reasoning behind having Number(symbol) crash instead of returning > NaN (as it's in case all other non-coercible values?). It feels

Re: Why Number(symbol) crashes?

2016-10-11 Thread Jordan Harband
whoops, sorry, I missed the earlier thread. disregard. On Tue, Oct 11, 2016 at 5:53 PM, Jordan Harband wrote: > I'm not sure what you're asking. `Number(Symbol())` throws a TypeError. > > Perhaps are you using a Symbol sham (that only partially is able to > polyfill Symbols)?

Re: Why Number(symbol) crashes?

2016-10-11 Thread Jordan Harband
I'm not sure what you're asking. `Number(Symbol())` throws a TypeError. Perhaps are you using a Symbol sham (that only partially is able to polyfill Symbols)? In what browser/engine are you seeing `NaN`? On Tue, Oct 11, 2016 at 11:37 AM, Raul-Sebastian Mihăilă < raul.miha...@gmail.com> wrote:

Why Number(symbol) crashes?

2016-10-11 Thread Raul-Sebastian Mihăilă
How is NaN useful? Isn't it better to be explicit if you really want a string? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Why Number(symbol) crashes?

2016-10-11 Thread Oriol Bugzilla
In my opinion it's a bit incoherent that each object-coercible type behaves differently when coercing symbols to it. Symbols can be explicitly coerced to strings, but not implicitly: ```js String(Symbol("abc")); // "Symbol(abc)" Symbol("abc") + ""; // TypeError ``` Symbols can't be coerced to

Re: Why Number(symbol) crashes?

2016-10-11 Thread Kris Siegel
sh instead of > returning > NaN (as it's in case all other non-coercible values?). It feels not > consistent. > > If someone can point me to some discussion that provided the reasoning I'd > be grateful > > > > -- > View this message in context: http://mozilla.6506.n7.na

Why Number(symbol) crashes?

2016-10-11 Thread medikoo
be grateful -- View this message in context: http://mozilla.6506.n7.nabble.com/Why-Number-symbol-crashes-tp359554.html Sent from the Mozilla - ECMAScript 4 discussion mailing list archive at Nabble.com. ___ es-discuss mailing list es-discuss