Until ES.next, I’ve stuck to the simple rule: Always use `new` when you want to 
create an instance. That avoids confusion when it comes to functions such as 
String and Boolean: I like using them to coerce values.

Given that value object constructors such as uint64 are currently invoked 
without `new`, I’m wondering whether that rule changes:

- Do we still need `new`? If we had class declarations, their desugared 
versions could easily always create new instances, whether invoked via `new` or 
as a function. The same holds for object exemplars: Calling such an exemplar 
could “instantiate” it.

- Should there be alternate, possibly less confusing, ways of coercing values? 
ToPrimitive() would certainly be nice to have.

Axel

-- 
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

Reply via email to