tc39 / proposal-structs

JavaScript Structs: Fixed Layout Objects
http://tc39.es/proposal-structs/
622 stars 11 forks source link

`return foo;` from constructor should probably be an error #41

Open rkirsling opened 1 month ago

rkirsling commented 1 month ago

As discussed in plenary (raised by myself and @waldemarhorwat), it would probably be nicer to throw when attempting to return a value from the struct constructor (while allowing return; itself).